From c7f84f6513f9cc9502b9cf3bdca9b95a6b87c98b Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 1 Dec 2017 02:07:05 +0100 Subject: winsys/amdgpu: add RADEON_FLAG_READ_ONLY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle --- src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/gallium/winsys/amdgpu/drm') diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c index 9ab8f67cbc7..d3b3674f12d 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c @@ -439,7 +439,14 @@ static struct amdgpu_winsys_bo *amdgpu_create_bo(struct amdgpu_winsys *ws, if (r) goto error_va_alloc; - r = amdgpu_bo_va_op(buf_handle, 0, size, va, 0, AMDGPU_VA_OP_MAP); + unsigned vm_flags = AMDGPU_VM_PAGE_READABLE | + AMDGPU_VM_PAGE_EXECUTABLE; + + if (!(flags & RADEON_FLAG_READ_ONLY)) + vm_flags |= AMDGPU_VM_PAGE_WRITEABLE; + + r = amdgpu_bo_va_op_raw(ws->dev, buf_handle, 0, size, va, vm_flags, + AMDGPU_VA_OP_MAP); if (r) goto error_va_map; -- cgit v1.2.3