diff options
author | Marek Olšák <[email protected]> | 2015-12-09 22:45:56 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-12-11 15:25:13 +0100 |
commit | 369afdb7b61b3fdc8fa2851c751d8349f15bc822 (patch) | |
tree | f3e0d5c65db68efede24493c2549a9ff6dc70f0f /src | |
parent | 84a38bfc29bd062bd1ba8aab834d8b42a3ff1a43 (diff) |
winsys/amdgpu: clear the buffer cache on mmap failure and try again
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 5 |
1 files changed, 5 insertions, 0 deletions
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; } |