minigbm: Map and unmap correct size

We were not mapping the entire buffer for multi-plane buffer objects.

BUG=chromium:616275
TEST=NONE
CQ-DEPEND=CL:377884

Change-Id: Ia64a6eb45310abeaed3f376479a6738ccd09f0bf
Reviewed-on: https://chromium-review.googlesource.com/377841
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/mediatek.c b/mediatek.c
index 2dd4114..f4fe0ec 100644
--- a/mediatek.c
+++ b/mediatek.c
@@ -25,8 +25,7 @@
 	drv_bo_from_format(bo, width, height, format);
 
 	memset(&gem_create, 0, sizeof(gem_create));
-	gem_create.size = bo->offsets[bo->num_planes - 1] +
-			  bo->sizes[bo->num_planes - 1];
+	gem_create.size = bo->total_size;
 
 	ret = drmIoctl(bo->drv->fd, DRM_IOCTL_MTK_GEM_CREATE, &gem_create);
 	if (ret) {
@@ -55,7 +54,7 @@
 		return MAP_FAILED;
 	}
 
-	return mmap(0, bo->sizes[0], PROT_READ | PROT_WRITE, MAP_SHARED,
+	return mmap(0, bo->total_size, PROT_READ | PROT_WRITE, MAP_SHARED,
 		    bo->drv->fd, gem_map.offset);
 }