iris/bufmgr: Check if iris_bo_gem_mmap failed
After refactoring of iris_bo_map_cpu and iris_bo_map_wc - immediate
return of NULL on failure to mmap a buffer was lost.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2855
Fixes: 5bc3f52dd8
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4786>
This commit is contained in:
parent
1a33358b27
commit
8f0d387441
|
@ -980,6 +980,10 @@ iris_bo_map_cpu(struct pipe_debug_callback *dbg,
|
|||
if (!bo->map_cpu) {
|
||||
DBG("iris_bo_map_cpu: %d (%s)\n", bo->gem_handle, bo->name);
|
||||
void *map = iris_bo_gem_mmap(dbg, bo, false);
|
||||
if (!map) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
VG_DEFINED(map, bo->size);
|
||||
|
||||
if (p_atomic_cmpxchg(&bo->map_cpu, NULL, map)) {
|
||||
|
@ -1027,6 +1031,10 @@ iris_bo_map_wc(struct pipe_debug_callback *dbg,
|
|||
if (!bo->map_wc) {
|
||||
DBG("iris_bo_map_wc: %d (%s)\n", bo->gem_handle, bo->name);
|
||||
void *map = iris_bo_gem_mmap(dbg, bo, true);
|
||||
if (!map) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
VG_DEFINED(map, bo->size);
|
||||
|
||||
if (p_atomic_cmpxchg(&bo->map_wc, NULL, map)) {
|
||||
|
|
Loading…
Reference in New Issue