summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2015-12-09 22:45:56 +0100
committerMarek Olšák <marek.olsak@amd.com>2015-12-11 15:25:13 +0100
commit84a38bfc29bd062bd1ba8aab834d8b42a3ff1a43 (patch)
treef2e5025dd8d9f7336e5765af0af8bb9b9601d61a /src/gallium
parenteb1e1af676ae785cc4a1423a9ca35101c81f4eb8 (diff)
downloadexternal_mesa3d-84a38bfc29bd062bd1ba8aab834d8b42a3ff1a43.zip
external_mesa3d-84a38bfc29bd062bd1ba8aab834d8b42a3ff1a43.tar.gz
external_mesa3d-84a38bfc29bd062bd1ba8aab834d8b42a3ff1a43.tar.bz2
winsys/radeon: clear the buffer cache on mmap failure and try again
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_bo.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index b9716e5..ee61e54 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -361,9 +361,16 @@ void *radeon_bo_do_map(struct radeon_bo *bo)
ptr = os_mmap(0, args.size, PROT_READ|PROT_WRITE, MAP_SHARED,
bo->rws->fd, args.addr_ptr);
if (ptr == MAP_FAILED) {
- pipe_mutex_unlock(bo->map_mutex);
- fprintf(stderr, "radeon: mmap failed, errno: %i\n", errno);
- return NULL;
+ /* Clear the cache and try again. */
+ pb_cache_release_all_buffers(&bo->rws->bo_cache);
+
+ ptr = os_mmap(0, args.size, PROT_READ|PROT_WRITE, MAP_SHARED,
+ bo->rws->fd, args.addr_ptr);
+ if (ptr == MAP_FAILED) {
+ pipe_mutex_unlock(bo->map_mutex);
+ fprintf(stderr, "radeon: mmap failed, errno: %i\n", errno);
+ return NULL;
+ }
}
bo->ptr = ptr;
bo->map_count = 1;