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>
diff --git a/vc4.c b/vc4.c
index 04e0ad9..20431d9 100644
--- a/vc4.c
+++ b/vc4.c
@@ -62,7 +62,7 @@
 	return 0;
 }
 
-static void *vc4_bo_map(struct bo *bo, struct map_info *data, size_t plane, int prot)
+static void *vc4_bo_map(struct bo *bo, struct map_info *data, size_t plane, uint32_t map_flags)
 {
 	int ret;
 	struct drm_vc4_mmap_bo bo_map;
@@ -77,7 +77,8 @@
 	}
 
 	data->length = bo->total_size;
-	return mmap(0, bo->total_size, prot, MAP_SHARED, bo->drv->fd, bo_map.offset);
+	return mmap(0, bo->total_size, drv_get_prot(map_flags), MAP_SHARED, bo->drv->fd,
+		    bo_map.offset);
 }
 
 struct backend backend_vc4 = {