]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: nxp: imx8-isi: Drop mxc_isi_video.is_streaming field
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 13 Aug 2025 21:24:51 +0000 (00:24 +0300)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Sun, 31 Aug 2025 09:10:07 +0000 (11:10 +0200)
The mxc_isi_video.is_streaming field is used to track the streaming
status of the video device. The same information is also tracked by the
videobuf2 queue. Drop the is_streaming field, and check the queue
streaming status instead.

Link: https://lore.kernel.org/r/20250813212451.22140-3-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Richard Leitner <richard.leitner@linux.dev> # i.MX8MP
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h
drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c

index 206995bedca4a4c5d7873f3bc872fbae18b3cb75..d86f5ede0c0e99ae364b2f6926124cafb241a41e 100644 (file)
@@ -202,9 +202,8 @@ struct mxc_isi_video {
        struct video_device             vdev;
        struct media_pad                pad;
 
-       /* Protects is_streaming, and the vdev and vb2_q operations */
+       /* Protects the vdev and vb2_q operations */
        struct mutex                    lock;
-       bool                            is_streaming;
 
        struct v4l2_pix_format_mplane   pix;
        const struct mxc_isi_format_info *fmtinfo;
index 042b554d2775a9459a03a6c9e6901f326ea25f6d..13682bf6e9f8895bb9eb1f92d5f74b0d5968544e 100644 (file)
@@ -969,8 +969,6 @@ static int mxc_isi_vb2_prepare_streaming(struct vb2_queue *q)
        if (ret)
                goto err_stop;
 
-       video->is_streaming = true;
-
        return 0;
 
 err_stop:
@@ -1035,8 +1033,6 @@ static void mxc_isi_vb2_unprepare_streaming(struct vb2_queue *q)
        mxc_isi_video_free_discard_buffers(video);
        video_device_pipeline_stop(&video->vdev);
        mxc_isi_pipe_release(video->pipe);
-
-       video->is_streaming = false;
 }
 
 static const struct vb2_ops mxc_isi_vb2_qops = {
@@ -1317,7 +1313,7 @@ void mxc_isi_video_suspend(struct mxc_isi_pipe *pipe)
 {
        struct mxc_isi_video *video = &pipe->video;
 
-       if (!video->is_streaming)
+       if (!vb2_is_streaming(&video->vb2_q))
                return;
 
        mxc_isi_pipe_disable(pipe);
@@ -1348,7 +1344,7 @@ int mxc_isi_video_resume(struct mxc_isi_pipe *pipe)
 {
        struct mxc_isi_video *video = &pipe->video;
 
-       if (!video->is_streaming)
+       if (!vb2_is_streaming(&video->vb2_q))
                return 0;
 
        mxc_isi_video_init_channel(video);