Commit 82b88d4d authored by Marek Vasut's avatar Marek Vasut Committed by Mauro Carvalho Chehab

media: stm32-dcmi: Enable incoherent buffer allocation

Set allow_cache_hints to 1 for the vb2_queue capture queue in the
STM32MP15xx DCMI V4L2 driver. This allows us to allocate buffers
with the V4L2_MEMORY_FLAG_NON_COHERENT set. On STM32MP15xx SoCs,
this enables caching for this memory, which improves performance
when being read from CPU.

This change should be safe from race conditions since videobuf2
already invalidates or flushes the appropriate cache lines in
its prepare() and finish() methods.

Tested on a STM32MP157F SoC. Resulted in 4x buffer access speedup.
Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 1634b7ad
......@@ -2084,6 +2084,7 @@ static int dcmi_probe(struct platform_device *pdev)
q->mem_ops = &vb2_dma_contig_memops;
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
q->min_buffers_needed = 2;
q->allow_cache_hints = 1;
q->dev = &pdev->dev;
ret = vb2_queue_init(q);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment