diff options
author | Rebecca Schultz Zavin <rebecca@android.com> | 2013-12-13 14:24:33 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-14 08:55:41 -0800 |
commit | 88d4bda8807d846cc31e13ee58a28c7c0d3afbd0 (patch) | |
tree | d08bf7f93a3fda9e52c63757d4a9561ffaedd715 /drivers/staging/android/ion/ion_chunk_heap.c | |
parent | 0b6b2cde0928707a618ce8c07970219f21d066e5 (diff) |
gpu: ion: Only flush buffers in the chunk heap if they were used cached
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
[jstultz: modified patch to apply to staging directory]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android/ion/ion_chunk_heap.c')
-rw-r--r-- | drivers/staging/android/ion/ion_chunk_heap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/android/ion/ion_chunk_heap.c b/drivers/staging/android/ion/ion_chunk_heap.c index 558290989fe6..60cd91ca2071 100644 --- a/drivers/staging/android/ion/ion_chunk_heap.c +++ b/drivers/staging/android/ion/ion_chunk_heap.c @@ -104,8 +104,9 @@ static void ion_chunk_heap_free(struct ion_buffer *buffer) ion_heap_buffer_zero(buffer); for_each_sg(table->sgl, sg, table->nents, i) { - __dma_page_cpu_to_dev(sg_page(sg), 0, sg_dma_len(sg), - DMA_BIDIRECTIONAL); + if (ion_buffer_cached(buffer)) + __dma_page_cpu_to_dev(sg_page(sg), 0, sg_dma_len(sg), + DMA_BIDIRECTIONAL); gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)), sg_dma_len(sg)); } |