To avoid evictions, use GTT only for allocation on devices with small vram size.
Signed-off-by: Akshu Agrawal <akshu.agra...@amd.com> --- src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c index 09cf9247755..aab801b6337 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c @@ -486,8 +486,15 @@ static struct amdgpu_winsys_bo *amdgpu_create_bo(struct amdgpu_winsys *ws, * shared with the OS, allow VRAM placements too. The idea is not to use * VRAM usefully, but to use it so that it's not unused and wasted. */ - if (!ws->info.has_dedicated_vram) + if (!ws->info.has_dedicated_vram) { + /* For devices having small VRAM size use GTT only to + * avoid evictions. + */ + if (ws->info.vram_size <= 16777216) + request.preferred_heap = AMDGPU_GEM_DOMAIN_GTT; + else request.preferred_heap |= AMDGPU_GEM_DOMAIN_GTT; + } } if (initial_domain & RADEON_DOMAIN_GTT) -- 2.19.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev