Lines Matching refs: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);
1513 if (drm_monitor_supports_rb(edid)) {
1539 if (drm_mode_hsync(mode) > drm_gtf2_hbreak(edid)) {
1543 drm_gtf2_m(edid),
1544 drm_gtf2_2c(edid),
1545 drm_gtf2_k(edid),
1546 drm_gtf2_2j(edid));
1602 * @edid: EDID block
1610 struct edid *edid,
1698 mode->width_mm = edid->width_cm * 10;
1699 mode->height_mm = edid->height_cm * 10;
1710 struct edid *edid, u8 *t)
1715 if (edid->revision >= 4)
1718 if (edid->revision >= 4)
1727 struct edid *edid, u8 *t)
1732 if (edid->revision >= 4)
1735 if (edid->revision >= 4)
1743 range_pixel_clock(struct edid *edid, u8 *t)
1750 if (edid->revision >= 4 && t[10] == 0x04)
1758 mode_in_range(const struct drm_display_mode *mode, struct edid *edid,
1764 if (!mode_in_hsync_range(mode, edid, t))
1767 if (!mode_in_vsync_range(mode, edid, t))
1770 if ((max_clock = range_pixel_clock(edid, t)))
1775 if (edid->revision >= 4 && t[10] == 0x04)
1779 if (mode_is_rb(mode) && !drm_monitor_supports_rb(edid))
1804 drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid,
1812 if (mode_in_range(drm_dmt_modes + i, edid, timing) &&
1839 drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid,
1853 if (!mode_in_range(newmode, edid, timing) ||
1867 drm_cvt_modes_for_range(struct drm_connector *connector, struct edid *edid,
1873 bool rb = drm_monitor_supports_rb(edid);
1882 if (!mode_in_range(newmode, edid, timing) ||
1906 closure->edid,
1909 if (!version_greater(closure->edid, 1, 1))
1916 closure->edid,
1920 if (!version_greater(closure->edid, 1, 3))
1924 closure->edid,
1934 add_inferred_modes(struct drm_connector *connector, struct edid *edid)
1937 connector, edid, 0, 0, 0
1940 if (version_greater(edid, 1, 0))
1941 drm_for_each_detailed_block((u8 *)edid, do_inferred_modes,
1988 * @edid: EDID block to scan
1994 add_established_modes(struct drm_connector *connector, struct edid *edid)
1997 unsigned long est_bits = edid->established_timings.t1 |
1998 (edid->established_timings.t2 << 8) |
1999 ((edid->established_timings.mfg_rsvd & 0x80) << 9);
2002 connector, edid, 0, 0, 0
2016 if (version_greater(edid, 1, 0))
2017 drm_for_each_detailed_block((u8 *)edid,
2029 struct edid *edid = closure->edid;
2038 newmode = drm_mode_std(connector, edid, std,
2039 edid->revision);
2050 * @edid: EDID block to scan
2053 * GTF or CVT. Grab them from @edid and add them to the list.
2056 add_standard_modes(struct drm_connector *connector, struct edid *edid)
2060 connector, edid, 0, 0, 0
2066 newmode = drm_mode_std(connector, edid,
2067 &edid->standard_timings[i],
2068 edid->revision);
2075 if (version_greater(edid, 1, 0))
2076 drm_for_each_detailed_block((u8 *)edid, do_standard_modes,
2144 add_cvt_modes(struct drm_connector *connector, struct edid *edid)
2147 connector, edid, 0, 0, 0
2150 if (version_greater(edid, 1, 2))
2151 drm_for_each_detailed_block((u8 *)edid, do_cvt_mode, &closure);
2166 closure->edid, timing,
2183 * @edid: EDID block to scan
2187 add_detailed_modes(struct drm_connector *connector, struct edid *edid,
2192 edid,
2198 if (closure.preferred && !version_greater(edid, 1, 3))
2200 (edid->features & DRM_EDID_FEATURE_PREFERRED_TIMING);
2202 drm_for_each_detailed_block((u8 *)edid, do_detailed_mode, &closure);
2221 u8 *drm_find_cea_extension(struct edid *edid)
2227 if (edid == NULL || edid->extensions == 0)
2231 for (i = 0; i < edid->extensions; i++) {
2232 edid_ext = (u8 *)edid + EDID_LENGTH * (i + 1);
2237 if (i == edid->extensions)
2299 add_alternate_cea_modes(struct drm_connector *connector, struct edid *edid)
2310 if (!drm_find_cea_extension(edid))
2421 add_cea_modes(struct drm_connector *connector, struct edid *edid)
2423 u8 * cea = drm_find_cea_extension(edid);
2509 * @edid: EDID to parse
2517 void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
2529 cea = drm_find_cea_extension(edid);
2536 drm_for_each_detailed_block((u8 *)edid, monitor_name, &name);
2547 eld[16] = edid->mfg_id[0];
2548 eld[17] = edid->mfg_id[1];
2549 eld[18] = edid->prod_code[0];
2550 eld[19] = edid->prod_code[1];
2594 * @edid: EDID to parse
2602 int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads)
2608 cea = drm_find_cea_extension(edid);
2711 * @edid: monitor EDID information
2716 bool drm_detect_hdmi_monitor(struct edid *edid)
2722 edid_ext = drm_find_cea_extension(edid);
2751 bool drm_detect_monitor_audio(struct edid *edid)
2758 edid_ext = drm_find_cea_extension(edid);
2792 bool drm_rgb_quant_range_selectable(struct edid *edid)
2797 edid_ext = drm_find_cea_extension(edid);
2817 * @edid: EDID data
2824 static void drm_add_display_info(struct edid *edid,
2829 info->width_mm = edid->width_cm * 10;
2830 info->height_mm = edid->height_cm * 10;
2836 if (edid->revision < 3)
2839 if (!(edid->input & DRM_EDID_INPUT_DIGITAL))
2843 edid_ext = drm_find_cea_extension(edid);
2856 if (edid->revision < 4)
2859 switch (edid->input & DRM_EDID_DIGITAL_DEPTH_MASK) {
2885 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444)
2887 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422)
2894 * @edid: edid data
2900 int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
2905 if (edid == NULL) {
2908 if (!drm_edid_is_valid(edid)) {
2914 quirks = edid_get_quirks(edid);
2930 num_modes += add_detailed_modes(connector, edid, quirks);
2931 num_modes += add_cvt_modes(connector, edid);
2932 num_modes += add_standard_modes(connector, edid);
2933 num_modes += add_established_modes(connector, edid);
2934 if (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF)
2935 num_modes += add_inferred_modes(connector, edid);
2936 num_modes += add_cea_modes(connector, edid);
2937 num_modes += add_alternate_cea_modes(connector, edid);
2942 drm_add_display_info(edid, &connector->display_info);