[PATCH 2/4] media: tegra-vde: allow cache hints on the capture queue
From: Jerome Berclaz via B4 Relay
Date: Thu Nov 26 2026 - 19:56:18 EST
From: Jerome Berclaz <jerome.berclaz@xxxxxxxxx>
When the decoder sits behind the SMMU, buffers use vb2_dma_sg_memops,
i.e. cached pages, and vb2 cleans and invalidates every decoded frame
(1.4 MB at 720p) on each QBUF and DQBUF. A client that hands the frames
to the display or GPU as dma-bufs never reads them through the CPU, and
when it does, the dma-buf begin/end_cpu_access ops do the sync.
Set allow_cache_hints on the capture queue so that such clients can pass
V4L2_BUF_FLAG_NO_CACHE_CLEAN / V4L2_BUF_FLAG_NO_CACHE_INVALIDATE, as the
MediaTek decoder already allows.
Signed-off-by: Jerome Berclaz <jerome.berclaz@xxxxxxxxx>
---
drivers/media/platform/nvidia/tegra-vde/v4l2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/platform/nvidia/tegra-vde/v4l2.c b/drivers/media/platform/nvidia/tegra-vde/v4l2.c
index 9fe31b5c0275..cd25307ad9db 100644
--- a/drivers/media/platform/nvidia/tegra-vde/v4l2.c
+++ b/drivers/media/platform/nvidia/tegra-vde/v4l2.c
@@ -385,6 +385,7 @@ static int tegra_queue_init(void *priv,
dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
dst_vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
dst_vq->io_modes = VB2_DMABUF | VB2_MMAP;
+ dst_vq->allow_cache_hints = 1;
dst_vq->lock = &vde->v4l2_lock;
dst_vq->dma_attrs = dma_attrs;
dst_vq->mem_ops = mem_ops;
--
2.53.0