ion mmap: set page_protection 'cached'
authorkfx <kfx@rock-chips.com>
Thu, 22 Dec 2011 04:42:27 +0000 (12:42 +0800)
committerkfx <kfx@rock-chips.com>
Thu, 22 Dec 2011 04:43:02 +0000 (12:43 +0800)
drivers/gpu/ion/ion_carveout_heap.c

index 606adae13f48b959a4751d0c1c61c6f5f000956a..2500d731809cc902f36fcfb6fd0327cfef0a9b99 100644 (file)
@@ -27,6 +27,8 @@
 
 #include <asm/mach/map.h>
 
+#define ION_CACHED
+
 struct ion_carveout_heap {
        struct ion_heap heap;
        struct gen_pool *pool;
@@ -117,7 +119,11 @@ int ion_carveout_heap_map_user(struct ion_heap *heap, struct ion_buffer *buffer,
        return remap_pfn_range(vma, vma->vm_start,
                               __phys_to_pfn(buffer->priv_phys) + vma->vm_pgoff,
                               buffer->size,
+#ifdef ION_CACHED
+                   vma->vm_page_prot);
+#else
                               pgprot_noncached(vma->vm_page_prot));
+#endif
 }
 
 static struct ion_heap_ops carveout_heap_ops = {