From: Marek Olšák Date: Tue, 23 Apr 2019 19:24:33 +0000 (-0400) Subject: winsys/amdgpu: always set NO_CPU_ACCESS and NO_SUBALLOC on GDS resources X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d569b7cb31160e1cacdda3663f0d4249245de00d;p=mesa.git winsys/amdgpu: always set NO_CPU_ACCESS and NO_SUBALLOC on GDS resources Acked-by: Nicolai Hähnle --- diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c index 09cf9247755..37098ab305f 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c @@ -1309,11 +1309,14 @@ amdgpu_bo_create(struct radeon_winsys *rws, struct amdgpu_winsys_bo *bo; int heap = -1; + if (domain & (RADEON_DOMAIN_GDS | RADEON_DOMAIN_OA)) + flags |= RADEON_FLAG_NO_CPU_ACCESS | RADEON_FLAG_NO_SUBALLOC; + /* VRAM implies WC. This is not optional. */ assert(!(domain & RADEON_DOMAIN_VRAM) || flags & RADEON_FLAG_GTT_WC); - /* NO_CPU_ACCESS is valid with VRAM only. */ - assert(domain == RADEON_DOMAIN_VRAM || !(flags & RADEON_FLAG_NO_CPU_ACCESS)); + /* NO_CPU_ACCESS is not valid with GTT. */ + assert(!(domain & RADEON_DOMAIN_GTT) || !(flags & RADEON_FLAG_NO_CPU_ACCESS)); /* Sparse buffers must have NO_CPU_ACCESS set. */ assert(!(flags & RADEON_FLAG_SPARSE) || flags & RADEON_FLAG_NO_CPU_ACCESS);