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>
This commit is contained in:
parent
f7f633aca5
commit
cfb8876755
10 changed files with 35 additions and 23 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue