From: Marek Olšák Date: Wed, 9 Dec 2015 21:45:56 +0000 (+0100) Subject: winsys/amdgpu: clear the buffer cache on mmap failure and try again X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=369afdb7b61b3fdc8fa2851c751d8349f15bc822;p=mesa.git winsys/amdgpu: clear the buffer cache on mmap failure and try again Reviewed-by: Michel Dänzer --- diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c index 90f3a9f35d0..a8447731dc9 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; }