diff options
author | Douglas Anderson <dianders@chromium.org> | 2016-11-16 10:04:50 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-11-30 12:15:45 +0100 |
commit | 3605163d98dbcd37e5d6f51c4982d7da77bdcba9 (patch) | |
tree | 4ccdec50054aac016e382ad044210bbcd5be4317 | |
parent | [media] vivid: Set color_enc on HSV formats (diff) | |
download | linux-3605163d98dbcd37e5d6f51c4982d7da77bdcba9.tar.xz linux-3605163d98dbcd37e5d6f51c4982d7da77bdcba9.zip |
[media] s5p-mfc: Set DMA_ATTR_ALLOC_SINGLE_PAGES
We do video allocation all the time and we need it to be fast. Plus TLB
efficiency isn't terribly important for video.
That means we want to set DMA_ATTR_ALLOC_SINGLE_PAGES.
See also the previous change (commit 14d3ae2efeed "ARM: dma-mapping: Use
DMA_ATTR_ALLOC_SINGLE_PAGES hint to optimize allocation").
[m.szyprowski: rebased patch onto v4.9-rc1 and adapted changes
to latest videbuf2 changes, this simplifies code changes to
only set proper dma attribute flag and comment the reason
for it, added commit id of arch/arm/mm patch]
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | drivers/media/platform/s5p-mfc/s5p_mfc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 320124352e82..da735cda2882 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -851,6 +851,11 @@ static int s5p_mfc_open(struct file *file) ret = -ENOENT; goto err_queue_init; } + /* + * We'll do mostly sequential access, so sacrifice TLB efficiency for + * faster allocation. + */ + q->dma_attrs = DMA_ATTR_ALLOC_SINGLE_PAGES; q->mem_ops = &vb2_dma_contig_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; ret = vb2_queue_init(q); @@ -881,6 +886,12 @@ static int s5p_mfc_open(struct file *file) * will keep the value of bytesused intact. */ q->allow_zero_bytesused = 1; + + /* + * We'll do mostly sequential access, so sacrifice TLB efficiency for + * faster allocation. + */ + q->dma_attrs = DMA_ATTR_ALLOC_SINGLE_PAGES; q->mem_ops = &vb2_dma_contig_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; ret = vb2_queue_init(q); |