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

[media] adv: use V4L2_DV_FL_IS_CE_VIDEO instead of V4L2_DV_BT_STD_CEA861

Don't rely on V4L2_DV_BT_STD_CEA861 since that include the
640x480p format, which is an IT format, not CE.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <mats.randgaard@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
680fee04 8b44b4e5

+16 -14
+5 -5
drivers/media/i2c/ad9389b.c
··· 239 239 { 240 240 struct ad9389b_state *state = get_ad9389b_state(sd); 241 241 242 - if (state->dv_timings.bt.standards & V4L2_DV_BT_STD_CEA861) { 243 - /* CEA format, not IT */ 242 + if (state->dv_timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { 243 + /* CE format, not IT */ 244 244 ad9389b_wr_and_or(sd, 0xcd, 0xbf, 0x00); 245 245 } else { 246 246 /* IT format */ ··· 255 255 switch (ctrl->val) { 256 256 case V4L2_DV_RGB_RANGE_AUTO: 257 257 /* automatic */ 258 - if (state->dv_timings.bt.standards & V4L2_DV_BT_STD_CEA861) { 259 - /* cea format, RGB limited range (16-235) */ 258 + if (state->dv_timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { 259 + /* CE format, RGB limited range (16-235) */ 260 260 ad9389b_csc_rgb_full2limit(sd, true); 261 261 } else { 262 - /* not cea format, RGB full range (0-255) */ 262 + /* not CE format, RGB full range (0-255) */ 263 263 ad9389b_csc_rgb_full2limit(sd, false); 264 264 } 265 265 break;
+5 -5
drivers/media/i2c/adv7511.c
··· 312 312 static void adv7511_set_IT_content_AVI_InfoFrame(struct v4l2_subdev *sd) 313 313 { 314 314 struct adv7511_state *state = get_adv7511_state(sd); 315 - if (state->dv_timings.bt.standards & V4L2_DV_BT_STD_CEA861) { 316 - /* CEA format, not IT */ 315 + if (state->dv_timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { 316 + /* CE format, not IT */ 317 317 adv7511_wr_and_or(sd, 0x57, 0x7f, 0x00); 318 318 } else { 319 319 /* IT format */ ··· 331 331 /* automatic */ 332 332 struct adv7511_state *state = get_adv7511_state(sd); 333 333 334 - if (state->dv_timings.bt.standards & V4L2_DV_BT_STD_CEA861) { 335 - /* cea format, RGB limited range (16-235) */ 334 + if (state->dv_timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { 335 + /* CE format, RGB limited range (16-235) */ 336 336 adv7511_csc_rgb_full2limit(sd, true); 337 337 } else { 338 - /* not cea format, RGB full range (0-255) */ 338 + /* not CE format, RGB full range (0-255) */ 339 339 adv7511_csc_rgb_full2limit(sd, false); 340 340 } 341 341 }
+3 -2
drivers/media/i2c/adv7604.c
··· 1075 1075 /* Receiving DVI-D signal 1076 1076 * ADV7604 selects RGB limited range regardless of 1077 1077 * input format (CE/IT) in automatic mode */ 1078 - if (state->timings.bt.standards & V4L2_DV_BT_STD_CEA861) { 1078 + if (state->timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { 1079 1079 /* RGB limited range (16-235) */ 1080 1080 io_write_clr_set(sd, 0x02, 0xf0, 0x00); 1081 1081 } else { ··· 1755 1755 format->width = state->timings.bt.width; 1756 1756 format->height = state->timings.bt.height; 1757 1757 format->field = V4L2_FIELD_NONE; 1758 + format->colorspace = V4L2_COLORSPACE_SRGB; 1758 1759 1759 - if (state->timings.bt.standards & V4L2_DV_BT_STD_CEA861) 1760 + if (state->timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) 1760 1761 format->colorspace = (state->timings.bt.height <= 576) ? 1761 1762 V4L2_COLORSPACE_SMPTE170M : V4L2_COLORSPACE_REC709; 1762 1763 }
+3 -2
drivers/media/i2c/adv7842.c
··· 1119 1119 /* Receiving DVI-D signal 1120 1120 * ADV7842 selects RGB limited range regardless of 1121 1121 * input format (CE/IT) in automatic mode */ 1122 - if (state->timings.bt.standards & V4L2_DV_BT_STD_CEA861) { 1122 + if (state->timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { 1123 1123 /* RGB limited range (16-235) */ 1124 1124 io_write_and_or(sd, 0x02, 0x0f, 0x00); 1125 1125 } else { ··· 1901 1901 return 0; 1902 1902 } 1903 1903 1904 - if (state->timings.bt.standards & V4L2_DV_BT_STD_CEA861) { 1904 + fmt->colorspace = V4L2_COLORSPACE_SRGB; 1905 + if (state->timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { 1905 1906 fmt->colorspace = (state->timings.bt.height <= 576) ? 1906 1907 V4L2_COLORSPACE_SMPTE170M : V4L2_COLORSPACE_REC709; 1907 1908 }