mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 02:20:11 +01:00
winsys/radeon: clear the buffer cache on mmap failure and try again
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
parent
eb1e1af676
commit
84a38bfc29
1 changed files with 10 additions and 3 deletions
|
|
@ -358,6 +358,12 @@ void *radeon_bo_do_map(struct radeon_bo *bo)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ptr = os_mmap(0, args.size, PROT_READ|PROT_WRITE, MAP_SHARED,
|
||||||
|
bo->rws->fd, args.addr_ptr);
|
||||||
|
if (ptr == MAP_FAILED) {
|
||||||
|
/* 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,
|
ptr = os_mmap(0, args.size, PROT_READ|PROT_WRITE, MAP_SHARED,
|
||||||
bo->rws->fd, args.addr_ptr);
|
bo->rws->fd, args.addr_ptr);
|
||||||
if (ptr == MAP_FAILED) {
|
if (ptr == MAP_FAILED) {
|
||||||
|
|
@ -365,6 +371,7 @@ void *radeon_bo_do_map(struct radeon_bo *bo)
|
||||||
fprintf(stderr, "radeon: mmap failed, errno: %i\n", errno);
|
fprintf(stderr, "radeon: mmap failed, errno: %i\n", errno);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
bo->ptr = ptr;
|
bo->ptr = ptr;
|
||||||
bo->map_count = 1;
|
bo->map_count = 1;
|
||||||
pipe_mutex_unlock(bo->map_mutex);
|
pipe_mutex_unlock(bo->map_mutex);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue