sgt = &buf->sg_table;
- if (device_get_dma_attr(dev) == DEV_DMA_COHERENT)
+ if (!(memflags & VB2_DMA_SG_MEMFLAG_IOMMU_UNCACHED) &&
+ (device_get_dma_attr(dev) == DEV_DMA_COHERENT))
ioprot |= IOMMU_CACHE;
buf->iova = iovmm_map(buf->dev, sgt->sgl, 0, size,
for_each_sg(sgt->sgl, s, sgt->orig_nents, i)
s->dma_address = sg_phys(s);
- if (device_get_dma_attr(dev) == DEV_DMA_COHERENT)
+ if (!(memflags & VB2_DMA_SG_MEMFLAG_IOMMU_UNCACHED) &&
+ (device_get_dma_attr(dev) == DEV_DMA_COHERENT))
ioprot |= IOMMU_CACHE;
buf->iova = iovmm_map(buf->dev, sgt->sgl, 0, size,
*/
if ((dmabuf_container_get_count(buf->db_attach->dmabuf) < 0) &&
((buf->iova == 0) || IS_ERR_VALUE(buf->iova))) {
- if (device_get_dma_attr(buf->dev) == DEV_DMA_COHERENT)
+ if (!(memflags & VB2_DMA_SG_MEMFLAG_IOMMU_UNCACHED) &&
+ (device_get_dma_attr(buf->dev) == DEV_DMA_COHERENT))
ioprot |= IOMMU_CACHE;
buf->iova = ion_iovmm_map(buf->db_attach, 0, buf->size,
#include <media/videobuf2-v4l2.h>
+#define VB2_DMA_SG_MEMFLAG_IOMMU_UNCACHED 16
+
static inline struct sg_table *vb2_dma_sg_plane_desc(
struct vb2_buffer *vb, unsigned int plane_no)
{