aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRebecca Schultz Zavin2013-01-14 17:29:10 -0600
committerArve Hjønnevåg2013-02-19 19:56:17 -0600
commit4373bbc2bb1cc94c4e5711148bd134fe4cebd34a (patch)
tree4b896fe76e5d190d90b2972f2e721c265f80bbb6
parent949863b55e4af857698901f62b52df5fcb1e7089 (diff)
downloadkernel-common-4373bbc2bb1cc94c4e5711148bd134fe4cebd34a.tar.gz
kernel-common-4373bbc2bb1cc94c4e5711148bd134fe4cebd34a.tar.xz
kernel-common-4373bbc2bb1cc94c4e5711148bd134fe4cebd34a.zip
gpu: ion: Only flush buffers in the chunk heap if they were used cached
Change-Id: I4ffcf81a6be09e968310bbd882fb017415d61b48 Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
-rw-r--r--drivers/gpu/ion/ion_chunk_heap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/ion/ion_chunk_heap.c b/drivers/gpu/ion/ion_chunk_heap.c
index f65274d3306..687af63b9f5 100644
--- a/drivers/gpu/ion/ion_chunk_heap.c
+++ b/drivers/gpu/ion/ion_chunk_heap.c
@@ -104,8 +104,9 @@ static void ion_chunk_heap_free(struct ion_buffer *buffer)
104 ion_heap_buffer_zero(buffer); 104 ion_heap_buffer_zero(buffer);
105 105
106 for_each_sg(table->sgl, sg, table->nents, i) { 106 for_each_sg(table->sgl, sg, table->nents, i) {
107 __dma_page_cpu_to_dev(sg_page(sg), 0, sg_dma_len(sg), 107 if (ion_buffer_cached(buffer))
108 DMA_BIDIRECTIONAL); 108 __dma_page_cpu_to_dev(sg_page(sg), 0, sg_dma_len(sg),
109 DMA_BIDIRECTIONAL);
109 gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)), 110 gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)),
110 sg_dma_len(sg)); 111 sg_dma_len(sg));
111 } 112 }