diff options
author | David Brown <david.brown@arm.com> | 2015-02-09 10:09:21 +0000 |
---|---|---|
committer | Ryan Harkin <ryan.harkin@linaro.org> | 2015-02-10 06:46:12 +0000 |
commit | ecba8723122fc38cf9fbce820f469a6508fd6b55 (patch) | |
tree | 100ae1bed9b2f58d5d3e3781cde578a9b29038ab | |
parent | 6f186e3250782c50651be81987b95d75e0e6d8c7 (diff) |
juno: ion: Hack around bogus physical addresses
Temporary workaround to avoid the issue that sg_phys
is returning bogus addresses from the DMA heap in Juno's
ION implementation.
Signed-off-by: David Brown <david.brown@arm.com>
-rw-r--r-- | drivers/staging/android/ion/ion.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 62cb8017c18..4e34f6541a7 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -252,8 +252,25 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, memory comming from the heaps is ready for dma, ie if it has a cached mapping that mapping has been invalidated */ for_each_sg(buffer->sg_table->sgl, sg, buffer->sg_table->nents, i) { + + +if(buffer && buffer->heap && buffer->heap->ops && buffer->heap->ops->phys) +{ + ion_phys_addr_t addr; + size_t len; +// sg_dma_address(sg) = sg_phys(sg); + buffer->heap->ops->phys(buffer->heap, buffer, &addr, &len); + sg_dma_address(sg) = addr; +// sg_dma_len(sg) = sg->length; + sg_dma_len(sg) = len; +} +else +{ + sg_dma_address(sg) = sg_phys(sg); sg_dma_len(sg) = sg->length; +} + } mutex_lock(&dev->buffer_lock); ion_buffer_add(dev, buffer); |