From df6aedd2e74d9f2684b43908908d00e0e70970c6 Mon Sep 17 00:00:00 2001 From: kfx Date: Mon, 19 Mar 2012 12:19:10 +0800 Subject: [PATCH] Ion drivers: Compatible with older versions about flush cache --- drivers/gpu/ion/ion.c | 3 +++ drivers/gpu/ion/ion_carveout_heap.c | 1 + drivers/gpu/ion/ion_priv.h | 1 + 3 files changed, 5 insertions(+) diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c index 6a1c59ae9650..378e6b1feef3 100755 --- a/drivers/gpu/ion/ion.c +++ b/drivers/gpu/ion/ion.c @@ -930,6 +930,9 @@ static long ion_share_ioctl(struct file *filp, unsigned int cmd, unsigned long a if (copy_from_user(®ion, (void __user *)arg, sizeof(struct pmem_region))) return -EFAULT; + if(!(region.offset & 0xf0000000)) + region.offset = buffer->vm_start; + dmac_flush_range((void *)region.offset, (void *)(region.offset + region.len)); break; diff --git a/drivers/gpu/ion/ion_carveout_heap.c b/drivers/gpu/ion/ion_carveout_heap.c index ec355c7da546..c8fa2d82d423 100755 --- a/drivers/gpu/ion/ion_carveout_heap.c +++ b/drivers/gpu/ion/ion_carveout_heap.c @@ -177,6 +177,7 @@ int ion_carveout_heap_map_user(struct ion_heap *heap, struct ion_buffer *buffer, vma->vm_end - vma->vm_start, pgprot_noncached(vma->vm_page_prot)); + buffer->vm_start = vma->vm_start; return err; } int ion_carveout_cache_op(struct ion_heap *heap, struct ion_buffer *buffer, diff --git a/drivers/gpu/ion/ion_priv.h b/drivers/gpu/ion/ion_priv.h index f954d2d90058..f4ef07a8e28e 100755 --- a/drivers/gpu/ion/ion_priv.h +++ b/drivers/gpu/ion/ion_priv.h @@ -75,6 +75,7 @@ struct ion_buffer { void *vaddr; int dmap_cnt; struct scatterlist *sglist; + unsigned long vm_start; int marked; }; -- 2.34.1