Am 25.04.19 um 13:37 schrieb Agrawal, Akshu:
To avoid evictions, use GTT only for allocation on devices with
small vram size.

Signed-off-by: Akshu Agrawal <[email protected]>
---
  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;

Well that will certainly cause problems because it would result in scanout BOs to be forced into GTT.

Christian.

+      else
           request.preferred_heap |= AMDGPU_GEM_DOMAIN_GTT;
+      }
     }
if (initial_domain & RADEON_DOMAIN_GTT)

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to