diff options
author | Thomas Hellstrom <[email protected]> | 2014-03-31 09:01:24 +0200 |
---|---|---|
committer | Thomas Hellstrom <[email protected]> | 2014-04-02 18:32:44 +0200 |
commit | 5dc206525b6ff799870f880469a985f3d944eb77 (patch) | |
tree | b55b5e62bb9913ee080e8b8a5a5cc1f11707f3d9 /src | |
parent | 76ba50a25a8bbc1e5fbcdb24da7e09f8996cf2c5 (diff) |
winsys/svga: Replace the query mm buffer pool with a slab pool v3
This is to avoid running out of query buffer space due to winsys
limitations. Instead of a fixed size per screen pool of query buffers,
use a slab allocator that allocates a new slab if we run out of space
in the first one.
v2: Correct email addresses.
v3: s/8192/VMW_QUERY_POOL_SIZE/. Improve documentation and log message.
Reported-and-tested-by: Brian Paul <[email protected]>
Signed-off-by: Thomas Hellstrom <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Cc: "10.1" <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/winsys/svga/drm/vmw_screen_pools.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_pools.c b/src/gallium/winsys/svga/drm/vmw_screen_pools.c index c97b71fc5e4..50d2a81fdb0 100644 --- a/src/gallium/winsys/svga/drm/vmw_screen_pools.c +++ b/src/gallium/winsys/svga/drm/vmw_screen_pools.c @@ -76,15 +76,23 @@ vmw_pools_cleanup(struct vmw_winsys_screen *vws) * * Typically this pool should be created on demand when we * detect that the app will be using queries. There's nothing - * special with this pool other than the backing kernel buffer size, - * which is limited to 8192. + * special with this pool other than the backing kernel buffer sizes, + * which are limited to 8192. + * If there is a performance issue with allocation and freeing of the + * query slabs, it should be easily fixable by allocating them out + * of a buffer cache. */ boolean vmw_query_pools_init(struct vmw_winsys_screen *vws) { - vws->pools.query_mm = mm_bufmgr_create(vws->pools.gmr, - VMW_QUERY_POOL_SIZE, - 3 /* 8 alignment */); + struct pb_desc desc; + + desc.alignment = 16; + desc.usage = ~(VMW_BUFFER_USAGE_SHARED | VMW_BUFFER_USAGE_SYNC); + + vws->pools.query_mm = pb_slab_range_manager_create(vws->pools.gmr, 16, 128, + VMW_QUERY_POOL_SIZE, + &desc); if (!vws->pools.query_mm) return FALSE; |