]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: mgb4: Enumerate only the available timings
authorMartin Tůma <martin.tuma@digiteqautomotive.com>
Mon, 2 Jun 2025 09:27:51 +0000 (11:27 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Tue, 17 Jun 2025 08:35:15 +0000 (10:35 +0200)
Enumerate only the available (as given by the sysfs setup - our "EDID
replacement") timings, not all theoretically possible. This is the video
outputs part of the previous inputs patch that somehow got "lost in
translation".

Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/pci/mgb4/mgb4_vout.c

index 14c5725bd4d80fb26cfe0a0eaf748548311e68ce..c179c425e167cb3a2bbb0919dba3749dedeeb070 100644 (file)
@@ -492,7 +492,14 @@ static int vidioc_s_dv_timings(struct file *file, void *fh,
 static int vidioc_enum_dv_timings(struct file *file, void *fh,
                                  struct v4l2_enum_dv_timings *timings)
 {
-       return v4l2_enum_dv_timings_cap(timings, &video_timings_cap, NULL, NULL);
+       struct mgb4_vout_dev *voutdev = video_drvdata(file);
+
+       if (timings->index != 0)
+               return -EINVAL;
+
+       get_timings(voutdev, &timings->timings);
+
+       return 0;
 }
 
 static int vidioc_dv_timings_cap(struct file *file, void *fh,