Lines Matching +full:dvi +full:- +full:connector
3 * Copyright (c) 2007-2008 Intel Corporation
24 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
40 (((edid)->version > (maj)) || \
41 ((edid)->version == (maj) && (edid)->revision > (min)))
70 /* Force reduced-blanking timings for detailed modes */
74 struct drm_connector *connector; member
102 /* Envision Peripherals, Inc. EN-7100e */
111 /* LG Philips LCD LP154W01-A5 */
123 /* Samsung SyncMaster 22[5-6]BW */
156 "Minimum number of valid EDID header bytes (0-8, default 6)");
194 /* per-block-type checks */ in drm_edid_block_valid()
197 if (edid->version != 1) { in drm_edid_block_valid()
198 DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version); in drm_edid_block_valid()
202 if (edid->revision > 4) in drm_edid_block_valid()
231 * drm_edid_is_valid - sanity check EDID data
234 * Sanity-check an entire EDID record (including extensions)
244 for (i = 0; i <= edid->extensions; i++) in drm_edid_is_valid()
259 * \return 0 on success or -1 on failure.
273 * adapter reports EAGAIN. However, we find that bit-banging transfers in drm_do_probe_ddc_edid()
299 * Avoid sending the segment addr to not upset non-compliant ddc in drm_do_probe_ddc_edid()
302 ret = iicbus_transfer(adapter, &msgs[3 - xfers], xfers); in drm_do_probe_ddc_edid()
307 } while (ret != 0 && --retries); in drm_do_probe_ddc_edid()
309 return ret == 0 ? 0 : -1; in drm_do_probe_ddc_edid()
325 drm_do_get_edid(struct drm_connector *connector, device_t adapter) in drm_do_get_edid() argument
329 bool print_bad_edid = !connector->bad_edid_counter || (drm_debug & DRM_DEBUGBITS_KMS); in drm_do_get_edid()
341 connector->null_edid_counter++; in drm_do_get_edid()
373 dev_warn(connector->dev->dev, in drm_do_get_edid()
375 drm_get_connector_name(connector), j); in drm_do_get_edid()
377 connector->bad_edid_counter++; in drm_do_get_edid()
382 block[EDID_LENGTH-1] += block[0x7e] - valid_extensions; in drm_do_get_edid()
395 dev_warn(connector->dev->dev, "%s: EDID block %d invalid.\n", in drm_do_get_edid()
396 drm_get_connector_name(connector), j); in drm_do_get_edid()
398 connector->bad_edid_counter++; in drm_do_get_edid()
421 * drm_get_edid - get EDID data, if available
422 * @connector: connector we're probing
426 * attach it to the connector.
430 struct edid *drm_get_edid(struct drm_connector *connector, in drm_get_edid() argument
436 edid = (struct edid *)drm_do_get_edid(connector, adapter); in drm_get_edid()
445 * edid_vendor - match a string against EDID's obfuscated vendor field
455 edid_vendor[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@'; in edid_vendor()
456 edid_vendor[1] = (((edid->mfg_id[0] & 0x3) << 3) | in edid_vendor()
457 ((edid->mfg_id[1] & 0xe0) >> 5)) + '@'; in edid_vendor()
458 edid_vendor[2] = (edid->mfg_id[1] & 0x1f) + '@'; in edid_vendor()
464 * edid_get_quirks - return quirk flags for a given EDID
477 if (edid_vendor(edid, quirk->vendor) && in edid_get_quirks()
478 (EDID_PRODUCT_ID(edid) == quirk->product_id)) in edid_get_quirks()
479 return quirk->quirks; in edid_get_quirks()
485 #define MODE_SIZE(m) ((m)->hdisplay * (m)->vdisplay)
486 #define MODE_REFRESH_DIFF(m,r) (abs((m)->vrefresh - target_refresh))
489 * edid_fixup_preferred - set preferred modes based on quirk list
490 * @connector: has mode list to fix up
493 * Walk the mode list for @connector, clearing the preferred status
496 static void edid_fixup_preferred(struct drm_connector *connector, in edid_fixup_preferred() argument
502 if (list_empty(&connector->probed_modes)) in edid_fixup_preferred()
510 preferred_mode = list_first_entry(&connector->probed_modes, in edid_fixup_preferred()
513 list_for_each_entry_safe(cur_mode, t, &connector->probed_modes, head) { in edid_fixup_preferred()
514 cur_mode->type &= ~DRM_MODE_TYPE_PREFERRED; in edid_fixup_preferred()
531 preferred_mode->type |= DRM_MODE_TYPE_PREFERRED; in edid_fixup_preferred()
537 return (mode->htotal - mode->hdisplay == 160) && in mode_is_rb()
538 (mode->hsync_end - mode->hdisplay == 80) && in mode_is_rb()
539 (mode->hsync_end - mode->hsync_start == 32) && in mode_is_rb()
540 (mode->vsync_start - mode->vdisplay == 3); in mode_is_rb()
544 * drm_mode_find_dmt - Create a copy of a mode if present in DMT
549 * @rb: Mode reduced-blanking-ness
562 if (hsize != ptr->hdisplay) in drm_mode_find_dmt()
564 if (vsize != ptr->vdisplay) in drm_mode_find_dmt()
587 n = (127 - d) / 18; in cea_for_each_detailed_block()
615 cb(&(edid->detailed_timings[i]), closure); in drm_for_each_detailed_block()
645 if (edid->revision >= 4) { in drm_monitor_supports_rb()
651 return ((edid->input & DRM_EDID_INPUT_DIGITAL) != 0); in drm_monitor_supports_rb()
704 * standard_timing_level - get std. timing level(CVT/GTF/DMT)
709 if (edid->revision >= 2) { in standard_timing_level()
710 if (edid->revision >= 4 && (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF)) in standard_timing_level()
732 * drm_mode_std - convert standard mode info (width, height, refresh) into mode
740 drm_mode_std(struct drm_connector *connector, struct edid *edid, in drm_mode_std() argument
743 struct drm_device *dev = connector->dev; in drm_mode_std()
747 unsigned aspect_ratio = (t->vfreq_aspect & EDID_TIMING_ASPECT_MASK) in drm_mode_std()
749 unsigned vfreq = (t->vfreq_aspect & EDID_TIMING_VFREQ_MASK) in drm_mode_std()
753 if (bad_std_timing(t->hsize, t->vfreq_aspect)) in drm_mode_std()
757 hsize = t->hsize * 8 + 248; in drm_mode_std()
782 * If this connector already has a mode for this size and refresh in drm_mode_std()
787 list_for_each_entry(m, &connector->probed_modes, head) in drm_mode_std()
788 if (m->hdisplay == hsize && m->vdisplay == vsize && in drm_mode_std()
796 mode->hdisplay = 1366; in drm_mode_std()
797 mode->hsync_start = mode->hsync_start - 1; in drm_mode_std()
798 mode->hsync_end = mode->hsync_end - 1; in drm_mode_std()
872 if (!(pt->misc & DRM_EDID_PT_INTERLACED)) in drm_mode_do_interlace_quirk()
876 if ((mode->hdisplay == cea_interlaced[i].w) && in drm_mode_do_interlace_quirk()
877 (mode->vdisplay == cea_interlaced[i].h / 2)) { in drm_mode_do_interlace_quirk()
878 mode->vdisplay *= 2; in drm_mode_do_interlace_quirk()
879 mode->vsync_start *= 2; in drm_mode_do_interlace_quirk()
880 mode->vsync_end *= 2; in drm_mode_do_interlace_quirk()
881 mode->vtotal *= 2; in drm_mode_do_interlace_quirk()
882 mode->vtotal |= 1; in drm_mode_do_interlace_quirk()
886 mode->flags |= DRM_MODE_FLAG_INTERLACE; in drm_mode_do_interlace_quirk()
890 * drm_mode_detailed - create a new mode from an EDID detailed timing section
905 struct detailed_pixel_timing *pt = &timing->data.pixel_data; in drm_mode_detailed()
906 unsigned hactive = (pt->hactive_hblank_hi & 0xf0) << 4 | pt->hactive_lo; in drm_mode_detailed()
907 unsigned vactive = (pt->vactive_vblank_hi & 0xf0) << 4 | pt->vactive_lo; in drm_mode_detailed()
908 unsigned hblank = (pt->hactive_hblank_hi & 0xf) << 8 | pt->hblank_lo; in drm_mode_detailed()
909 unsigned vblank = (pt->vactive_vblank_hi & 0xf) << 8 | pt->vblank_lo; in drm_mode_detailed()
910 unsigned hsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0xc0) << 2 | pt->hsync_offset_lo; in drm_mode_detailed()
911 …unsigned hsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi & 0x30) << 4 | pt->hsync_pulse… in drm_mode_detailed()
912 …unsigned vsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0xc) << 2 | pt->vsync_offset_puls… in drm_mode_detailed()
913 …unsigned vsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi & 0x3) << 4 | (pt->vsync_offse… in drm_mode_detailed()
919 if (pt->misc & DRM_EDID_PT_STEREO) { in drm_mode_detailed()
923 if (!(pt->misc & DRM_EDID_PT_SEPARATE_SYNC)) { in drm_mode_detailed()
947 timing->pixel_clock = cpu_to_le16(1088); in drm_mode_detailed()
949 mode->clock = le16_to_cpu(timing->pixel_clock) * 10; in drm_mode_detailed()
951 mode->hdisplay = hactive; in drm_mode_detailed()
952 mode->hsync_start = mode->hdisplay + hsync_offset; in drm_mode_detailed()
953 mode->hsync_end = mode->hsync_start + hsync_pulse_width; in drm_mode_detailed()
954 mode->htotal = mode->hdisplay + hblank; in drm_mode_detailed()
956 mode->vdisplay = vactive; in drm_mode_detailed()
957 mode->vsync_start = mode->vdisplay + vsync_offset; in drm_mode_detailed()
958 mode->vsync_end = mode->vsync_start + vsync_pulse_width; in drm_mode_detailed()
959 mode->vtotal = mode->vdisplay + vblank; in drm_mode_detailed()
962 if (mode->hsync_end > mode->htotal) in drm_mode_detailed()
963 mode->htotal = mode->hsync_end + 1; in drm_mode_detailed()
964 if (mode->vsync_end > mode->vtotal) in drm_mode_detailed()
965 mode->vtotal = mode->vsync_end + 1; in drm_mode_detailed()
970 pt->misc |= DRM_EDID_PT_HSYNC_POSITIVE | DRM_EDID_PT_VSYNC_POSITIVE; in drm_mode_detailed()
973 mode->flags |= (pt->misc & DRM_EDID_PT_HSYNC_POSITIVE) ? in drm_mode_detailed()
975 mode->flags |= (pt->misc & DRM_EDID_PT_VSYNC_POSITIVE) ? in drm_mode_detailed()
979 mode->width_mm = pt->width_mm_lo | (pt->width_height_mm_hi & 0xf0) << 4; in drm_mode_detailed()
980 mode->height_mm = pt->height_mm_lo | (pt->width_height_mm_hi & 0xf) << 8; in drm_mode_detailed()
983 mode->width_mm *= 10; in drm_mode_detailed()
984 mode->height_mm *= 10; in drm_mode_detailed()
988 mode->width_mm = edid->width_cm * 10; in drm_mode_detailed()
989 mode->height_mm = edid->height_cm * 10; in drm_mode_detailed()
992 mode->type = DRM_MODE_TYPE_DRIVER; in drm_mode_detailed()
993 mode->vrefresh = drm_mode_vrefresh(mode); in drm_mode_detailed()
1006 if (edid->revision >= 4) in mode_in_hsync_range()
1009 if (edid->revision >= 4) in mode_in_hsync_range()
1023 if (edid->revision >= 4) in mode_in_vsync_range()
1026 if (edid->revision >= 4) in mode_in_vsync_range()
1041 if (edid->revision >= 4 && t[10] == 0x04) in range_pixel_clock()
1042 return (t[9] * 10000) - ((t[12] >> 2) * 250); in range_pixel_clock()
1062 if (mode->clock > max_clock) in mode_in_range()
1066 if (edid->revision >= 4 && t[10] == 0x04) in mode_in_range()
1067 if (t[13] && mode->hdisplay > 8 * (t[13] + (256 * (t[12]&0x3)))) in mode_in_range()
1076 static bool valid_inferred_mode(const struct drm_connector *connector, in valid_inferred_mode() argument
1082 list_for_each_entry(m, &connector->probed_modes, head) { in valid_inferred_mode()
1083 if (mode->hdisplay == m->hdisplay && in valid_inferred_mode()
1084 mode->vdisplay == m->vdisplay && in valid_inferred_mode()
1087 if (mode->hdisplay <= m->hdisplay && in valid_inferred_mode()
1088 mode->vdisplay <= m->vdisplay) in valid_inferred_mode()
1095 drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid, in drm_dmt_modes_for_range() argument
1100 struct drm_device *dev = connector->dev; in drm_dmt_modes_for_range()
1104 valid_inferred_mode(connector, drm_dmt_modes + i)) { in drm_dmt_modes_for_range()
1107 drm_mode_probed_add(connector, newmode); in drm_dmt_modes_for_range()
1121 if (mode->hdisplay == 1368 && mode->vdisplay == 768) { in fixup_mode_1366x768()
1122 mode->hdisplay = 1366; in fixup_mode_1366x768()
1123 mode->hsync_start--; in fixup_mode_1366x768()
1124 mode->hsync_end--; in fixup_mode_1366x768()
1130 drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid, in drm_gtf_modes_for_range() argument
1135 struct drm_device *dev = connector->dev; in drm_gtf_modes_for_range()
1139 newmode = drm_gtf_mode(dev, m->w, m->h, m->r, 0, 0); in drm_gtf_modes_for_range()
1145 !valid_inferred_mode(connector, newmode)) { in drm_gtf_modes_for_range()
1150 drm_mode_probed_add(connector, newmode); in drm_gtf_modes_for_range()
1158 drm_cvt_modes_for_range(struct drm_connector *connector, struct edid *edid, in drm_cvt_modes_for_range() argument
1163 struct drm_device *dev = connector->dev; in drm_cvt_modes_for_range()
1168 newmode = drm_cvt_mode(dev, m->w, m->h, m->r, rb, 0, 0); in drm_cvt_modes_for_range()
1174 !valid_inferred_mode(connector, newmode)) { in drm_cvt_modes_for_range()
1179 drm_mode_probed_add(connector, newmode); in drm_cvt_modes_for_range()
1190 struct detailed_non_pixel *data = &timing->data.other_data; in do_inferred_modes()
1191 struct detailed_data_monitor_range *range = &data->data.range; in do_inferred_modes()
1193 if (data->type != EDID_DETAIL_MONITOR_RANGE) in do_inferred_modes()
1196 closure->modes += drm_dmt_modes_for_range(closure->connector, in do_inferred_modes()
1197 closure->edid, in do_inferred_modes()
1200 if (!version_greater(closure->edid, 1, 1)) in do_inferred_modes()
1203 switch (range->flags) { in do_inferred_modes()
1206 closure->modes += drm_gtf_modes_for_range(closure->connector, in do_inferred_modes()
1207 closure->edid, in do_inferred_modes()
1211 if (!version_greater(closure->edid, 1, 3)) in do_inferred_modes()
1214 closure->modes += drm_cvt_modes_for_range(closure->connector, in do_inferred_modes()
1215 closure->edid, in do_inferred_modes()
1225 add_inferred_modes(struct drm_connector *connector, struct edid *edid) in add_inferred_modes() argument
1228 connector, edid, 0, 0, 0 in add_inferred_modes()
1239 drm_est3_modes(struct drm_connector *connector, struct detailed_timing *timing) in drm_est3_modes() argument
1246 for (j = 7; j > 0; j--) { in drm_est3_modes()
1247 m = (i * 8) + (7 - j); in drm_est3_modes()
1251 mode = drm_mode_find_dmt(connector->dev, in drm_est3_modes()
1257 drm_mode_probed_add(connector, mode); in drm_est3_modes()
1271 struct detailed_non_pixel *data = &timing->data.other_data; in do_established_modes()
1273 if (data->type == EDID_DETAIL_EST_TIMINGS) in do_established_modes()
1274 closure->modes += drm_est3_modes(closure->connector, timing); in do_established_modes()
1278 * add_established_modes - get est. modes from EDID and add them
1285 add_established_modes(struct drm_connector *connector, struct edid *edid) in add_established_modes() argument
1287 struct drm_device *dev = connector->dev; in add_established_modes()
1288 unsigned long est_bits = edid->established_timings.t1 | in add_established_modes()
1289 (edid->established_timings.t2 << 8) | in add_established_modes()
1290 ((edid->established_timings.mfg_rsvd & 0x80) << 9); in add_established_modes()
1293 connector, edid, 0, 0, 0 in add_established_modes()
1301 drm_mode_probed_add(connector, newmode); in add_established_modes()
1318 struct detailed_non_pixel *data = &timing->data.other_data; in do_standard_modes()
1319 struct drm_connector *connector = closure->connector; in do_standard_modes() local
1320 struct edid *edid = closure->edid; in do_standard_modes()
1322 if (data->type == EDID_DETAIL_STD_MODES) { in do_standard_modes()
1328 std = &data->data.timings[i]; in do_standard_modes()
1329 newmode = drm_mode_std(connector, edid, std, in do_standard_modes()
1330 edid->revision); in do_standard_modes()
1332 drm_mode_probed_add(connector, newmode); in do_standard_modes()
1333 closure->modes++; in do_standard_modes()
1340 * add_standard_modes - get std. modes from EDID and add them
1347 add_standard_modes(struct drm_connector *connector, struct edid *edid) in add_standard_modes() argument
1351 connector, edid, 0, 0, 0 in add_standard_modes()
1357 newmode = drm_mode_std(connector, edid, in add_standard_modes()
1358 &edid->standard_timings[i], in add_standard_modes()
1359 edid->revision); in add_standard_modes()
1361 drm_mode_probed_add(connector, newmode); in add_standard_modes()
1375 static int drm_cvt_modes(struct drm_connector *connector, in drm_cvt_modes() argument
1380 struct drm_device *dev = connector->dev; in drm_cvt_modes()
1387 cvt = &(timing->data.other_data.data.cvt[i]); in drm_cvt_modes()
1389 if (!memcmp(cvt->code, empty, 3)) in drm_cvt_modes()
1392 height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 4) + 1) * 2; in drm_cvt_modes()
1393 switch (cvt->code[1] & 0x0c) { in drm_cvt_modes()
1409 if (cvt->code[2] & (1 << j)) { in drm_cvt_modes()
1414 drm_mode_probed_add(connector, newmode); in drm_cvt_modes()
1428 struct detailed_non_pixel *data = &timing->data.other_data; in do_cvt_mode()
1430 if (data->type == EDID_DETAIL_CVT_3BYTE) in do_cvt_mode()
1431 closure->modes += drm_cvt_modes(closure->connector, timing); in do_cvt_mode()
1435 add_cvt_modes(struct drm_connector *connector, struct edid *edid) in add_cvt_modes() argument
1438 connector, edid, 0, 0, 0 in add_cvt_modes()
1455 if (timing->pixel_clock) { in do_detailed_mode()
1456 newmode = drm_mode_detailed(closure->connector->dev, in do_detailed_mode()
1457 closure->edid, timing, in do_detailed_mode()
1458 closure->quirks); in do_detailed_mode()
1462 if (closure->preferred) in do_detailed_mode()
1463 newmode->type |= DRM_MODE_TYPE_PREFERRED; in do_detailed_mode()
1465 drm_mode_probed_add(closure->connector, newmode); in do_detailed_mode()
1466 closure->modes++; in do_detailed_mode()
1467 closure->preferred = 0; in do_detailed_mode()
1472 * add_detailed_modes - Add modes from detailed timings
1473 * @connector: attached connector
1478 add_detailed_modes(struct drm_connector *connector, struct edid *edid, in add_detailed_modes() argument
1482 connector, in add_detailed_modes()
1491 (edid->features & DRM_EDID_FEATURE_PREFERRED_TIMING); in add_detailed_modes()
1516 if (edid == NULL || edid->extensions == 0) in drm_find_cea_extension()
1520 for (i = 0; i < edid->extensions; i++) { in drm_find_cea_extension()
1526 if (i == edid->extensions) in drm_find_cea_extension()
1554 do_cea_modes (struct drm_connector *connector, u8 *db, u8 len) in do_cea_modes() argument
1556 struct drm_device *dev = connector->dev; in do_cea_modes()
1561 cea_mode = (*mode & 127) - 1; /* CEA modes are numbered 1..127 */ in do_cea_modes()
1567 drm_mode_probed_add(connector, newmode); in do_cea_modes()
1603 return -ERANGE; in cea_db_offsets()
1611 add_cea_modes(struct drm_connector *connector, struct edid *edid) in add_cea_modes() argument
1628 modes += do_cea_modes (connector, db+1, dbl); in add_cea_modes()
1636 parse_hdmi_vsdb(struct drm_connector *connector, const u8 *db) in parse_hdmi_vsdb() argument
1641 connector->eld[5] |= (db[6] >> 7) << 1; /* Supports_AI */ in parse_hdmi_vsdb()
1642 connector->dvi_dual = db[6] & 1; in parse_hdmi_vsdb()
1645 connector->max_tmds_clock = db[7] * 5; in parse_hdmi_vsdb()
1647 connector->latency_present[0] = db[8] >> 7; in parse_hdmi_vsdb()
1648 connector->latency_present[1] = (db[8] >> 6) & 1; in parse_hdmi_vsdb()
1651 connector->video_latency[0] = db[9]; in parse_hdmi_vsdb()
1653 connector->audio_latency[0] = db[10]; in parse_hdmi_vsdb()
1655 connector->video_latency[1] = db[11]; in parse_hdmi_vsdb()
1657 connector->audio_latency[1] = db[12]; in parse_hdmi_vsdb()
1659 DRM_DEBUG_KMS("HDMI: DVI dual %d, " in parse_hdmi_vsdb()
1664 connector->dvi_dual, in parse_hdmi_vsdb()
1665 connector->max_tmds_clock, in parse_hdmi_vsdb()
1666 (int) connector->latency_present[0], in parse_hdmi_vsdb()
1667 (int) connector->latency_present[1], in parse_hdmi_vsdb()
1668 connector->video_latency[0], in parse_hdmi_vsdb()
1669 connector->video_latency[1], in parse_hdmi_vsdb()
1670 connector->audio_latency[0], in parse_hdmi_vsdb()
1671 connector->audio_latency[1]); in parse_hdmi_vsdb()
1677 if (t->data.other_data.type == EDID_DETAIL_MONITOR_NAME) in monitor_name()
1678 *(u8 **)data = t->data.other_data.data.str.str; in monitor_name()
1697 * drm_edid_to_eld - build ELD from EDID
1698 * @connector: connector corresponding to the HDMI/DP sink
1701 * Fill the ELD (EDID-Like Data) buffer for passing to the audio driver.
1703 * - Conn_Type
1704 * - HDCP
1705 * - Port_ID
1707 void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) in drm_edid_to_eld() argument
1709 uint8_t *eld = connector->eld; in drm_edid_to_eld()
1717 memset(eld, 0, sizeof(connector->eld)); in drm_edid_to_eld()
1737 eld[16] = edid->mfg_id[0]; in drm_edid_to_eld()
1738 eld[17] = edid->mfg_id[1]; in drm_edid_to_eld()
1739 eld[18] = edid->prod_code[0]; in drm_edid_to_eld()
1740 eld[19] = edid->prod_code[1]; in drm_edid_to_eld()
1767 /* HDMI Vendor-Specific Data Block */ in drm_edid_to_eld()
1769 parse_hdmi_vsdb(connector, db); in drm_edid_to_eld()
1784 * drm_av_sync_delay - HDMI/DP sink audio-video sync delay in millisecond
1785 * @connector: connector associated with the HDMI/DP sink
1788 int drm_av_sync_delay(struct drm_connector *connector, in drm_av_sync_delay() argument
1791 int i = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); in drm_av_sync_delay()
1794 if (!connector->latency_present[0]) in drm_av_sync_delay()
1796 if (!connector->latency_present[1]) in drm_av_sync_delay()
1799 a = connector->audio_latency[i]; in drm_av_sync_delay()
1800 v = connector->video_latency[i]; in drm_av_sync_delay()
1813 a = min(2 * (a - 1), 500); in drm_av_sync_delay()
1815 v = min(2 * (v - 1), 500); in drm_av_sync_delay()
1817 return max(v - a, 0); in drm_av_sync_delay()
1822 * drm_select_eld - select one ELD from multiple HDMI/DP sinks
1832 struct drm_connector *connector; in drm_select_eld() local
1833 struct drm_device *dev = encoder->dev; in drm_select_eld()
1835 list_for_each_entry(connector, &dev->mode_config.connector_list, head) in drm_select_eld()
1836 if (connector->encoder == encoder && connector->eld[0]) in drm_select_eld()
1837 return connector; in drm_select_eld()
1844 * drm_detect_hdmi_monitor - detect whether monitor is hdmi.
1847 * Parse the CEA extension according to CEA-861-B.
1877 * drm_detect_monitor_audio - check monitor audio capability
1922 * drm_add_display_info - pull display info out if present
1924 * @info: display info (attached to connector)
1927 * structure that's part of the connector. Useful for tracking bpp and
1935 info->width_mm = edid->width_cm * 10; in drm_add_display_info()
1936 info->height_mm = edid->height_cm * 10; in drm_add_display_info()
1939 info->bpc = 0; in drm_add_display_info()
1940 info->color_formats = 0; in drm_add_display_info()
1942 if (edid->revision < 3) in drm_add_display_info()
1945 if (!(edid->input & DRM_EDID_INPUT_DIGITAL)) in drm_add_display_info()
1951 info->cea_rev = edid_ext[1]; in drm_add_display_info()
1954 info->color_formats = DRM_COLOR_FORMAT_RGB444; in drm_add_display_info()
1956 info->color_formats |= DRM_COLOR_FORMAT_YCRCB444; in drm_add_display_info()
1958 info->color_formats |= DRM_COLOR_FORMAT_YCRCB422; in drm_add_display_info()
1962 if (edid->revision < 4) in drm_add_display_info()
1965 switch (edid->input & DRM_EDID_DIGITAL_DEPTH_MASK) { in drm_add_display_info()
1967 info->bpc = 6; in drm_add_display_info()
1970 info->bpc = 8; in drm_add_display_info()
1973 info->bpc = 10; in drm_add_display_info()
1976 info->bpc = 12; in drm_add_display_info()
1979 info->bpc = 14; in drm_add_display_info()
1982 info->bpc = 16; in drm_add_display_info()
1986 info->bpc = 0; in drm_add_display_info()
1990 info->color_formats |= DRM_COLOR_FORMAT_RGB444; in drm_add_display_info()
1991 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444) in drm_add_display_info()
1992 info->color_formats |= DRM_COLOR_FORMAT_YCRCB444; in drm_add_display_info()
1993 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422) in drm_add_display_info()
1994 info->color_formats |= DRM_COLOR_FORMAT_YCRCB422; in drm_add_display_info()
1998 * drm_add_edid_modes - add modes from EDID data, if available
1999 * @connector: connector we're probing
2002 * Add the specified modes to the connector's mode list.
2006 int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) in drm_add_edid_modes() argument
2015 dev_warn(connector->dev->dev, "%s: EDID invalid.\n", in drm_add_edid_modes()
2016 drm_get_connector_name(connector)); in drm_add_edid_modes()
2024 * - preferred detailed mode in drm_add_edid_modes()
2025 * - other detailed modes from base block in drm_add_edid_modes()
2026 * - detailed modes from extension blocks in drm_add_edid_modes()
2027 * - CVT 3-byte code modes in drm_add_edid_modes()
2028 * - standard timing codes in drm_add_edid_modes()
2029 * - established timing codes in drm_add_edid_modes()
2030 * - modes inferred from GTF or CVT range information in drm_add_edid_modes()
2036 num_modes += add_detailed_modes(connector, edid, quirks); in drm_add_edid_modes()
2037 num_modes += add_cvt_modes(connector, edid); in drm_add_edid_modes()
2038 num_modes += add_standard_modes(connector, edid); in drm_add_edid_modes()
2039 num_modes += add_established_modes(connector, edid); in drm_add_edid_modes()
2040 if (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF) in drm_add_edid_modes()
2041 num_modes += add_inferred_modes(connector, edid); in drm_add_edid_modes()
2042 num_modes += add_cea_modes(connector, edid); in drm_add_edid_modes()
2045 edid_fixup_preferred(connector, quirks); in drm_add_edid_modes()
2047 drm_add_display_info(edid, &connector->display_info); in drm_add_edid_modes()
2054 * drm_add_modes_noedid - add modes for the connectors without EDID
2055 * @connector: connector we're probing
2059 * Add the specified modes to the connector's mode list. Only when the
2064 int drm_add_modes_noedid(struct drm_connector *connector, in drm_add_modes_noedid() argument
2069 struct drm_device *dev = connector->dev; in drm_add_modes_noedid()
2083 * the connector. in drm_add_modes_noedid()
2085 if (ptr->hdisplay > hdisplay || in drm_add_modes_noedid()
2086 ptr->vdisplay > vdisplay) in drm_add_modes_noedid()
2093 drm_mode_probed_add(connector, mode); in drm_add_modes_noedid()
2102 * drm_mode_cea_vic - return the CEA-861 VIC of a given mode
2106 * The VIC number, 0 in case it's not a CEA-861 mode.