summaryrefslogtreecommitdiff
path: root/rockchip.c
diff options
context:
space:
mode:
authorGurchetan Singh <gurchetansingh@chromium.org>2017-09-28 17:14:50 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-10-02 23:28:25 -0700
commitcfb88767557632701252c1545d3c17905c6c0f83 (patch)
treed4370867852b23d7f6b500f0ee18caac5abdef3c /rockchip.c
parentf7f633aca589e0feb838773fc1afb85260747913 (diff)
minigbm: pass in map flags to (*bo_map) callback
Some eagle-eyed observers have commented that we lose some potentially useful information for the (*bo_map) callback when we convert our map flags to page protection flags. Let's not lose this information, so pass in the map flags. We can convert to page protection flags using a helper function. BUG=chromium:764871 TEST=Boot Android and play games on Eve Change-Id: Ie2cf395109eb5a8de663dfb97a343d20ff0df30c Reviewed-on: https://chromium-review.googlesource.com/691425 Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org> Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Diffstat (limited to 'rockchip.c')
-rw-r--r--rockchip.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rockchip.c b/rockchip.c
index 58a60aa..6de5e92 100644
--- a/rockchip.c
+++ b/rockchip.c
@@ -239,7 +239,7 @@ static int rockchip_bo_create(struct bo *bo, uint32_t width, uint32_t height, ui
ARRAY_SIZE(modifiers));
}
-static void *rockchip_bo_map(struct bo *bo, struct map_info *data, size_t plane, int prot)
+static void *rockchip_bo_map(struct bo *bo, struct map_info *data, size_t plane, uint32_t map_flags)
{
int ret;
struct drm_rockchip_gem_map_off gem_map;
@@ -259,7 +259,8 @@ static void *rockchip_bo_map(struct bo *bo, struct map_info *data, size_t plane,
return MAP_FAILED;
}
- void *addr = mmap(0, bo->total_size, prot, MAP_SHARED, bo->drv->fd, gem_map.offset);
+ void *addr = mmap(0, bo->total_size, drv_get_prot(map_flags), MAP_SHARED, bo->drv->fd,
+ gem_map.offset);
data->length = bo->total_size;