summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2020-02-12 08:45:47 +0200
committerDylan Baker <dylan@pnwbakers.com>2020-02-13 11:27:16 -0800
commitc791504c106d93f93d15021735b88d5f9c35d232 (patch)
tree6a93da1dbd7695995b622a889004a5340079a1a9
parentb81f4a4092b0e4091e728ec50606dc6561963fba (diff)
downloadmesa-c791504c106d93f93d15021735b88d5f9c35d232.tar.gz
iris: fix aux buf map failure in 32bits app on Android
Cc: mesa-stable@lists.freedesktop.org Reported-by: Zhifang Long <zhifang.long@intel.com> Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3784> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3784> (cherry picked from commit fdd20be324eabab7da1ba67cf7e379398d771186)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/iris/iris_bufmgr.c17
2 files changed, 10 insertions, 9 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 947691e2196..3ef600cdeaf 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -112,7 +112,7 @@
"description": "iris: fix aux buf map failure in 32bits app on Android",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": null
},
diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c
index 167538d49c4..532c44a538d 100644
--- a/src/gallium/drivers/iris/iris_bufmgr.c
+++ b/src/gallium/drivers/iris/iris_bufmgr.c
@@ -57,6 +57,7 @@
#include "common/gen_gem.h"
#include "dev/gen_device_info.h"
#include "main/macros.h"
+#include "os/os_mman.h"
#include "util/debug.h"
#include "util/macros.h"
#include "util/hash_table.h"
@@ -762,15 +763,15 @@ bo_free(struct iris_bo *bo)
if (bo->map_cpu && !bo->userptr) {
VG_NOACCESS(bo->map_cpu, bo->size);
- munmap(bo->map_cpu, bo->size);
+ os_munmap(bo->map_cpu, bo->size);
}
if (bo->map_wc) {
VG_NOACCESS(bo->map_wc, bo->size);
- munmap(bo->map_wc, bo->size);
+ os_munmap(bo->map_wc, bo->size);
}
if (bo->map_gtt) {
VG_NOACCESS(bo->map_gtt, bo->size);
- munmap(bo->map_gtt, bo->size);
+ os_munmap(bo->map_gtt, bo->size);
}
if (bo->idle) {
@@ -933,7 +934,7 @@ iris_bo_map_cpu(struct pipe_debug_callback *dbg,
if (p_atomic_cmpxchg(&bo->map_cpu, NULL, map)) {
VG_NOACCESS(map, bo->size);
- munmap(map, bo->size);
+ os_munmap(map, bo->size);
}
}
assert(bo->map_cpu);
@@ -995,7 +996,7 @@ iris_bo_map_wc(struct pipe_debug_callback *dbg,
if (p_atomic_cmpxchg(&bo->map_wc, NULL, map)) {
VG_NOACCESS(map, bo->size);
- munmap(map, bo->size);
+ os_munmap(map, bo->size);
}
}
assert(bo->map_wc);
@@ -1053,8 +1054,8 @@ iris_bo_map_gtt(struct pipe_debug_callback *dbg,
}
/* and mmap it. */
- void *map = mmap(0, bo->size, PROT_READ | PROT_WRITE,
- MAP_SHARED, bufmgr->fd, mmap_arg.offset);
+ void *map = os_mmap(0, bo->size, PROT_READ | PROT_WRITE,
+ MAP_SHARED, bufmgr->fd, mmap_arg.offset);
if (map == MAP_FAILED) {
DBG("%s:%d: Error mapping buffer %d (%s): %s .\n",
__FILE__, __LINE__, bo->gem_handle, bo->name, strerror(errno));
@@ -1070,7 +1071,7 @@ iris_bo_map_gtt(struct pipe_debug_callback *dbg,
if (p_atomic_cmpxchg(&bo->map_gtt, NULL, map)) {
VG_NOACCESS(map, bo->size);
- munmap(map, bo->size);
+ os_munmap(map, bo->size);
}
}
assert(bo->map_gtt);