gpu: ion: don't fault in individual pages for the CP heap

The CP heap has some additional requirements regarding user mappings
that can't be satisfied with the current model of faulting in
individual pages. To fix this, use the CP heap's existing .map_user
callback to insert all of the pages into the VMA at mmap time, rather
than faulting them in on demand. This is the way it was always done
before the individual faulting scheme was introduced.

Change-Id: I9f1bbb2a0e65602bb74ab01d38e6e88d57327d9c
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
diff --git a/drivers/gpu/ion/ion_cp_heap.c b/drivers/gpu/ion/ion_cp_heap.c
index 2e0a473..445e67f 100644
--- a/drivers/gpu/ion/ion_cp_heap.c
+++ b/drivers/gpu/ion/ion_cp_heap.c
@@ -457,6 +457,12 @@
 	struct ion_cp_buffer *buf;
 	phys_addr_t addr;
 
+	/*
+	 * we never want Ion to fault pages in for us with this
+	 * heap. We want to set up the mappings ourselves in .map_user
+	 */
+	flags |= ION_FLAG_CACHED_NEEDS_SYNC;
+
 	buf = kzalloc(sizeof(*buf), GFP_KERNEL);
 	if (!buf)
 		return ION_CP_ALLOCATE_FAIL;