[go: nahoru, domu]

Lines Matching refs:edid

38 #define version_greater(edid, maj, min) \
39 (((edid)->version > (maj)) || \
40 ((edid)->version == (maj) && (edid)->revision > (min)))
78 struct edid *edid;
1032 struct edid *edid = (struct edid *)raw_edid;
1066 if (edid->version != 1) {
1067 DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version);
1071 if (edid->revision > 4)
1093 * @edid: EDID data
1099 bool drm_edid_is_valid(struct edid *edid)
1102 u8 *raw = (u8 *)edid;
1104 if (!edid)
1107 for (i = 0; i <= edid->extensions; i++)
1289 struct edid *drm_get_edid(struct drm_connector *connector,
1292 struct edid *edid = NULL;
1295 edid = (struct edid *)drm_do_get_edid(connector, adapter);
1297 return edid;
1303 * @edid: EDID to duplicate
1307 struct edid *drm_edid_duplicate(const struct edid *edid)
1309 return kmemdup(edid, (edid->extensions + 1) * EDID_LENGTH, GFP_KERNEL);
1317 * @edid: EDID to match
1320 * Returns true if @vendor is in @edid, false otherwise
1322 static bool edid_vendor(struct edid *edid, char *vendor)
1326 edid_vendor[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@';
1327 edid_vendor[1] = (((edid->mfg_id[0] & 0x3) << 3) |
1328 ((edid->mfg_id[1] & 0xe0) >> 5)) + '@';
1329 edid_vendor[2] = (edid->mfg_id[1] & 0x1f) + '@';
1336 * @edid: EDID to process
1340 static u32 edid_get_quirks(struct edid *edid)
1348 if (edid_vendor(edid, quirk->vendor) &&
1349 (EDID_PRODUCT_ID(edid) == quirk->product_id))
1486 struct edid *edid = (struct edid *)raw_edid;
1488 if (edid == NULL)
1492 cb(&(edid->detailed_timings[i]), closure);
1520 drm_monitor_supports_rb(struct edid *edid)
1522 if (edid->revision >= 4) {
1524 drm_for_each_detailed_block((u8 *)edid, is_rb, &ret);
1528 return ((edid->input & DRM_EDID_INPUT_DIGITAL) != 0);
1541 drm_gtf2_hbreak(struct edid *edid)
1544 drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
1549 drm_gtf2_2c(struct edid *edid)
1552 drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
1557 drm_gtf2_m(struct edid *edid)
1560 drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
1565 drm_gtf2_k(struct edid *edid)
1568 drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
1573 drm_gtf2_2j(struct edid *edid)
1576 drm_for_each_detailed_block((u8 *)edid, find_gtf2, &r);
1582 * @edid: EDID block to scan
1584 static int standard_timing_level(struct edid *edid)
1586 if (edid->revision >= 2) {
1587 if (edid->revision >= 4 && (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF))
1589 if (drm_gtf2_hbreak(edid))
1611 * @edid: EDID block to scan
1618 drm_mode_std(struct drm_connector *connector, struct edid *edid,
1629 int timing_level = standard_timing_level(edid);
1640 if (edid->revision < 3)
1681 if (drm_monitor_supports_rb(edid)) {
1707 if (drm_mode_hsync(mode) > drm_gtf2_hbreak(edid)) {
1711 drm_gtf2_m(edid),
1712 drm_gtf2_2c(edid),
1713 drm_gtf2_k(edid),
1714 drm_gtf2_2j(edid));
1770 * @edid: EDID block
1778 struct edid *edid,
1866 mode->width_mm = edid->width_cm * 10;
1867 mode->height_mm = edid->height_cm * 10;
1879 struct edid *edid, u8 *t)
1884 if (edid->revision >= 4)
1887 if (edid->revision >= 4)
1896 struct edid *edid, u8 *t)
1901 if (edid->revision >= 4)
1904 if (edid->revision >= 4)
1912 range_pixel_clock(struct edid *edid, u8 *t)
1919 if (edid->revision >= 4 && t[10] == 0x04)
1927 mode_in_range(const struct drm_display_mode *mode, struct edid *edid,
1933 if (!mode_in_hsync_range(mode, edid, t))
1936 if (!mode_in_vsync_range(mode, edid, t))
1939 if ((max_clock = range_pixel_clock(edid, t)))
1944 if (edid->revision >= 4 && t[10] == 0x04)
1948 if (mode_is_rb(mode) && !drm_monitor_supports_rb(edid))
1973 drm_dmt_modes_for_range(struct drm_connector *connector, struct edid *edid,
1981 if (mode_in_range(drm_dmt_modes + i, edid, timing) &&
2008 drm_gtf_modes_for_range(struct drm_connector *connector, struct edid *edid,
2022 if (!mode_in_range(newmode, edid, timing) ||
2036 drm_cvt_modes_for_range(struct drm_connector *connector, struct edid *edid,
2042 bool rb = drm_monitor_supports_rb(edid);
2051 if (!mode_in_range(newmode, edid, timing) ||
2075 closure->edid,
2078 if (!version_greater(closure->edid, 1, 1))
2085 closure->edid,
2089 if (!version_greater(closure->edid, 1, 3))
2093 closure->edid,
2103 add_inferred_modes(struct drm_connector *connector, struct edid *edid)
2107 .edid = edid,
2110 if (version_greater(edid, 1, 0))
2111 drm_for_each_detailed_block((u8 *)edid, do_inferred_modes,
2159 * @edid: EDID block to scan
2165 add_established_modes(struct drm_connector *connector, struct edid *edid)
2168 unsigned long est_bits = edid->established_timings.t1 |
2169 (edid->established_timings.t2 << 8) |
2170 ((edid->established_timings.mfg_rsvd & 0x80) << 9);
2174 .edid = edid,
2188 if (version_greater(edid, 1, 0))
2189 drm_for_each_detailed_block((u8 *)edid,
2201 struct edid *edid = closure->edid;
2210 newmode = drm_mode_std(connector, edid, std);
2222 * @edid: EDID block to scan
2225 * GTF or CVT. Grab them from @edid and add them to the list.
2228 add_standard_modes(struct drm_connector *connector, struct edid *edid)
2233 .edid = edid,
2239 newmode = drm_mode_std(connector, edid,
2240 &edid->standard_timings[i]);
2247 if (version_greater(edid, 1, 0))
2248 drm_for_each_detailed_block((u8 *)edid, do_standard_modes,
2316 add_cvt_modes(struct drm_connector *connector, struct edid *edid)
2320 .edid = edid,
2323 if (version_greater(edid, 1, 2))
2324 drm_for_each_detailed_block((u8 *)edid, do_cvt_mode, &closure);
2339 closure->edid, timing,
2356 * @edid: EDID block to scan
2360 add_detailed_modes(struct drm_connector *connector, struct edid *edid,
2365 .edid = edid,
2370 if (closure.preferred && !version_greater(edid, 1, 3))
2372 (edid->features & DRM_EDID_FEATURE_PREFERRED_TIMING);
2374 drm_for_each_detailed_block((u8 *)edid, do_detailed_mode, &closure);
2392 static u8 *drm_find_cea_extension(struct edid *edid)
2398 if (edid == NULL || edid->extensions == 0)
2402 for (i = 0; i < edid->extensions; i++) {
2403 edid_ext = (u8 *)edid + EDID_LENGTH * (i + 1);
2408 if (i == edid->extensions)
2535 add_alternate_cea_modes(struct drm_connector *connector, struct edid *edid)
2543 if (!drm_find_cea_extension(edid))
2966 add_cea_modes(struct drm_connector *connector, struct edid *edid)
2968 const u8 *cea = drm_find_cea_extension(edid);
3055 * @edid: EDID to parse
3061 void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)
3073 cea = drm_find_cea_extension(edid);
3080 drm_for_each_detailed_block((u8 *)edid, monitor_name, &name);
3091 eld[16] = edid->mfg_id[0];
3092 eld[17] = edid->mfg_id[1];
3093 eld[18] = edid->prod_code[0];
3094 eld[19] = edid->prod_code[1];
3139 * @edid: EDID to parse
3148 int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads)
3154 cea = drm_find_cea_extension(edid);
3199 * @edid: EDID to parse
3209 int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb)
3215 cea = drm_find_cea_extension(edid);
3323 * @edid: monitor EDID information
3329 bool drm_detect_hdmi_monitor(struct edid *edid)
3335 edid_ext = drm_find_cea_extension(edid);
3357 * @edid: EDID block to scan
3367 bool drm_detect_monitor_audio(struct edid *edid)
3374 edid_ext = drm_find_cea_extension(edid);
3404 * @edid: EDID block to scan
3412 bool drm_rgb_quant_range_selectable(struct edid *edid)
3417 edid_ext = drm_find_cea_extension(edid);
3439 * @edid: monitor EDID information
3447 static bool drm_assign_hdmi_deep_color_info(struct edid *edid,
3456 edid_ext = drm_find_cea_extension(edid);
3539 * @edid: EDID data
3541 * @connector: connector whose edid is used to build display info
3547 static void drm_add_display_info(struct edid *edid,
3553 info->width_mm = edid->width_cm * 10;
3554 info->height_mm = edid->height_cm * 10;
3560 if (edid->revision < 3)
3563 if (!(edid->input & DRM_EDID_INPUT_DIGITAL))
3567 edid_ext = drm_find_cea_extension(edid);
3580 drm_assign_hdmi_deep_color_info(edid, info, connector);
3583 if (edid->revision < 4)
3586 switch (edid->input & DRM_EDID_DIGITAL_DEPTH_MASK) {
3615 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444)
3617 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422)
3624 * @edid: EDID data
3630 int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
3635 if (edid == NULL) {
3638 if (!drm_edid_is_valid(edid)) {
3644 quirks = edid_get_quirks(edid);
3660 num_modes += add_detailed_modes(connector, edid, quirks);
3661 num_modes += add_cvt_modes(connector, edid);
3662 num_modes += add_standard_modes(connector, edid);
3663 num_modes += add_established_modes(connector, edid);
3664 if (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF)
3665 num_modes += add_inferred_modes(connector, edid);
3666 num_modes += add_cea_modes(connector, edid);
3667 num_modes += add_alternate_cea_modes(connector, edid);
3672 drm_add_display_info(edid, &connector->display_info, connector);