minigbm: refactor and rename mapping struct

Since some drivers (AMDGPU, Tegra) may have to do expensive tiling
and detiling operations, we should try to take advantage of the
access regions passed in by gralloc and gbm. Let's refactor struct
map_data so we can separate the actual mapping and access region.

Here is the Coccinelle rule used in this change:

@@ struct map_info *M; @@
-   (M)
+   M->vma

In addition, struct map_data was also renamed to struct mapping.

BUG=chromium:764871
TEST= mmap_test -g on Kevin

Change-Id: Idb094aa3b5f81e45ce3a2f4fb2d9bf8fba32bf29
Reviewed-on: https://chromium-review.googlesource.com/758144
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Joe Kniss <djmk@google.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
diff --git a/drv.h b/drv.h
index 7abaf79..bfde327 100644
--- a/drv.h
+++ b/drv.h
@@ -78,7 +78,7 @@
 	uint64_t use_flags;
 };
 
-struct map_info {
+struct vma {
 	void *addr;
 	size_t length;
 	uint32_t handle;
@@ -87,6 +87,10 @@
 	void *priv;
 };
 
+struct mapping {
+	struct vma *vma;
+};
+
 struct driver *drv_create(int fd);
 
 void drv_destroy(struct driver *drv);
@@ -111,13 +115,13 @@
 struct bo *drv_bo_import(struct driver *drv, struct drv_import_fd_data *data);
 
 void *drv_bo_map(struct bo *bo, uint32_t x, uint32_t y, uint32_t width, uint32_t height,
-		 uint32_t map_flags, struct map_info **map_data, size_t plane);
+		 uint32_t map_flags, struct mapping **map_data, size_t plane);
 
-int drv_bo_unmap(struct bo *bo, struct map_info *data);
+int drv_bo_unmap(struct bo *bo, struct mapping *mapping);
 
-int drv_bo_invalidate(struct bo *bo, struct map_info *data);
+int drv_bo_invalidate(struct bo *bo, struct mapping *mapping);
 
-int drv_bo_flush(struct bo *bo, struct map_info *data);
+int drv_bo_flush(struct bo *bo, struct mapping *mapping);
 
 uint32_t drv_bo_get_width(struct bo *bo);