minigbm: add (*bo_flush) implementations

Let's take the flush and writeback steps in the driver unmap
functions and move them to the (*bo_flush) callback.

BUG=chromium:764871
TEST=gbmtest, mmap_test -g on eve

Change-Id: Iecccafc25642b120bc84f2d1b8538303c8ce36eb
Reviewed-on: https://chromium-review.googlesource.com/668219
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/i915.c b/i915.c
index ef1b143..a16050f 100644
--- a/i915.c
+++ b/i915.c
@@ -476,13 +476,13 @@
 	return addr;
 }
 
-static int i915_bo_unmap(struct bo *bo, struct map_info *data)
+static int i915_bo_flush(struct bo *bo, struct map_info *data)
 {
 	struct i915_device *i915 = bo->drv->priv;
 	if (!i915->has_llc && bo->tiling == I915_TILING_NONE)
 		i915_clflush(data->addr, data->length);
 
-	return munmap(data->addr, data->length);
+	return 0;
 }
 
 static uint32_t i915_resolve_format(uint32_t format, uint64_t usage)
@@ -512,7 +512,8 @@
 	.bo_destroy = drv_gem_bo_destroy,
 	.bo_import = i915_bo_import,
 	.bo_map = i915_bo_map,
-	.bo_unmap = i915_bo_unmap,
+	.bo_unmap = drv_bo_munmap,
+	.bo_flush = i915_bo_flush,
 	.resolve_format = i915_resolve_format,
 };