winsys/amdgpu: clear the buffer cache on mmap failure and try again

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
Marek Olšák
2015-12-09 22:45:56 +01:00
parent 84a38bfc29
commit 369afdb7b6
@@ -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;
}