summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/svga/drm/vmw_screen.h
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2011-10-12 15:27:10 +0200
committerThomas Hellstrom <thellstrom@vmware.com>2011-10-14 09:53:19 +0200
commit5dddeb7776c62b6218add3a236551cde876b1cf0 (patch)
tree0b1e4779aa633b397e87f50e465542c8f56d7ea7 /src/gallium/winsys/svga/drm/vmw_screen.h
parent83d57635bc7b8f837add26322da04e3d93da2c55 (diff)
winsys/svga: Rework buffer allocation to make it more robust v2.
Don't allow any "CPU" buffers to be allocated by the pb_fenced buffer manager, since we can't protect against failures during buffer validation. Also, add an extra slab buffer manager to allocate buffers from the kernel if there is a failure to allocate from our big buffer pool. The reason we use a slab manager for this, is to avoid allocating many very small buffers from the kernel. v2: Increased VMW_MAX_BUFFER_SIZE and fixed some comments. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: José Fonseca <jfonseca@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Diffstat (limited to 'src/gallium/winsys/svga/drm/vmw_screen.h')
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/winsys/svga/drm/vmw_screen.h b/src/gallium/winsys/svga/drm/vmw_screen.h
index 37ccc91dc0e..1ddebf208ce 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen.h
+++ b/src/gallium/winsys/svga/drm/vmw_screen.h
@@ -43,6 +43,12 @@
#define VMW_GMR_POOL_SIZE (16*1024*1024)
#define VMW_QUERY_POOL_SIZE (8192)
+/*
+ * Something big, but arbitrary. The kernel reports an error if it can't
+ * handle this, and the svga driver will resort to multiple partial
+ * uploads.
+ */
+#define VMW_MAX_BUFFER_SIZE (512*1024*1024)
struct pb_manager;
struct vmw_region;
@@ -65,6 +71,8 @@ struct vmw_winsys_screen
struct pb_manager *gmr;
struct pb_manager *gmr_mm;
struct pb_manager *gmr_fenced;
+ struct pb_manager *gmr_slab;
+ struct pb_manager *gmr_slab_fenced;
struct pb_manager *query;
struct pb_manager *query_mm;
struct pb_manager *query_fenced;