提交 3605163d 编写于 作者: D Douglas Anderson 提交者: Mauro Carvalho Chehab

[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 14d3ae2e "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: NDouglas Anderson <dianders@chromium.org>
Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 a000f0d3
...@@ -851,6 +851,11 @@ static int s5p_mfc_open(struct file *file) ...@@ -851,6 +851,11 @@ static int s5p_mfc_open(struct file *file)
ret = -ENOENT; ret = -ENOENT;
goto err_queue_init; 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->mem_ops = &vb2_dma_contig_memops;
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
ret = vb2_queue_init(q); ret = vb2_queue_init(q);
...@@ -881,6 +886,12 @@ static int s5p_mfc_open(struct file *file) ...@@ -881,6 +886,12 @@ static int s5p_mfc_open(struct file *file)
* will keep the value of bytesused intact. * will keep the value of bytesused intact.
*/ */
q->allow_zero_bytesused = 1; 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->mem_ops = &vb2_dma_contig_memops;
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
ret = vb2_queue_init(q); ret = vb2_queue_init(q);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册