mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
Merge pull request #5442 from heitbaum/samsung
linux (samsung): remove no-op obsolete DMA_ATTR_NON_CONSISTENT patches
This commit is contained in:
commit
ef9b52dec2
@ -1,69 +0,0 @@
|
|||||||
From a25f859386e35782c139861c6d1fe7821274d2d0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Heng-Ruey Hsu <henryhsu@chromium.org>
|
|
||||||
Date: Wed, 26 Oct 2016 10:52:06 +0200
|
|
||||||
Subject: [PATCH 07/25] MEMEKA: videobuf2-dc: Support cacheable MMAP
|
|
||||||
|
|
||||||
DMA allocations for MMAP type are uncached by default. But for
|
|
||||||
some cases, CPU has to access the buffers. ie: memcpy for format
|
|
||||||
converter. Supporting cacheable MMAP improves huge performance.
|
|
||||||
|
|
||||||
This patch enables cacheable memory for DMA coherent allocator in mmap
|
|
||||||
buffer allocation if non-consistent DMA attribute is set and kernel
|
|
||||||
mapping is present. Even if userspace doesn't mmap the buffer, sync
|
|
||||||
still should be happening if kernel mapping is present.
|
|
||||||
If not done in allocation, it is enabled when memory is mapped from
|
|
||||||
userspace (if non-consistent DMA attribute is set).
|
|
||||||
|
|
||||||
Signed-off-by: Heng-Ruey Hsu <henryhsu@chromium.org>
|
|
||||||
Tested-by: Heng-ruey Hsu <henryhsu@chromium.org>
|
|
||||||
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
|
|
||||||
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
|
|
||||||
Signed-off-by: memeka <mihailescu2m@gmail.com>
|
|
||||||
---
|
|
||||||
.../common/videobuf2/videobuf2-dma-contig.c | 16 ++++++++++++++++
|
|
||||||
1 file changed, 16 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
|
|
||||||
index 8accf13fe439..cf65bded46a9 100644
|
|
||||||
--- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c
|
|
||||||
+++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
|
|
||||||
@@ -152,6 +152,10 @@ static void vb2_dc_put(void *buf_priv)
|
|
||||||
sg_free_table(buf->sgt_base);
|
|
||||||
kfree(buf->sgt_base);
|
|
||||||
}
|
|
||||||
+ if (buf->dma_sgt) {
|
|
||||||
+ sg_free_table(buf->dma_sgt);
|
|
||||||
+ kfree(buf->dma_sgt);
|
|
||||||
+ }
|
|
||||||
dma_free_attrs(buf->dev, buf->size, buf->cookie, buf->dma_addr,
|
|
||||||
buf->attrs);
|
|
||||||
put_device(buf->dev);
|
|
||||||
@@ -193,6 +197,14 @@ static void *vb2_dc_alloc(struct device *dev, unsigned long attrs,
|
|
||||||
buf->handler.put = vb2_dc_put;
|
|
||||||
buf->handler.arg = buf;
|
|
||||||
|
|
||||||
+ /*
|
|
||||||
+ * Enable cache maintenance. Even if userspace doesn't mmap the buffer,
|
|
||||||
+ * sync still should be happening if kernel mapping is present.
|
|
||||||
+ */
|
|
||||||
+ if (!(buf->attrs & DMA_ATTR_NO_KERNEL_MAPPING) &&
|
|
||||||
+ buf->attrs & DMA_ATTR_NON_CONSISTENT)
|
|
||||||
+ buf->dma_sgt = vb2_dc_get_base_sgt(buf);
|
|
||||||
+
|
|
||||||
refcount_set(&buf->refcount, 1);
|
|
||||||
|
|
||||||
return buf;
|
|
||||||
@@ -222,6 +234,10 @@ static int vb2_dc_mmap(void *buf_priv, struct vm_area_struct *vma)
|
|
||||||
|
|
||||||
vma->vm_ops->open(vma);
|
|
||||||
|
|
||||||
+ /* Enable cache maintenance if not enabled in allocation. */
|
|
||||||
+ if (!buf->dma_sgt && buf->attrs & DMA_ATTR_NON_CONSISTENT)
|
|
||||||
+ buf->dma_sgt = vb2_dc_get_base_sgt(buf);
|
|
||||||
+
|
|
||||||
pr_debug("%s: mapped dma addr 0x%08lx at 0x%08lx, size %ld\n",
|
|
||||||
__func__, (unsigned long)buf->dma_addr, vma->vm_start,
|
|
||||||
buf->size);
|
|
||||||
--
|
|
||||||
2.17.1
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
From 96a150ab1edd5dcfd06f3d564b0cbdde4b49c6cc Mon Sep 17 00:00:00 2001
|
|
||||||
From: Marek Szyprowski <m.szyprowski@samsung.com>
|
|
||||||
Date: Wed, 15 Feb 2017 14:08:49 +0100
|
|
||||||
Subject: [PATCH 08/25] MEMEKA: ARM: dma-mapping: add support for
|
|
||||||
non-consistent dma_mmap
|
|
||||||
|
|
||||||
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
|
|
||||||
Signed-off-by: memeka <mihailescu2m@gmail.com>
|
|
||||||
---
|
|
||||||
arch/arm/mm/dma-mapping.c | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
|
|
||||||
index 80d4e66039ff..afaf2e91b0bc 100644
|
|
||||||
--- a/arch/arm/mm/dma-mapping.c
|
|
||||||
+++ b/arch/arm/mm/dma-mapping.c
|
|
||||||
@@ -567,7 +567,8 @@ static inline pgprot_t __get_dma_pgprot(unsigned long attrs, pgprot_t prot)
|
|
||||||
{
|
|
||||||
prot = (attrs & DMA_ATTR_WRITE_COMBINE) ?
|
|
||||||
pgprot_writecombine(prot) :
|
|
||||||
- pgprot_dmacoherent(prot);
|
|
||||||
+ (attrs & DMA_ATTR_NON_CONSISTENT) ?
|
|
||||||
+ prot : pgprot_dmacoherent(prot);
|
|
||||||
return prot;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.17.1
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
|||||||
From f0d2809c31442d62fe568fa32eab20f7e0baf7d8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: memeka <mihailescu2m@gmail.com>
|
|
||||||
Date: Mon, 30 Oct 2017 09:31:09 +1030
|
|
||||||
Subject: [PATCH 09/25] MEMEKA: media: s5p-mfc: use cacheable DMA buffers to
|
|
||||||
improve performance
|
|
||||||
|
|
||||||
Signed-off-by: memeka <mihailescu2m@gmail.com>
|
|
||||||
---
|
|
||||||
drivers/media/platform/s5p-mfc/s5p_mfc.c | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
|
|
||||||
index eba2b9f040df..37f2113a00ec 100644
|
|
||||||
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
|
|
||||||
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
|
|
||||||
@@ -858,7 +858,7 @@ static int s5p_mfc_open(struct file *file)
|
|
||||||
* We'll do mostly sequential access, so sacrifice TLB efficiency for
|
|
||||||
* faster allocation.
|
|
||||||
*/
|
|
||||||
- q->dma_attrs = DMA_ATTR_ALLOC_SINGLE_PAGES;
|
|
||||||
+ q->dma_attrs = DMA_ATTR_ALLOC_SINGLE_PAGES | DMA_ATTR_NON_CONSISTENT | DMA_ATTR_NO_KERNEL_MAPPING;
|
|
||||||
q->mem_ops = &vb2_dma_contig_memops;
|
|
||||||
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
|
|
||||||
ret = vb2_queue_init(q);
|
|
||||||
@@ -893,7 +893,7 @@ static int s5p_mfc_open(struct file *file)
|
|
||||||
* We'll do mostly sequential access, so sacrifice TLB efficiency for
|
|
||||||
* faster allocation.
|
|
||||||
*/
|
|
||||||
- q->dma_attrs = DMA_ATTR_ALLOC_SINGLE_PAGES;
|
|
||||||
+ q->dma_attrs = DMA_ATTR_ALLOC_SINGLE_PAGES | DMA_ATTR_NON_CONSISTENT | DMA_ATTR_NO_KERNEL_MAPPING;
|
|
||||||
q->mem_ops = &vb2_dma_contig_memops;
|
|
||||||
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
|
|
||||||
ret = vb2_queue_init(q);
|
|
||||||
--
|
|
||||||
2.17.1
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user