]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: pci: mgb4: Fix timings comparison in VIDIOC_S_DV_TIMINGS
authorMartin Tůma <martin.tuma@digiteqautomotive.com>
Tue, 26 Aug 2025 16:28:29 +0000 (18:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:34:16 +0000 (15:34 -0500)
[ Upstream commit 0750649b528ff18d1d68aecb45b34ec22d5ab778 ]

Compare the whole v4l2_bt_timings struct, not just the width/height when
setting new timings. Timings with the same resolution and different
pixelclock can now be properly set.

Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/pci/mgb4/mgb4_vin.c

index e9332abb31729eaae9b3ab22bb68bfd698f00c29..cfb6be8a8166979f991d210c72c2c862e7b2c441 100644 (file)
@@ -624,8 +624,7 @@ static int vidioc_s_dv_timings(struct file *file, void *fh,
            timings->bt.height < video_timings_cap.bt.min_height ||
            timings->bt.height > video_timings_cap.bt.max_height)
                return -EINVAL;
-       if (timings->bt.width == vindev->timings.bt.width &&
-           timings->bt.height == vindev->timings.bt.height)
+       if (v4l2_match_dv_timings(timings, &vindev->timings, 0, false))
                return 0;
        if (vb2_is_busy(&vindev->queue))
                return -EBUSY;