Lines Matching full:bt

145 	const struct v4l2_bt_timings *bt = &t->bt;  in v4l2_valid_dv_timings()  local
146 const struct v4l2_bt_timings_cap *cap = &dvcap->bt; in v4l2_valid_dv_timings()
149 u32 max_hor = 3 * bt->width; in v4l2_valid_dv_timings()
154 bt->height < cap->min_height || in v4l2_valid_dv_timings()
155 bt->height > cap->max_height || in v4l2_valid_dv_timings()
156 bt->width < cap->min_width || in v4l2_valid_dv_timings()
157 bt->width > cap->max_width || in v4l2_valid_dv_timings()
158 bt->pixelclock < cap->min_pixelclock || in v4l2_valid_dv_timings()
159 bt->pixelclock > cap->max_pixelclock || in v4l2_valid_dv_timings()
161 cap->standards && bt->standards && in v4l2_valid_dv_timings()
162 !(bt->standards & cap->standards)) || in v4l2_valid_dv_timings()
163 (bt->interlaced && !(caps & V4L2_DV_BT_CAP_INTERLACED)) || in v4l2_valid_dv_timings()
164 (!bt->interlaced && !(caps & V4L2_DV_BT_CAP_PROGRESSIVE))) in v4l2_valid_dv_timings()
168 if (!bt->interlaced && in v4l2_valid_dv_timings()
169 (bt->il_vbackporch || bt->il_vsync || bt->il_vfrontporch)) in v4l2_valid_dv_timings()
177 if (bt->hfrontporch > max_hor || in v4l2_valid_dv_timings()
178 bt->hsync > max_hor || bt->hbackporch > max_hor) in v4l2_valid_dv_timings()
180 if (bt->vfrontporch > max_vert || in v4l2_valid_dv_timings()
181 bt->vsync > max_vert || bt->vbackporch > max_vert) in v4l2_valid_dv_timings()
183 if (bt->interlaced && (bt->il_vfrontporch > max_vert || in v4l2_valid_dv_timings()
184 bt->il_vsync > max_vert || bt->il_vbackporch > max_vert)) in v4l2_valid_dv_timings()
198 for (i = idx = 0; v4l2_dv_timings_presets[i].bt.width; i++) { in v4l2_enum_dv_timings_cap()
221 for (i = 0; v4l2_dv_timings_presets[i].bt.width; i++) { in v4l2_find_dv_timings_cap()
226 u32 flags = t->bt.flags & V4L2_DV_FL_REDUCED_FPS; in v4l2_find_dv_timings_cap()
229 if (can_reduce_fps(&t->bt)) in v4l2_find_dv_timings_cap()
230 t->bt.flags |= flags; in v4l2_find_dv_timings_cap()
243 for (i = 0; v4l2_dv_timings_presets[i].bt.width; i++) { in v4l2_find_dv_timings_cea861_vic()
244 const struct v4l2_bt_timings *bt = in v4l2_find_dv_timings_cea861_vic() local
245 &v4l2_dv_timings_presets[i].bt; in v4l2_find_dv_timings_cea861_vic()
247 if ((bt->flags & V4L2_DV_FL_HAS_CEA861_VIC) && in v4l2_find_dv_timings_cea861_vic()
248 bt->cea861_vic == vic) { in v4l2_find_dv_timings_cea861_vic()
273 if (t1->bt.width == t2->bt.width && in v4l2_match_dv_timings()
274 t1->bt.height == t2->bt.height && in v4l2_match_dv_timings()
275 t1->bt.interlaced == t2->bt.interlaced && in v4l2_match_dv_timings()
276 t1->bt.polarities == t2->bt.polarities && in v4l2_match_dv_timings()
277 t1->bt.pixelclock >= t2->bt.pixelclock - pclock_delta && in v4l2_match_dv_timings()
278 t1->bt.pixelclock <= t2->bt.pixelclock + pclock_delta && in v4l2_match_dv_timings()
279 t1->bt.hfrontporch == t2->bt.hfrontporch && in v4l2_match_dv_timings()
280 t1->bt.hsync == t2->bt.hsync && in v4l2_match_dv_timings()
281 t1->bt.hbackporch == t2->bt.hbackporch && in v4l2_match_dv_timings()
282 t1->bt.vfrontporch == t2->bt.vfrontporch && in v4l2_match_dv_timings()
283 t1->bt.vsync == t2->bt.vsync && in v4l2_match_dv_timings()
284 t1->bt.vbackporch == t2->bt.vbackporch && in v4l2_match_dv_timings()
286 (t1->bt.flags & V4L2_DV_FL_REDUCED_FPS) == in v4l2_match_dv_timings()
287 (t2->bt.flags & V4L2_DV_FL_REDUCED_FPS)) && in v4l2_match_dv_timings()
288 (!t1->bt.interlaced || in v4l2_match_dv_timings()
289 (t1->bt.il_vfrontporch == t2->bt.il_vfrontporch && in v4l2_match_dv_timings()
290 t1->bt.il_vsync == t2->bt.il_vsync && in v4l2_match_dv_timings()
291 t1->bt.il_vbackporch == t2->bt.il_vbackporch))) in v4l2_match_dv_timings()
300 const struct v4l2_bt_timings *bt = &t->bt; in v4l2_print_dv_timings() local
307 htot = V4L2_DV_BT_FRAME_WIDTH(bt); in v4l2_print_dv_timings()
308 vtot = V4L2_DV_BT_FRAME_HEIGHT(bt); in v4l2_print_dv_timings()
309 if (bt->interlaced) in v4l2_print_dv_timings()
312 fps = (htot * vtot) > 0 ? div_u64((100 * (u64)bt->pixelclock), in v4l2_print_dv_timings()
319 bt->width, bt->height, bt->interlaced ? "i" : "p", in v4l2_print_dv_timings()
326 dev_prefix, bt->hfrontporch, in v4l2_print_dv_timings()
327 (bt->polarities & V4L2_DV_HSYNC_POS_POL) ? "+" : "-", in v4l2_print_dv_timings()
328 bt->hsync, bt->hbackporch); in v4l2_print_dv_timings()
330 dev_prefix, bt->vfrontporch, in v4l2_print_dv_timings()
331 (bt->polarities & V4L2_DV_VSYNC_POS_POL) ? "+" : "-", in v4l2_print_dv_timings()
332 bt->vsync, bt->vbackporch); in v4l2_print_dv_timings()
333 if (bt->interlaced) in v4l2_print_dv_timings()
335 dev_prefix, bt->il_vfrontporch, in v4l2_print_dv_timings()
336 (bt->polarities & V4L2_DV_VSYNC_POS_POL) ? "+" : "-", in v4l2_print_dv_timings()
337 bt->il_vsync, bt->il_vbackporch); in v4l2_print_dv_timings()
338 pr_info("%s: pixelclock: %llu\n", dev_prefix, bt->pixelclock); in v4l2_print_dv_timings()
340 dev_prefix, bt->flags, in v4l2_print_dv_timings()
341 (bt->flags & V4L2_DV_FL_REDUCED_BLANKING) ? in v4l2_print_dv_timings()
343 ((bt->flags & V4L2_DV_FL_REDUCED_BLANKING) && in v4l2_print_dv_timings()
344 bt->vsync == 8) ? " (V2)" : "", in v4l2_print_dv_timings()
345 (bt->flags & V4L2_DV_FL_CAN_REDUCE_FPS) ? in v4l2_print_dv_timings()
347 (bt->flags & V4L2_DV_FL_REDUCED_FPS) ? in v4l2_print_dv_timings()
349 (bt->flags & V4L2_DV_FL_HALF_LINE) ? in v4l2_print_dv_timings()
351 (bt->flags & V4L2_DV_FL_IS_CE_VIDEO) ? in v4l2_print_dv_timings()
353 (bt->flags & V4L2_DV_FL_FIRST_FIELD_EXTRA_LINE) ? in v4l2_print_dv_timings()
355 (bt->flags & V4L2_DV_FL_HAS_PICTURE_ASPECT) ? in v4l2_print_dv_timings()
357 (bt->flags & V4L2_DV_FL_HAS_CEA861_VIC) ? in v4l2_print_dv_timings()
359 (bt->flags & V4L2_DV_FL_HAS_HDMI_VIC) ? in v4l2_print_dv_timings()
361 pr_info("%s: standards (0x%x):%s%s%s%s%s\n", dev_prefix, bt->standards, in v4l2_print_dv_timings()
362 (bt->standards & V4L2_DV_BT_STD_CEA861) ? " CEA" : "", in v4l2_print_dv_timings()
363 (bt->standards & V4L2_DV_BT_STD_DMT) ? " DMT" : "", in v4l2_print_dv_timings()
364 (bt->standards & V4L2_DV_BT_STD_CVT) ? " CVT" : "", in v4l2_print_dv_timings()
365 (bt->standards & V4L2_DV_BT_STD_GTF) ? " GTF" : "", in v4l2_print_dv_timings()
366 (bt->standards & V4L2_DV_BT_STD_SDI) ? " SDI" : ""); in v4l2_print_dv_timings()
367 if (bt->flags & V4L2_DV_FL_HAS_PICTURE_ASPECT) in v4l2_print_dv_timings()
369 bt->picture_aspect.numerator, in v4l2_print_dv_timings()
370 bt->picture_aspect.denominator); in v4l2_print_dv_timings()
371 if (bt->flags & V4L2_DV_FL_HAS_CEA861_VIC) in v4l2_print_dv_timings()
372 pr_info("%s: CEA-861 VIC: %u\n", dev_prefix, bt->cea861_vic); in v4l2_print_dv_timings()
373 if (bt->flags & V4L2_DV_FL_HAS_HDMI_VIC) in v4l2_print_dv_timings()
374 pr_info("%s: HDMI VIC: %u\n", dev_prefix, bt->hdmi_vic); in v4l2_print_dv_timings()
385 if (!(t->bt.flags & V4L2_DV_FL_HAS_PICTURE_ASPECT)) in v4l2_dv_timings_aspect_ratio()
388 ratio.numerator = t->bt.width * t->bt.picture_aspect.denominator; in v4l2_dv_timings_aspect_ratio()
389 ratio.denominator = t->bt.height * t->bt.picture_aspect.numerator; in v4l2_dv_timings_aspect_ratio()
409 const struct v4l2_bt_timings *bt = &t->bt; in v4l2_calc_timeperframe() local
418 htot = V4L2_DV_BT_FRAME_WIDTH(bt); in v4l2_calc_timeperframe()
419 vtot = V4L2_DV_BT_FRAME_HEIGHT(bt); in v4l2_calc_timeperframe()
420 pclk = bt->pixelclock; in v4l2_calc_timeperframe()
422 if ((bt->flags & V4L2_DV_FL_CAN_DETECT_REDUCED_FPS) && in v4l2_calc_timeperframe()
423 (bt->flags & V4L2_DV_FL_REDUCED_FPS)) in v4l2_calc_timeperframe()
629 fmt->bt.polarities = polarities; in v4l2_detect_cvt()
630 fmt->bt.width = image_width; in v4l2_detect_cvt()
631 fmt->bt.height = image_height; in v4l2_detect_cvt()
632 fmt->bt.hfrontporch = h_fp; in v4l2_detect_cvt()
633 fmt->bt.vfrontporch = v_fp; in v4l2_detect_cvt()
634 fmt->bt.hsync = hsync; in v4l2_detect_cvt()
635 fmt->bt.vsync = vsync; in v4l2_detect_cvt()
636 fmt->bt.hbackporch = frame_width - image_width - h_fp - hsync; in v4l2_detect_cvt()
639 fmt->bt.vbackporch = frame_height - image_height - v_fp - vsync; in v4l2_detect_cvt()
640 fmt->bt.interlaced = V4L2_DV_PROGRESSIVE; in v4l2_detect_cvt()
642 fmt->bt.vbackporch = (frame_height - image_height - 2 * v_fp - in v4l2_detect_cvt()
644 fmt->bt.il_vbackporch = frame_height - image_height - 2 * v_fp - in v4l2_detect_cvt()
645 2 * vsync - fmt->bt.vbackporch; in v4l2_detect_cvt()
646 fmt->bt.il_vfrontporch = v_fp; in v4l2_detect_cvt()
647 fmt->bt.il_vsync = vsync; in v4l2_detect_cvt()
648 fmt->bt.flags |= V4L2_DV_FL_HALF_LINE; in v4l2_detect_cvt()
649 fmt->bt.interlaced = V4L2_DV_INTERLACED; in v4l2_detect_cvt()
652 fmt->bt.pixelclock = pix_clk; in v4l2_detect_cvt()
653 fmt->bt.standards = V4L2_DV_BT_STD_CVT; in v4l2_detect_cvt()
656 fmt->bt.flags |= V4L2_DV_FL_REDUCED_BLANKING; in v4l2_detect_cvt()
787 fmt->bt.polarities = polarities; in v4l2_detect_gtf()
788 fmt->bt.width = image_width; in v4l2_detect_gtf()
789 fmt->bt.height = image_height; in v4l2_detect_gtf()
790 fmt->bt.hfrontporch = h_fp; in v4l2_detect_gtf()
791 fmt->bt.vfrontporch = v_fp; in v4l2_detect_gtf()
792 fmt->bt.hsync = hsync; in v4l2_detect_gtf()
793 fmt->bt.vsync = vsync; in v4l2_detect_gtf()
794 fmt->bt.hbackporch = frame_width - image_width - h_fp - hsync; in v4l2_detect_gtf()
797 fmt->bt.vbackporch = frame_height - image_height - v_fp - vsync; in v4l2_detect_gtf()
798 fmt->bt.interlaced = V4L2_DV_PROGRESSIVE; in v4l2_detect_gtf()
800 fmt->bt.vbackporch = (frame_height - image_height - 2 * v_fp - in v4l2_detect_gtf()
802 fmt->bt.il_vbackporch = frame_height - image_height - 2 * v_fp - in v4l2_detect_gtf()
803 2 * vsync - fmt->bt.vbackporch; in v4l2_detect_gtf()
804 fmt->bt.il_vfrontporch = v_fp; in v4l2_detect_gtf()
805 fmt->bt.il_vsync = vsync; in v4l2_detect_gtf()
806 fmt->bt.flags |= V4L2_DV_FL_HALF_LINE; in v4l2_detect_gtf()
807 fmt->bt.interlaced = V4L2_DV_INTERLACED; in v4l2_detect_gtf()
810 fmt->bt.pixelclock = pix_clk; in v4l2_detect_gtf()
811 fmt->bt.standards = V4L2_DV_BT_STD_GTF; in v4l2_detect_gtf()
814 fmt->bt.flags |= V4L2_DV_FL_REDUCED_BLANKING; in v4l2_detect_gtf()