summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/amdgpu/drm
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-06-27 21:54:20 +0200
committerMarek Olšák <[email protected]>2017-07-04 15:40:37 +0200
commit0591df025bc237de4d7fcb93a5d4dcc8e7946026 (patch)
treedc7a7e9659eb656874d008c2121173e9314e626e /src/gallium/winsys/amdgpu/drm
parentc78401564327454e08e0040e5801ce3a5fefcea4 (diff)
winsys/amdgpu: use 128KB BOs for suballocations of up to 64KB BOs
This decreases the number of BOs, but might also increase memory usage. It's better for small textures. The gameplay is on the far right: https://people.freedesktop.org/~mareko/suballoc.svg Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/winsys/amdgpu/drm')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_bo.c3
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h5
2 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
index d0d80904f1f..97bbe235a43 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -502,8 +502,9 @@ struct pb_slab *amdgpu_bo_slab_alloc(void *priv, unsigned heap,
if (!slab)
return NULL;
+ unsigned slab_size = 1 << AMDGPU_SLAB_BO_SIZE_LOG2;
slab->buffer = amdgpu_winsys_bo(amdgpu_bo_create(&ws->base,
- 64 * 1024, 64 * 1024,
+ slab_size, slab_size,
domains, flags));
if (!slab->buffer)
goto fail;
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h
index f011b8eeedf..7cd2f204842 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h
@@ -41,8 +41,9 @@
struct amdgpu_cs;
-#define AMDGPU_SLAB_MIN_SIZE_LOG2 9
-#define AMDGPU_SLAB_MAX_SIZE_LOG2 14
+#define AMDGPU_SLAB_MIN_SIZE_LOG2 9 /* 512 bytes */
+#define AMDGPU_SLAB_MAX_SIZE_LOG2 16 /* 64 KB */
+#define AMDGPU_SLAB_BO_SIZE_LOG2 17 /* 128 KB */
struct amdgpu_winsys {
struct radeon_winsys base;