Module: Mesa
Branch: master
Commit: 369afdb7b61b3fdc8fa2851c751d8349f15bc822
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=369afdb7b61b3fdc8fa2851c751d8349f15bc822

Author: Marek Olšák <[email protected]>
Date:   Wed Dec  9 22:45:56 2015 +0100

winsys/amdgpu: clear the buffer cache on mmap failure and try again

Reviewed-by: Michel Dänzer <[email protected]>

---

 src/gallium/winsys/amdgpu/drm/amdgpu_bo.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c 
b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
index 90f3a9f..a844773 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -229,6 +229,11 @@ static void *amdgpu_bo_map(struct pb_buffer *buf,
        return bo->user_ptr;
 
    r = amdgpu_bo_cpu_map(bo->bo, &cpu);
+   if (r) {
+      /* Clear the cache and try again. */
+      pb_cache_release_all_buffers(&bo->ws->bo_cache);
+      r = amdgpu_bo_cpu_map(bo->bo, &cpu);
+   }
    return r ? NULL : cpu;
 }
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to