mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
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 <brianp@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5dc206525b)
This commit is contained in:
parent
e144e14c0a
commit
95bba69398
1 changed files with 13 additions and 5 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue