From 8791e831b115b916f39ed46b497a2bcaada8b10a Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Thu, 14 Oct 2021 15:16:31 +0200 Subject: [PATCH] winsys/amdgpu: add uncached flag to the imported DRI_PRIME buffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's no point in caching this linear buffer since we're only ever writing to it. Reviewed-by: Marek Olšák Part-of: --- src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c index e1b14b71060..4c4096f98ca 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c @@ -1558,7 +1558,11 @@ static struct pb_buffer *amdgpu_bo_from_handle(struct radeon_winsys *rws, if (!bo) goto error; - r = amdgpu_bo_va_op(result.buf_handle, 0, result.alloc_size, va, 0, AMDGPU_VA_OP_MAP); + r = amdgpu_bo_va_op_raw(ws->dev, result.buf_handle, 0, result.alloc_size, va, + AMDGPU_VM_PAGE_READABLE | AMDGPU_VM_PAGE_WRITEABLE | + AMDGPU_VM_PAGE_EXECUTABLE | + (is_prime_linear_buffer ? AMDGPU_VM_MTYPE_UC : 0), + AMDGPU_VA_OP_MAP); if (r) goto error;