Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] vivid: support cvt, gtf timings for video out

The generation of cvt, gtf timings is already supported by v4l2-ctl.
This patch adds support for setting cvt,gtf timings for video out.
While enabling cvt,gtf in vivid capture, the vivid video out was
missed out. Adding it now.

Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Prashant Laddha and committed by
Mauro Carvalho Chehab
b1304f9b 7111cddd

+13 -2
+13 -2
drivers/media/platform/vivid/vivid-vid-out.c
··· 1124 1124 return 0; 1125 1125 } 1126 1126 1127 + static bool valid_cvt_gtf_timings(struct v4l2_dv_timings *timings) 1128 + { 1129 + struct v4l2_bt_timings *bt = &timings->bt; 1130 + 1131 + if ((bt->standards & (V4L2_DV_BT_STD_CVT | V4L2_DV_BT_STD_GTF)) && 1132 + v4l2_valid_dv_timings(timings, &vivid_dv_timings_cap, NULL, NULL)) 1133 + return true; 1134 + 1135 + return false; 1136 + } 1137 + 1127 1138 int vivid_vid_out_s_dv_timings(struct file *file, void *_fh, 1128 1139 struct v4l2_dv_timings *timings) 1129 1140 { 1130 1141 struct vivid_dev *dev = video_drvdata(file); 1131 - 1132 1142 if (!vivid_is_hdmi_out(dev)) 1133 1143 return -ENODATA; 1134 1144 if (!v4l2_find_dv_timings_cap(timings, &vivid_dv_timings_cap, 1135 - 0, NULL, NULL)) 1145 + 0, NULL, NULL) && 1146 + !valid_cvt_gtf_timings(timings)) 1136 1147 return -EINVAL; 1137 1148 if (v4l2_match_dv_timings(timings, &dev->dv_timings_out, 0)) 1138 1149 return 0;