diff options
author | Tapani Pälli <[email protected]> | 2020-02-12 08:45:47 +0200 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2020-02-13 10:54:53 +0200 |
commit | fdd20be324eabab7da1ba67cf7e379398d771186 (patch) | |
tree | d04e6b0b09e4e41bcf1f2d62673e96e6e1650632 /src/gallium | |
parent | b9e0947a9eedcfbcf1e0955fa430b1cfbc43021f (diff) |
iris: fix aux buf map failure in 32bits app on Android
Cc: [email protected]
Reported-by: Zhifang Long <[email protected]>
Signed-off-by: Tapani Pälli <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3784>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3784>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/iris/iris_bufmgr.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index d0e641b2068..b0259e7d607 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" @@ -750,15 +751,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) { @@ -921,7 +922,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); @@ -983,7 +984,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); @@ -1041,8 +1042,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)); @@ -1058,7 +1059,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); |