media: stm32-dcmi: Enable incoherent buffer allocation
authorMarek Vasut <marex@denx.de>
Sun, 5 Mar 2023 20:51:07 +0000 (21:51 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 19 Mar 2023 21:57:07 +0000 (22:57 +0100)
commit82b88d4da541e986e40445773b9c19187622d230
treeaab0d75e34896fcbaeacd7600f1c2aa8bbfc1d15
parent1634b7adcc5bef645b3666fdd564e5952a9e24e0
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: Marek Vasut <marex@denx.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/st/stm32/stm32-dcmi.c