diff --git a/projects/Samsung/patches/linux/samsung-0006-MEMEKA-videobuf2-dc-Move-vb2_dc_get_base_sgt-above-m.patch b/projects/Samsung/patches/linux/samsung-0006-MEMEKA-videobuf2-dc-Move-vb2_dc_get_base_sgt-above-m.patch index 3f9668a10c..e7442bdc78 100644 --- a/projects/Samsung/patches/linux/samsung-0006-MEMEKA-videobuf2-dc-Move-vb2_dc_get_base_sgt-above-m.patch +++ b/projects/Samsung/patches/linux/samsung-0006-MEMEKA-videobuf2-dc-Move-vb2_dc_get_base_sgt-above-m.patch @@ -18,7 +18,7 @@ diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/med index f4b4a7c135eb..8accf13fe439 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c -@@ -62,6 +62,28 @@ static unsigned long vb2_dc_get_contiguous_size(struct sg_table *sgt) +@@ -66,6 +66,31 @@ static unsigned long vb2_dc_get_contiguous_size(struct sg_table *sgt) return size; } @@ -27,6 +27,9 @@ index f4b4a7c135eb..8accf13fe439 100644 + int ret; + struct sg_table *sgt; + ++ if (buf->non_coherent_mem) ++ return buf->dma_sgt; ++ + sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); + if (!sgt) { + dev_err(buf->dev, "failed to alloc sg table\n"); @@ -47,7 +50,7 @@ index f4b4a7c135eb..8accf13fe439 100644 /*********************************************/ /* callbacks for all buffers */ /*********************************************/ -@@ -358,28 +380,6 @@ static const struct dma_buf_ops vb2_dc_dmabuf_ops = { +@@ -479,31 +504,6 @@ static const struct dma_buf_ops vb2_dc_dmabuf_ops = { .release = vb2_dc_dmabuf_ops_release, }; @@ -56,6 +59,9 @@ index f4b4a7c135eb..8accf13fe439 100644 - int ret; - struct sg_table *sgt; - +- if (buf->non_coherent_mem) +- return buf->dma_sgt; +- - sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); - if (!sgt) { - dev_err(buf->dev, "failed to alloc sg table\n"); @@ -74,8 +80,8 @@ index f4b4a7c135eb..8accf13fe439 100644 -} - static struct dma_buf *vb2_dc_get_dmabuf(struct vb2_buffer *vb, - void *buf_priv, - unsigned long flags) + void *buf_priv, + unsigned long flags) -- 2.17.1