]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: nxp: imx8-isi: Reduce minimum queued buffers from 2 to 0
authorGuoniu Zhou <guoniu.zhou@nxp.com>
Wed, 20 May 2026 12:56:20 +0000 (08:56 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 May 2026 11:03:35 +0000 (13:03 +0200)
[ Upstream commit 2f38622d0f85f317be9e6b131da6cd511db94fd2 ]

Fix a hang issue when capturing a single frame with applications like cam
in libcamera. It would hang waiting for the driver to complete the buffer,
but streaming never starts because min_queued_buffers was set to 2.

The ISI module uses a ping-pong buffer mechanism that requires two buffers
to be programmed at all times. However, when fewer than 2 user buffers are
available, the driver use internal discard buffers to fill the remaining
slot(s). Reduce minimum queued buffers from 2 to 0 allows streaming to
start without any queued buffers.

Fixes: cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver")
Cc: stable@vger.kernel.org
Signed-off-by: Guoniu Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patch.msgid.link/20260312-isi_min_buffers-v2-1-d5ea1c79ad81@nxp.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
[ renamed `min_queued_buffers` to `min_buffers_needed` ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c

index 111be77eca1caf00c16b6197d0c07c2e8adebff9..f4a9f130e3cf67ef54dc4b0bc9a2ac91f2bc97ea 100644 (file)
@@ -1456,7 +1456,7 @@ int mxc_isi_video_register(struct mxc_isi_pipe *pipe,
        q->mem_ops = &vb2_dma_contig_memops;
        q->buf_struct_size = sizeof(struct mxc_isi_buffer);
        q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
-       q->min_buffers_needed = 2;
+       q->min_buffers_needed = 0;
        q->lock = &video->lock;
        q->dev = pipe->isi->dev;