ion: ion_sync_for_device use swiotlb_dma_ops not dummy_dma_ops [1/1]

PD#OTT-5276

Problem:
CTS EncodeDecodeTest failed. Ion sync ioctrl was
forwarded to a dummy implementation. So cached dma buffer
syncing between device and driver was inconsistent occasionally.

Solution:
Changed the dummy_dma_ops to swiotbl_dma_ops when ion_sync_for_device

Verify:
franklin, hertz

Change-Id: I16863bba6c3fe16b9c3b2b410ade6e45c9e74826
Signed-off-by: baocheng sun <baocheng.sun@amlogic.com>
This commit is contained in:
baocheng sun
2019-09-26 03:41:42 -04:00
committed by Chris KIM
parent 049e956a63
commit 96dbf99715

View File

@@ -1138,6 +1138,9 @@ int ion_sync_for_device(struct ion_client *client, int fd)
{
struct dma_buf *dmabuf;
struct ion_buffer *buffer;
#ifdef CONFIG_AMLOGIC_MODIFY
struct miscdevice *mdev;
#endif
dmabuf = dma_buf_get(fd);
if (IS_ERR(dmabuf))
@@ -1152,8 +1155,14 @@ int ion_sync_for_device(struct ion_client *client, int fd)
}
buffer = dmabuf->priv;
#ifdef CONFIG_AMLOGIC_MODIFY
mdev = &client->dev->dev;
dma_sync_sg_for_device(mdev->this_device, buffer->sg_table->sgl,
buffer->sg_table->nents, DMA_BIDIRECTIONAL);
#else
dma_sync_sg_for_device(NULL, buffer->sg_table->sgl,
buffer->sg_table->nents, DMA_BIDIRECTIONAL);
#endif
dma_buf_put(dmabuf);
return 0;
}