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 <nicolai.haehnle@amd.com>
This commit is contained in:
Marek Olšák 2017-06-27 21:54:20 +02:00
parent c784015643
commit 0591df025b
2 changed files with 5 additions and 3 deletions

View file

@ -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;

View file

@ -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;