mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 22:00:13 +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
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue