Lines Matching defs:edid

39 #define version_greater(edid, maj, min) \
40 (((edid)->version > (maj)) || \
41 ((edid)->version == (maj) && (edid)->revision > (min)))
75 struct edid *edid;
901 struct edid *edid = (struct edid *)raw_edid;
913 DRM_DEBUG("edid header is perfect");
937 if (edid->version != 1) {
938 DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version);
942 if (edid->revision > 4)
962 * @edid: EDID data
966 bool drm_edid_is_valid(struct edid *edid)
969 u8 *raw = (u8 *)edid;
971 if (!edid)
974 for (i = 0; i <= edid->extensions; i++)
1054 static struct edid *
1081 return (struct edid *) block;
1104 return (struct edid *) block;
1140 * Return edid data or NULL if we couldn't find any.
1142 struct edid *drm_get_edid(struct drm_connector *connector,
1145 struct edid *edid = NULL;
1148 edid = drm_do_get_edid(connector, adapter);
1150 return edid;
1157 * @edid: EDID to match
1160 * Returns true if @vendor is in @edid, false otherwise
1162 static bool edid_vendor(struct edid *edid, char *vendor)
1166 edid_vendor[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@';
1167 edid_vendor[1] = (((edid->mfg_id[0] & 0x3) << 3) |
1168 ((edid->mfg_id[1] & 0xe0) >> 5)) + '@';
1169 edid_vendor[2] = (edid->mfg_id[1] & 0x1f) + '@';
1176 * @edid: EDID to process
1180 static u32 edid_get_quirks(struct edid *edid)
1188 if (edid_vendor(edid, quirk->vendor) &&
1189 (EDID_PRODUCT_ID(edid) == quirk->product_id))
1319 struct edid *edid = (struct edid *)raw_edid;
1321 if (edid == NULL)
1325 cb(&(edid->detailed_timings[i]), closure);
1353 drm_monitor_supports_rb(struct edid *edid)
1355 if (edid->revision >= 4) {
1357 drm_for_each_detailed_block((u8 *)edid, is_rb, &ret);
1361 return ((edid->input & DRM_EDID_INPUT_DIGITAL) != 0);
1374 drm_gtf2_hbreak(struct edid *edid)
1377 drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
1382 drm_gtf2_2c(struct edid *edid)
1385 drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
1390 drm_gtf2_m(struct edid *edid)
1393 drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
1398 drm_gtf2_k(struct edid *edid)
1401 drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
1406 drm_gtf2_2j(struct edid *edid)
1409 drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
1415 * @edid: EDID block to scan
1417 static int standard_timing_level(struct edid *edid)
1419 if (edid->revision >= 2) {
1420 if (edid->revision >= 4 && (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF))
1422 if (drm_gtf2_hbreak(edid))
1450 drm_mode_std(struct drm_connector *connector, struct edid *edid,
1461 int timing_level = standard_timing_level(edid);
1515 if (drm_monitor_supports_rb(edid)) {
1541 if (drm_mode_hsync(mode) > drm_gtf2_hbreak(edid)) {
1545 drm_gtf2_m(edid),
1546 drm_gtf2_2c(edid),
1547 drm_gtf2_k(edid),
1548 drm_gtf2_2j(edid));
1604 * @edid: EDID block
1612 struct edid *edid,
1700 mode->width_mm = edid->width_cm * 10;
1701 mode->height_mm = edid->height_cm * 10;
1712 struct edid *edid, u8 *t)
1717 if (edid->revision >= 4)
1720 if (edid->revision >= 4)
1729 struct edid *edid, u8 *t)
1734 if (edid->revision >= 4)
1737 if (edid->revision >= 4)
1745 range_pixel_clock(struct edid *edid, u8 *t)
1752 if (edid->revision >= 4 && t[10] == 0x04)
1760 mode_in_range(const struct drm_display_mode *mode, struct edid *edid,
1766 if (!mode_in_hsync_range(mode, edid, t))
1769 if (!mode_in_vsync_range(mode, edid, t))
1772 if ((max_clock = range_pixel_clock(edid, t)))
1777 if (edid->revision >= 4 && t[10] == 0x04)
1781 if (mode_is_rb(mode) && !drm_monitor_supports_rb(edid))
1806 drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid,
1814 if (mode_in_range(drm_dmt_modes + i, edid, timing) &&
1841 drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid,
1855 if (!mode_in_range(newmode, edid, timing) ||
1869 drm_cvt_modes_for_range(struct drm_connector *connector, struct edid *edid,
1875 bool rb = drm_monitor_supports_rb(edid);
1884 if (!mode_in_range(newmode, edid, timing) ||
1908 closure->edid,
1911 if (!version_greater(closure->edid, 1, 1))
1918 closure->edid,
1922 if (!version_greater(closure->edid, 1, 3))
1926 closure->edid,
1936 add_inferred_modes(struct drm_connector *connector, struct edid *edid)
1939 connector, edid, 0, 0, 0
1942 if (version_greater(edid, 1, 0))
1943 drm_for_each_detailed_block((u8 *)edid, do_inferred_modes,
1990 * @edid: EDID block to scan
1996 add_established_modes(struct drm_connector *connector, struct edid *edid)
1999 unsigned long est_bits = edid->established_timings.t1 |
2000 (edid->established_timings.t2 << 8) |
2001 ((edid->established_timings.mfg_rsvd & 0x80) << 9);
2004 connector, edid, 0, 0, 0
2018 if (version_greater(edid, 1, 0))
2019 drm_for_each_detailed_block((u8 *)edid,
2031 struct edid *edid = closure->edid;
2040 newmode = drm_mode_std(connector, edid, std,
2041 edid->revision);
2052 * @edid: EDID block to scan
2055 * GTF or CVT. Grab them from @edid and add them to the list.
2058 add_standard_modes(struct drm_connector *connector, struct edid *edid)
2062 connector, edid, 0, 0, 0
2068 newmode = drm_mode_std(connector, edid,
2069 &edid->standard_timings[i],
2070 edid->revision);
2077 if (version_greater(edid, 1, 0))
2078 drm_for_each_detailed_block((u8 *)edid, do_standard_modes,
2146 add_cvt_modes(struct drm_connector *connector, struct edid *edid)
2149 connector, edid, 0, 0, 0
2152 if (version_greater(edid, 1, 2))
2153 drm_for_each_detailed_block((u8 *)edid, do_cvt_mode, &closure);
2168 closure->edid, timing,
2185 * @edid: EDID block to scan
2189 add_detailed_modes(struct drm_connector *connector, struct edid *edid,
2194 edid,
2200 if (closure.preferred && !version_greater(edid, 1, 3))
2202 (edid->features & DRM_EDID_FEATURE_PREFERRED_TIMING);
2204 drm_for_each_detailed_block((u8 *)edid, do_detailed_mode, &closure);
2223 u8 *drm_find_cea_extension(struct edid *edid)
2229 if (edid == NULL || edid->extensions == 0)
2233 for (i = 0; i < edid->extensions; i++) {
2234 edid_ext = (u8 *)edid + EDID_LENGTH * (i + 1);
2239 if (i == edid->extensions)
2301 add_alternate_cea_modes(struct drm_connector *connector, struct edid *edid)
2312 if (!drm_find_cea_extension(edid))
2423 add_cea_modes(struct drm_connector *connector, struct edid *edid)
2425 u8 * cea = drm_find_cea_extension(edid);
2511 * @edid: EDID to parse
2519 void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
2531 cea = drm_find_cea_extension(edid);
2538 drm_for_each_detailed_block((u8 *)edid, monitor_name, &name);
2549 eld[16] = edid->mfg_id[0];
2550 eld[17] = edid->mfg_id[1];
2551 eld[18] = edid->prod_code[0];
2552 eld[19] = edid->prod_code[1];
2596 * @edid: EDID to parse
2604 int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads)
2610 cea = drm_find_cea_extension(edid);
2713 * @edid: monitor EDID information
2718 bool drm_detect_hdmi_monitor(struct edid *edid)
2724 edid_ext = drm_find_cea_extension(edid);
2753 bool drm_detect_monitor_audio(struct edid *edid)
2760 edid_ext = drm_find_cea_extension(edid);
2794 bool drm_rgb_quant_range_selectable(struct edid *edid)
2799 edid_ext = drm_find_cea_extension(edid);
2819 * @edid: EDID data
2826 static void drm_add_display_info(struct edid *edid,
2831 info->width_mm = edid->width_cm * 10;
2832 info->height_mm = edid->height_cm * 10;
2838 if (edid->revision < 3)
2841 if (!(edid->input & DRM_EDID_INPUT_DIGITAL))
2845 edid_ext = drm_find_cea_extension(edid);
2858 if (edid->revision < 4)
2861 switch (edid->input & DRM_EDID_DIGITAL_DEPTH_MASK) {
2887 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444)
2889 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422)
2896 * @edid: edid data
2902 int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
2907 if (edid == NULL) {
2910 if (!drm_edid_is_valid(edid)) {
2916 quirks = edid_get_quirks(edid);
2932 num_modes += add_detailed_modes(connector, edid, quirks);
2933 num_modes += add_cvt_modes(connector, edid);
2934 num_modes += add_standard_modes(connector, edid);
2935 num_modes += add_established_modes(connector, edid);
2936 if (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF)
2937 num_modes += add_inferred_modes(connector, edid);
2938 num_modes += add_cea_modes(connector, edid);
2939 num_modes += add_alternate_cea_modes(connector, edid);
2944 drm_add_display_info(edid, &connector->display_info);