[Mesa-dev] [PATCH 3/6] winsys/amdgpu: don't try to unmap userptr buffers

Marek Olšák maraeo at gmail.com
Sat Aug 6 18:04:58 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

no app calls this AFAIK
---
 src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
index 1805ce6..db2c77f 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -257,20 +257,23 @@ static void *amdgpu_bo_map(struct pb_buffer *buf,
       pb_cache_release_all_buffers(&bo->ws->bo_cache);
       r = amdgpu_bo_cpu_map(bo->bo, &cpu);
    }
    return r ? NULL : cpu;
 }
 
 static void amdgpu_bo_unmap(struct pb_buffer *buf)
 {
    struct amdgpu_winsys_bo *bo = (struct amdgpu_winsys_bo*)buf;
 
+   if (bo->user_ptr)
+      return;
+
    amdgpu_bo_cpu_unmap(bo->bo);
 }
 
 static const struct pb_vtbl amdgpu_winsys_bo_vtbl = {
    amdgpu_bo_destroy_or_cache
    /* other functions are never called */
 };
 
 static void amdgpu_add_buffer_to_global_list(struct amdgpu_winsys_bo *bo)
 {
-- 
2.7.4



More information about the mesa-dev mailing list