radv: Only set the MTYPE flags on GFX9+.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 8 Oct 2017 19:58:23 +0000 (21:58 +0200)
committerDave Airlie <airlied@redhat.com>
Tue, 10 Oct 2017 21:57:33 +0000 (07:57 +1000)
Older kernels fail the va_op with this flag set. If the kernel
supports GFX9 usefully, it will also support this flag.

Fixes: e8d57802fea "radv/gfx9: allocate events from uncached VA space"
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c

index d910aae4ba9fc50deb7c10d5164684768ae524e2..bffb76bb331788e696af25821bc05cb1adcbd165 100644 (file)
@@ -345,7 +345,7 @@ radv_amdgpu_winsys_bo_create(struct radeon_winsys *_ws,
 
 
        uint32_t va_flags = 0;
-       if (flags & RADEON_FLAG_VA_UNCACHED)
+       if ((flags & RADEON_FLAG_VA_UNCACHED) && ws->info.chip_class >= GFX9)
                va_flags |= AMDGPU_VM_MTYPE_UC;
        r = radv_amdgpu_bo_va_op(ws->dev, buf_handle, 0, size, va, va_flags, AMDGPU_VA_OP_MAP);
        if (r)