Lines Matching refs:tv_mode
308 struct tv_mode { struct
379 static const struct tv_mode tv_modes[] = {
943 static const struct tv_mode *intel_tv_mode_find(const struct drm_connector_state *conn_state) in intel_tv_mode_find()
954 const struct tv_mode *tv_mode = intel_tv_mode_find(connector->state); in intel_tv_mode_valid() local
964 if (tv_mode && abs(tv_mode->refresh - drm_mode_vrefresh(mode) * 1000) in intel_tv_mode_valid()
972 intel_tv_mode_vdisplay(const struct tv_mode *tv_mode) in intel_tv_mode_vdisplay() argument
974 if (tv_mode->progressive) in intel_tv_mode_vdisplay()
975 return tv_mode->nbr_end + 1; in intel_tv_mode_vdisplay()
977 return 2 * (tv_mode->nbr_end + 1); in intel_tv_mode_vdisplay()
982 const struct tv_mode *tv_mode) in intel_tv_mode_to_mode() argument
984 mode->clock = tv_mode->clock / in intel_tv_mode_to_mode()
985 (tv_mode->oversample >> !tv_mode->progressive); in intel_tv_mode_to_mode()
999 tv_mode->hblank_start - tv_mode->hblank_end; in intel_tv_mode_to_mode()
1001 tv_mode->htotal - tv_mode->hblank_start; in intel_tv_mode_to_mode()
1003 tv_mode->hsync_end; in intel_tv_mode_to_mode()
1004 mode->htotal = tv_mode->htotal + 1; in intel_tv_mode_to_mode()
1017 mode->vdisplay = intel_tv_mode_vdisplay(tv_mode); in intel_tv_mode_to_mode()
1018 if (tv_mode->progressive) { in intel_tv_mode_to_mode()
1020 tv_mode->vsync_start_f1 + 1; in intel_tv_mode_to_mode()
1022 tv_mode->vsync_len; in intel_tv_mode_to_mode()
1024 tv_mode->vi_end_f1 + 1; in intel_tv_mode_to_mode()
1027 tv_mode->vsync_start_f1 + 1 + in intel_tv_mode_to_mode()
1028 tv_mode->vsync_start_f2 + 1; in intel_tv_mode_to_mode()
1030 2 * tv_mode->vsync_len; in intel_tv_mode_to_mode()
1032 tv_mode->vi_end_f1 + 1 + in intel_tv_mode_to_mode()
1033 tv_mode->vi_end_f2 + 1; in intel_tv_mode_to_mode()
1045 tv_mode->progressive ? 'p' : 'i', in intel_tv_mode_to_mode()
1046 tv_mode->name); in intel_tv_mode_to_mode()
1092 struct tv_mode tv_mode = {}; in intel_tv_get_config() local
1105 tv_mode.htotal = (hctl1 & TV_HTOTAL_MASK) >> TV_HTOTAL_SHIFT; in intel_tv_get_config()
1106 tv_mode.hsync_end = (hctl1 & TV_HSYNC_END_MASK) >> TV_HSYNC_END_SHIFT; in intel_tv_get_config()
1108 tv_mode.hblank_start = (hctl3 & TV_HBLANK_START_MASK) >> TV_HBLANK_START_SHIFT; in intel_tv_get_config()
1109 tv_mode.hblank_end = (hctl3 & TV_HSYNC_END_MASK) >> TV_HBLANK_END_SHIFT; in intel_tv_get_config()
1111 tv_mode.nbr_end = (vctl1 & TV_NBR_END_MASK) >> TV_NBR_END_SHIFT; in intel_tv_get_config()
1112 tv_mode.vi_end_f1 = (vctl1 & TV_VI_END_F1_MASK) >> TV_VI_END_F1_SHIFT; in intel_tv_get_config()
1113 tv_mode.vi_end_f2 = (vctl1 & TV_VI_END_F2_MASK) >> TV_VI_END_F2_SHIFT; in intel_tv_get_config()
1115 tv_mode.vsync_len = (vctl2 & TV_VSYNC_LEN_MASK) >> TV_VSYNC_LEN_SHIFT; in intel_tv_get_config()
1116 tv_mode.vsync_start_f1 = (vctl2 & TV_VSYNC_START_F1_MASK) >> TV_VSYNC_START_F1_SHIFT; in intel_tv_get_config()
1117 tv_mode.vsync_start_f2 = (vctl2 & TV_VSYNC_START_F2_MASK) >> TV_VSYNC_START_F2_SHIFT; in intel_tv_get_config()
1119 tv_mode.clock = pipe_config->port_clock; in intel_tv_get_config()
1121 tv_mode.progressive = tv_ctl & TV_PROGRESSIVE; in intel_tv_get_config()
1125 tv_mode.oversample = 8; in intel_tv_get_config()
1128 tv_mode.oversample = 4; in intel_tv_get_config()
1131 tv_mode.oversample = 2; in intel_tv_get_config()
1134 tv_mode.oversample = 1; in intel_tv_get_config()
1146 intel_tv_mode_to_mode(&mode, &tv_mode); in intel_tv_get_config()
1172 static bool intel_tv_vert_scaling(const struct drm_display_mode *tv_mode, in intel_tv_vert_scaling() argument
1176 return tv_mode->crtc_vdisplay - in intel_tv_vert_scaling()
1190 const struct tv_mode *tv_mode = intel_tv_mode_find(conn_state); in intel_tv_compute_config() local
1196 if (!tv_mode) in intel_tv_compute_config()
1207 pipe_config->port_clock = tv_mode->clock; in intel_tv_compute_config()
1209 intel_tv_mode_to_mode(adjusted_mode, tv_mode); in intel_tv_compute_config()
1240 if (!tv_mode->progressive) { in intel_tv_compute_config()
1339 const struct tv_mode *tv_mode, in set_tv_mode_timings() argument
1345 hctl1 = (tv_mode->hsync_end << TV_HSYNC_END_SHIFT) | in set_tv_mode_timings()
1346 (tv_mode->htotal << TV_HTOTAL_SHIFT); in set_tv_mode_timings()
1348 hctl2 = (tv_mode->hburst_start << 16) | in set_tv_mode_timings()
1349 (tv_mode->hburst_len << TV_HBURST_LEN_SHIFT); in set_tv_mode_timings()
1354 hctl3 = (tv_mode->hblank_start << TV_HBLANK_START_SHIFT) | in set_tv_mode_timings()
1355 (tv_mode->hblank_end << TV_HBLANK_END_SHIFT); in set_tv_mode_timings()
1357 vctl1 = (tv_mode->nbr_end << TV_NBR_END_SHIFT) | in set_tv_mode_timings()
1358 (tv_mode->vi_end_f1 << TV_VI_END_F1_SHIFT) | in set_tv_mode_timings()
1359 (tv_mode->vi_end_f2 << TV_VI_END_F2_SHIFT); in set_tv_mode_timings()
1361 vctl2 = (tv_mode->vsync_len << TV_VSYNC_LEN_SHIFT) | in set_tv_mode_timings()
1362 (tv_mode->vsync_start_f1 << TV_VSYNC_START_F1_SHIFT) | in set_tv_mode_timings()
1363 (tv_mode->vsync_start_f2 << TV_VSYNC_START_F2_SHIFT); in set_tv_mode_timings()
1365 vctl3 = (tv_mode->veq_len << TV_VEQ_LEN_SHIFT) | in set_tv_mode_timings()
1366 (tv_mode->veq_start_f1 << TV_VEQ_START_F1_SHIFT) | in set_tv_mode_timings()
1367 (tv_mode->veq_start_f2 << TV_VEQ_START_F2_SHIFT); in set_tv_mode_timings()
1369 if (tv_mode->veq_ena) in set_tv_mode_timings()
1372 vctl4 = (tv_mode->vburst_start_f1 << TV_VBURST_START_F1_SHIFT) | in set_tv_mode_timings()
1373 (tv_mode->vburst_end_f1 << TV_VBURST_END_F1_SHIFT); in set_tv_mode_timings()
1375 vctl5 = (tv_mode->vburst_start_f2 << TV_VBURST_START_F2_SHIFT) | in set_tv_mode_timings()
1376 (tv_mode->vburst_end_f2 << TV_VBURST_END_F2_SHIFT); in set_tv_mode_timings()
1378 vctl6 = (tv_mode->vburst_start_f3 << TV_VBURST_START_F3_SHIFT) | in set_tv_mode_timings()
1379 (tv_mode->vburst_end_f3 << TV_VBURST_END_F3_SHIFT); in set_tv_mode_timings()
1381 vctl7 = (tv_mode->vburst_start_f4 << TV_VBURST_START_F4_SHIFT) | in set_tv_mode_timings()
1382 (tv_mode->vburst_end_f4 << TV_VBURST_END_F4_SHIFT); in set_tv_mode_timings()
1425 const struct tv_mode *tv_mode = intel_tv_mode_find(conn_state); in intel_tv_pre_enable() local
1435 if (!tv_mode) in intel_tv_pre_enable()
1446 video_levels = tv_mode->composite_levels; in intel_tv_pre_enable()
1447 color_conversion = tv_mode->composite_color; in intel_tv_pre_enable()
1448 burst_ena = tv_mode->burst_ena; in intel_tv_pre_enable()
1453 if (tv_mode->burst_ena) in intel_tv_pre_enable()
1461 video_levels = tv_mode->svideo_levels; in intel_tv_pre_enable()
1462 color_conversion = tv_mode->svideo_color; in intel_tv_pre_enable()
1463 burst_ena = tv_mode->burst_ena; in intel_tv_pre_enable()
1469 switch (tv_mode->oversample) { in intel_tv_pre_enable()
1484 if (tv_mode->progressive) in intel_tv_pre_enable()
1486 if (tv_mode->trilevel_sync) in intel_tv_pre_enable()
1488 if (tv_mode->pal_burst) in intel_tv_pre_enable()
1492 if (tv_mode->dda1_inc) in intel_tv_pre_enable()
1494 if (tv_mode->dda2_inc) in intel_tv_pre_enable()
1496 if (tv_mode->dda3_inc) in intel_tv_pre_enable()
1498 scctl1 |= tv_mode->sc_reset; in intel_tv_pre_enable()
1501 scctl1 |= tv_mode->dda1_inc << TV_SCDDA1_INC_SHIFT; in intel_tv_pre_enable()
1503 scctl2 = tv_mode->dda2_size << TV_SCDDA2_SIZE_SHIFT | in intel_tv_pre_enable()
1504 tv_mode->dda2_inc << TV_SCDDA2_INC_SHIFT; in intel_tv_pre_enable()
1506 scctl3 = tv_mode->dda3_size << TV_SCDDA3_SIZE_SHIFT | in intel_tv_pre_enable()
1507 tv_mode->dda3_inc << TV_SCDDA3_INC_SHIFT; in intel_tv_pre_enable()
1513 set_tv_mode_timings(dev_priv, tv_mode, burst_ena); in intel_tv_pre_enable()
1539 xsize = tv_mode->hblank_start - tv_mode->hblank_end; in intel_tv_pre_enable()
1540 ysize = intel_tv_mode_vdisplay(tv_mode); in intel_tv_pre_enable()
1553 I915_WRITE(TV_H_LUMA(i), tv_mode->filter_table[j++]); in intel_tv_pre_enable()
1555 I915_WRITE(TV_H_CHROMA(i), tv_mode->filter_table[j++]); in intel_tv_pre_enable()
1557 I915_WRITE(TV_V_LUMA(i), tv_mode->filter_table[j++]); in intel_tv_pre_enable()
1559 I915_WRITE(TV_V_CHROMA(i), tv_mode->filter_table[j++]); in intel_tv_pre_enable()
1667 const struct tv_mode *tv_mode = intel_tv_mode_find(connector->state); in intel_tv_find_better_format() local
1675 if (!tv_mode->component_only) in intel_tv_find_better_format()
1679 tv_mode = &tv_modes[i]; in intel_tv_find_better_format()
1681 if (!tv_mode->component_only) in intel_tv_find_better_format()
1743 const struct tv_mode *tv_mode) in intel_tv_is_preferred_mode() argument
1745 int vdisplay = intel_tv_mode_vdisplay(tv_mode); in intel_tv_is_preferred_mode()
1756 const struct tv_mode *tv_mode) in intel_tv_set_mode_type() argument
1760 if (intel_tv_is_preferred_mode(mode, tv_mode)) in intel_tv_set_mode_type()
1768 const struct tv_mode *tv_mode = intel_tv_mode_find(connector->state); in intel_tv_get_modes() local
1776 !tv_mode->progressive && in intel_tv_get_modes()
1777 !tv_mode->component_only) in intel_tv_get_modes()
1782 input->h > intel_tv_mode_vdisplay(tv_mode)) in intel_tv_get_modes()
1796 intel_tv_mode_to_mode(mode, tv_mode); in intel_tv_get_modes()
1803 intel_tv_set_mode_type(mode, tv_mode); in intel_tv_get_modes()