summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2021-01-23 21:53:30 -0500
committerMarge Bot <eric+marge@anholt.net>2021-02-03 21:53:34 +0000
commite97af11ba95f2563579414c4c68f2cbd5af4928b (patch)
tree83e57f77bdc4678e5b7be948e56223d3fa0f6799 /src/gallium/winsys/amdgpu/drm/amdgpu_bo.h
parent35005881bf969c934c57d5dffb76ad1a8efa2310 (diff)
winsys/amdgpu,pb_slab: add slabs with 3/4 of power of two sizes to save memory
Instead of aligning slab allocations to powers of two (e.g. 129K -> 256K), implement slab allocations with 3/4 of power of two sizes to reduce overallocation. (e.g. 129K -> 192K) The limitation is that the alignment must be 1/3rd of the allocation size. DeusExMD allocates 2.1 GB of VRAM. Without this, slabs waste 194 MB due to alignment, i.e. 9.2%. This commit reduces the waste to 102 MB, i.e. 4.9%. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8683>
Diffstat (limited to 'src/gallium/winsys/amdgpu/drm/amdgpu_bo.h')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_bo.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h
index d33c141e90f..c9b1cb6a517 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.h
@@ -115,6 +115,7 @@ struct amdgpu_winsys_bo {
struct amdgpu_slab {
struct pb_slab base;
+ unsigned entry_size;
struct amdgpu_winsys_bo *buffer;
struct amdgpu_winsys_bo *entries;
};