summaryrefslogtreecommitdiff
path: root/mediatek.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 /mediatek.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 'mediatek.c')
-rw-r--r--mediatek.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mediatek.c b/mediatek.c
index b999e28..8494c3d 100644
--- a/mediatek.c
+++ b/mediatek.c
@@ -78,7 +78,7 @@ static int mediatek_bo_create(struct bo *bo, uint32_t width, uint32_t height, ui
return 0;
}
-static void *mediatek_bo_map(struct bo *bo, struct map_info *data, size_t plane, int prot)
+static void *mediatek_bo_map(struct bo *bo, struct map_info *data, size_t plane, uint32_t map_flags)
{
int ret;
struct drm_mtk_gem_map_off gem_map;
@@ -93,7 +93,8 @@ static void *mediatek_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;