Lines Matching full:edid

61  * EDID blocks out in the wild have a variety of bugs, try to collect
191 /* Rotel RSX-1058 forwards sink's EDID but only does HDMI 1.1*/
605 * modes are old-school Mac modes. The EDID spec says the 1152x864@75 mode
1581 * The opaque EDID type, internal to drm_edid.c.
1584 /* Size allocated for edid */
1586 const struct edid *edid; member
1589 static int edid_hfeeodb_extension_block_count(const struct edid *edid);
1591 static int edid_hfeeodb_block_count(const struct edid *edid) in edid_hfeeodb_block_count() argument
1593 int eeodb = edid_hfeeodb_extension_block_count(edid); in edid_hfeeodb_block_count()
1598 static int edid_extension_block_count(const struct edid *edid) in edid_extension_block_count() argument
1600 return edid->extensions; in edid_extension_block_count()
1603 static int edid_block_count(const struct edid *edid) in edid_block_count() argument
1605 return edid_extension_block_count(edid) + 1; in edid_block_count()
1613 static int edid_size(const struct edid *edid) in edid_size() argument
1615 return edid_size_by_blocks(edid_block_count(edid)); in edid_size()
1618 static const void *edid_block_data(const struct edid *edid, int index) in edid_block_data() argument
1620 BUILD_BUG_ON(sizeof(*edid) != EDID_LENGTH); in edid_block_data()
1622 return edid + index; in edid_block_data()
1625 static const void *edid_extension_block_data(const struct edid *edid, int index) in edid_extension_block_data() argument
1627 return edid_block_data(edid, index + 1); in edid_extension_block_data()
1630 /* EDID block count indicated in EDID, may exceed allocated size */
1636 num_blocks = edid_block_count(drm_edid->edid); in __drm_edid_block_count()
1646 eeodb = edid_hfeeodb_block_count(drm_edid->edid); in __drm_edid_block_count()
1654 /* EDID block count, limited by allocated size */
1662 /* EDID extension block count, limited by allocated size */
1670 return edid_block_data(drm_edid->edid, index); in drm_edid_block_data()
1676 return edid_extension_block_data(drm_edid->edid, index); in drm_edid_extension_block_data()
1681 * trust edid size. Not for general purpose use.
1684 const struct edid *edid) in drm_edid_legacy_init() argument
1686 if (!edid) in drm_edid_legacy_init()
1691 drm_edid->edid = edid; in drm_edid_legacy_init()
1692 drm_edid->size = edid_size(edid); in drm_edid_legacy_init()
1698 * EDID base and extension block iterator.
1749 static void edid_header_fix(void *edid) in edid_header_fix() argument
1751 memcpy(edid, edid_header, sizeof(edid_header)); in edid_header_fix()
1755 * drm_edid_header_is_valid - sanity check the header of the base EDID block
1756 * @_edid: pointer to raw base EDID block
1758 * Sanity check the header of the base EDID block.
1764 const struct edid *edid = _edid; in drm_edid_header_is_valid() local
1768 if (edid->header[i] == edid_header[i]) in drm_edid_header_is_valid()
1779 "Minimum number of valid EDID header bytes (0-8, default 6)");
1797 const struct edid *block = _block; in edid_block_get_checksum()
1809 static bool edid_block_is_zero(const void *edid) in edid_block_is_zero() argument
1811 return !memchr_inv(edid, 0, EDID_LENGTH); in edid_block_is_zero()
1815 * drm_edid_are_equal - compare two edid blobs.
1819 * edid had changed.
1821 bool drm_edid_are_equal(const struct edid *edid1, const struct edid *edid2) in drm_edid_are_equal()
1860 const struct edid *block = _block; in edid_block_check()
1908 const struct edid *block, in edid_block_status_print()
1915 pr_debug("EDID block %d read failed\n", block_num); in edid_block_status_print()
1918 pr_debug("EDID block %d pointer is NULL\n", block_num); in edid_block_status_print()
1921 pr_notice("EDID block %d is all zeroes\n", block_num); in edid_block_status_print()
1924 pr_notice("EDID has corrupt header\n"); in edid_block_status_print()
1927 pr_debug("EDID corrupt header needs repair\n"); in edid_block_status_print()
1930 pr_debug("EDID corrupt header fixed\n"); in edid_block_status_print()
1934 pr_debug("EDID block %d (tag 0x%02x) checksum is invalid, remainder is %d, ignoring\n", in edid_block_status_print()
1938 pr_notice("EDID block %d (tag 0x%02x) checksum is invalid, remainder is %d\n", in edid_block_status_print()
1944 pr_notice("EDID has major version %d, instead of 1\n", in edid_block_status_print()
1948 WARN(1, "EDID block %d unknown edid block status code %d\n", in edid_block_status_print()
1972 * drm_edid_block_valid - Sanity check the EDID block (base or extension)
1973 * @_block: pointer to raw EDID block
1975 * @print_bad_edid: if true, dump bad EDID blocks to the console
1978 * Validate a base or extension EDID block and optionally dump bad blocks to
1986 struct edid *block = (struct edid *)_block; in drm_edid_block_valid()
1996 DRM_DEBUG_KMS("Fixing EDID header, your hardware may be failing\n"); in drm_edid_block_valid()
2023 pr_notice("Raw EDID:\n"); in drm_edid_block_valid()
2032 * drm_edid_is_valid - sanity check EDID data
2033 * @edid: EDID data
2035 * Sanity-check an entire EDID record (including extensions)
2037 * Return: True if the EDID data is valid, false otherwise.
2039 bool drm_edid_is_valid(struct edid *edid) in drm_edid_is_valid() argument
2043 if (!edid) in drm_edid_is_valid()
2046 for (i = 0; i < edid_block_count(edid); i++) { in drm_edid_is_valid()
2047 void *block = (void *)edid_block_data(edid, i); in drm_edid_is_valid()
2058 * drm_edid_valid - sanity check EDID data
2059 * @drm_edid: EDID data
2061 * Sanity check an EDID. Cross check block count against allocated size and
2064 * Return: True if the EDID data is valid, false otherwise.
2087 static struct edid *edid_filter_invalid_blocks(struct edid *edid, in edid_filter_invalid_blocks() argument
2090 struct edid *new; in edid_filter_invalid_blocks()
2094 * Note: If the EDID uses HF-EEODB, but has invalid blocks, we'll revert in edid_filter_invalid_blocks()
2098 for (i = 0; i < edid_block_count(edid); i++) { in edid_filter_invalid_blocks()
2099 const void *src_block = edid_block_data(edid, i); in edid_filter_invalid_blocks()
2102 void *dst_block = (void *)edid_block_data(edid, valid_blocks); in edid_filter_invalid_blocks()
2111 kfree(edid); in edid_filter_invalid_blocks()
2115 edid->extensions = valid_blocks - 1; in edid_filter_invalid_blocks()
2116 edid->checksum = edid_block_compute_checksum(edid); in edid_filter_invalid_blocks()
2120 new = krealloc(edid, *alloc_size, GFP_KERNEL); in edid_filter_invalid_blocks()
2122 kfree(edid); in edid_filter_invalid_blocks()
2129 * drm_do_probe_ddc_edid() - get EDID information via I2C
2131 * @buf: EDID data buffer to be filled
2132 * @block: 128 byte EDID block to start fetching from
2133 * @len: EDID data buffer length to fetch
2135 * Try to fetch EDID information by calling I2C driver functions.
2192 const struct edid *edid, int num_blocks) in connector_bad_edid() argument
2198 * 0x7e in the EDID is the number of extension blocks. The EDID in connector_bad_edid()
2200 * of 0x7e in the EDID of the _index_ of the last block in the in connector_bad_edid()
2203 last_block = edid->extensions; in connector_bad_edid()
2205 /* Calculate real checksum for the last edid extension block data */ in connector_bad_edid()
2208 edid_block_compute_checksum(edid + last_block); in connector_bad_edid()
2213 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID is invalid:\n", in connector_bad_edid()
2216 edid_block_dump(KERN_DEBUG, edid + i, i); in connector_bad_edid()
2219 /* Get override or firmware EDID */
2246 seq_write(m, drm_edid->edid, drm_edid->size); in drm_edid_override_show()
2254 int drm_edid_override_set(struct drm_connector *connector, const void *edid, in drm_edid_override_set() argument
2259 drm_edid = drm_edid_alloc(edid, size); in drm_edid_override_set()
2261 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID override invalid\n", in drm_edid_override_set()
2267 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID override set\n", in drm_edid_override_set()
2283 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID override reset\n", in drm_edid_override_reset()
2297 * drm_edid_override_connector_update - add modes from override/firmware EDID
2300 * Add modes from the override/firmware EDID, if available. Only to be used from
2302 * failed during drm_get_edid() and caused the override/firmware EDID to be
2320 "[CONNECTOR:%d:%s] adding %d modes via fallback override/firmware EDID\n", in drm_edid_override_connector_update()
2363 static struct edid *_drm_do_get_edid(struct drm_connector *connector, in _drm_do_get_edid()
2370 struct edid *edid, *new; in _drm_do_get_edid() local
2376 edid = kmemdup(override->edid, alloc_size, GFP_KERNEL); in _drm_do_get_edid()
2378 if (!edid) in _drm_do_get_edid()
2383 edid = kmalloc(alloc_size, GFP_KERNEL); in _drm_do_get_edid()
2384 if (!edid) in _drm_do_get_edid()
2387 status = edid_block_read(edid, 0, read_block, context); in _drm_do_get_edid()
2389 edid_block_status_print(status, edid, 0); in _drm_do_get_edid()
2394 /* FIXME: Clarify what a corrupt EDID actually means. */ in _drm_do_get_edid()
2400 if (!edid_block_status_valid(status, edid_block_tag(edid))) { in _drm_do_get_edid()
2404 connector_bad_edid(connector, edid, 1); in _drm_do_get_edid()
2408 if (!edid_extension_block_count(edid)) in _drm_do_get_edid()
2411 alloc_size = edid_size(edid); in _drm_do_get_edid()
2412 new = krealloc(edid, alloc_size, GFP_KERNEL); in _drm_do_get_edid()
2415 edid = new; in _drm_do_get_edid()
2417 num_blocks = edid_block_count(edid); in _drm_do_get_edid()
2419 void *block = (void *)edid_block_data(edid, i); in _drm_do_get_edid()
2431 * If the first EDID extension is a CTA extension, and in _drm_do_get_edid()
2439 int eeodb = edid_hfeeodb_block_count(edid); in _drm_do_get_edid()
2444 new = krealloc(edid, alloc_size, GFP_KERNEL); in _drm_do_get_edid()
2447 edid = new; in _drm_do_get_edid()
2453 connector_bad_edid(connector, edid, num_blocks); in _drm_do_get_edid()
2455 edid = edid_filter_invalid_blocks(edid, &alloc_size); in _drm_do_get_edid()
2462 return edid; in _drm_do_get_edid()
2465 kfree(edid); in _drm_do_get_edid()
2470 * drm_do_get_edid - get EDID data using a custom EDID block read function
2472 * @read_block: EDID block read function
2476 * exposes a different interface to read EDID blocks this function can be used
2477 * to get EDID data using a custom block read function.
2483 * The EDID may be overridden using debugfs override_edid or firmware EDID
2485 * order. Having either of them bypasses actual EDID reads.
2487 * Return: Pointer to valid EDID or NULL if we couldn't find any.
2489 struct edid *drm_do_get_edid(struct drm_connector *connector, in drm_do_get_edid()
2498 * drm_edid_raw - Get a pointer to the raw EDID data.
2501 * Get a pointer to the raw EDID data.
2505 * Return: Pointer to raw EDID data.
2507 const struct edid *drm_edid_raw(const struct drm_edid *drm_edid) in drm_edid_raw()
2513 * Do not return pointers where relying on EDID extension count would in drm_edid_raw()
2516 if (WARN_ON(edid_size(drm_edid->edid) > drm_edid->size)) in drm_edid_raw()
2519 return drm_edid->edid; in drm_edid_raw()
2523 /* Allocate struct drm_edid container *without* duplicating the edid data */
2524 static const struct drm_edid *_drm_edid_alloc(const void *edid, size_t size) in _drm_edid_alloc() argument
2528 if (!edid || !size || size < EDID_LENGTH) in _drm_edid_alloc()
2533 drm_edid->edid = edid; in _drm_edid_alloc()
2542 * @edid: Pointer to raw EDID data
2543 * @size: Size of memory allocated for EDID
2545 * Allocate a new drm_edid container. Do not calculate edid size from edid, pass
2547 * of the raw EDID data against the size, but at least the EDID base block must
2554 const struct drm_edid *drm_edid_alloc(const void *edid, size_t size) in drm_edid_alloc() argument
2558 if (!edid || !size || size < EDID_LENGTH) in drm_edid_alloc()
2561 edid = kmemdup(edid, size, GFP_KERNEL); in drm_edid_alloc()
2562 if (!edid) in drm_edid_alloc()
2565 drm_edid = _drm_edid_alloc(edid, size); in drm_edid_alloc()
2567 kfree(edid); in drm_edid_alloc()
2575 * @drm_edid: EDID to duplicate
2586 return drm_edid_alloc(drm_edid->edid, drm_edid->size); in drm_edid_dup()
2592 * @drm_edid: EDID to free
2599 kfree(drm_edid->edid); in drm_edid_free()
2620 * drm_get_edid - get EDID data, if available
2624 * Poke the given I2C channel to grab EDID data if possible. If found,
2627 * Return: Pointer to valid EDID or NULL if we couldn't find any.
2629 struct edid *drm_get_edid(struct drm_connector *connector, in drm_get_edid()
2632 struct edid *edid; in drm_get_edid() local
2640 edid = _drm_do_get_edid(connector, drm_do_probe_ddc_edid, adapter, NULL); in drm_get_edid()
2641 drm_connector_update_edid_property(connector, edid); in drm_get_edid()
2642 return edid; in drm_get_edid()
2647 * drm_edid_read_custom - Read EDID data using given EDID block read function
2649 * @read_block: EDID block read function
2653 * exposes a different interface to read EDID blocks this function can be used
2654 * to get EDID data using a custom block read function.
2661 * The EDID may be overridden using debugfs override_edid or firmware EDID
2663 * order. Having either of them bypasses actual EDID reads.
2667 * Return: Pointer to EDID, or NULL if probe/read failed.
2674 struct edid *edid; in drm_edid_read_custom() local
2677 edid = _drm_do_get_edid(connector, read_block, context, &size); in drm_edid_read_custom()
2678 if (!edid) in drm_edid_read_custom()
2684 drm_edid = _drm_edid_alloc(edid, size); in drm_edid_read_custom()
2686 kfree(edid); in drm_edid_read_custom()
2693 * drm_edid_read_ddc - Read EDID data using given I2C adapter
2697 * Read EDID using the given I2C adapter.
2699 * The EDID may be overridden using debugfs override_edid or firmware EDID
2701 * order. Having either of them bypasses actual EDID reads.
2708 * Return: Pointer to EDID, or NULL if probe/read failed.
2730 * drm_edid_read - Read EDID data using connector's I2C adapter
2733 * Read EDID using the connector's I2C adapter.
2735 * The EDID may be overridden using debugfs override_edid or firmware EDID
2737 * order. Having either of them bypasses actual EDID reads.
2741 * Return: Pointer to EDID, or NULL if probe/read failed.
2752 static u32 edid_extract_panel_id(const struct edid *edid) in edid_extract_panel_id() argument
2767 return (u32)edid->mfg_id[0] << 24 | in edid_extract_panel_id()
2768 (u32)edid->mfg_id[1] << 16 | in edid_extract_panel_id()
2769 (u32)EDID_PRODUCT_ID(edid); in edid_extract_panel_id()
2776 * This function reads the first block of the EDID of a panel and (assuming
2777 * that the EDID is valid) extracts the ID out of it. The ID is a 32-bit value
2783 * assume that the EDID of the panel is correct, at least as far as the ID
2787 * be read the EDID, but there is no caching between them. Since we're only
2804 * the EDID then we'll just return 0. in drm_edid_get_panel_id()
2827 * drm_get_edid_switcheroo - get EDID data for a vga_switcheroo output
2833 * switch DDC to the GPU which is retrieving EDID.
2835 * Return: Pointer to valid EDID or %NULL if we couldn't find any.
2837 struct edid *drm_get_edid_switcheroo(struct drm_connector *connector, in drm_get_edid_switcheroo()
2842 struct edid *edid; in drm_get_edid_switcheroo() local
2848 edid = drm_get_edid(connector, adapter); in drm_get_edid_switcheroo()
2851 return edid; in drm_get_edid_switcheroo()
2856 * drm_edid_read_switcheroo - get EDID data for a vga_switcheroo output
2862 * temporarily switch DDC to the GPU which is retrieving EDID.
2864 * Return: Pointer to valid EDID or %NULL if we couldn't find any.
2885 * drm_edid_duplicate - duplicate an EDID and the extensions
2886 * @edid: EDID to duplicate
2888 * Return: Pointer to duplicated EDID or NULL on allocation failure.
2890 struct edid *drm_edid_duplicate(const struct edid *edid) in drm_edid_duplicate() argument
2892 if (!edid) in drm_edid_duplicate()
2895 return kmemdup(edid, edid_size(edid), GFP_KERNEL); in drm_edid_duplicate()
2899 /*** EDID parsing ***/
2902 * edid_get_quirks - return quirk flags for a given EDID
2903 * @drm_edid: EDID to process
2909 u32 panel_id = edid_extract_panel_id(drm_edid->edid); in edid_get_quirks()
3075 cb(&drm_edid->edid->detailed_timings[i], closure); in drm_for_each_detailed_block()
3109 /* EDID 1.4 defines this explicitly. For EDID 1.3, we guess, badly. */
3113 if (drm_edid->edid->revision >= 4) { in drm_monitor_supports_rb()
3226 const struct edid *edid = drm_edid->edid; in standard_timing_level() local
3228 if (edid->revision >= 4) { in standard_timing_level()
3238 } else if (edid->revision >= 3 && drm_gtf2_hbreak(drm_edid)) { in standard_timing_level()
3240 } else if (edid->revision >= 2) { in standard_timing_level()
3317 /* According to the EDID spec, the hdisplay = hsize * 8 + 248 */ in drm_mode_std()
3323 if (drm_edid->edid->revision < 3) in drm_mode_std()
3395 * EDID is delightfully ambiguous about how interlaced modes are to be
3437 * Create a new mode from an EDID detailed timing section. An EDID detailed
3541 mode->width_mm = drm_edid->edid->width_cm * 10; in drm_mode_detailed()
3542 mode->height_mm = drm_edid->edid->height_cm * 10; in drm_mode_detailed()
3553 const struct edid *edid, const u8 *t) in mode_in_hsync_range() argument
3558 if (edid->revision >= 4) in mode_in_hsync_range()
3561 if (edid->revision >= 4) in mode_in_hsync_range()
3570 const struct edid *edid, const u8 *t) in mode_in_vsync_range() argument
3575 if (edid->revision >= 4) in mode_in_vsync_range()
3578 if (edid->revision >= 4) in mode_in_vsync_range()
3586 range_pixel_clock(const struct edid *edid, const u8 *t) in range_pixel_clock() argument
3593 if (edid->revision >= 4 && t[10] == DRM_EDID_CVT_SUPPORT_FLAG) in range_pixel_clock()
3604 const struct edid *edid = drm_edid->edid; in mode_in_range() local
3608 if (!mode_in_hsync_range(mode, edid, t)) in mode_in_range()
3611 if (!mode_in_vsync_range(mode, edid, t)) in mode_in_range()
3614 if ((max_clock = range_pixel_clock(edid, t))) in mode_in_range()
3619 if (edid->revision >= 4 && t[10] == DRM_EDID_CVT_SUPPORT_FLAG) in mode_in_range()
3784 if (closure->drm_edid->edid->revision < 2) in do_inferred_modes()
3799 if (closure->drm_edid->edid->revision < 4) in do_inferred_modes()
3820 if (drm_edid->edid->revision >= 1) in add_inferred_modes()
3867 * Get established modes from EDID and add them. Each EDID block contains a
3875 const struct edid *edid = drm_edid->edid; in add_established_modes() local
3876 unsigned long est_bits = edid->established_timings.t1 | in add_established_modes()
3877 (edid->established_timings.t2 << 8) | in add_established_modes()
3878 ((edid->established_timings.mfg_rsvd & 0x80) << 9); in add_established_modes()
3897 if (edid->revision >= 1) in add_established_modes()
3928 * Get standard modes from EDID and add them. Standard modes can be calculated
3929 * using the appropriate standard (DMT, GTF, or CVT). Grab them from EDID and
3945 &drm_edid->edid->standard_timings[i]); in add_standard_modes()
3952 if (drm_edid->edid->revision >= 1) in add_standard_modes()
4032 if (drm_edid->edid->revision >= 3) in add_cvt_modes()
4075 * @drm_edid: EDID block to scan
4085 if (drm_edid->edid->revision >= 4) in add_detailed_modes()
4089 drm_edid->edid->features & DRM_EDID_FEATURE_PREFERRED_TIMING; in add_detailed_modes()
4118 * Search EDID for CEA extension block.
4120 * FIXME: Prefer not returning pointers to raw EDID data.
4128 /* No EDID or EDID extensions */ in drm_find_edid_extension()
4147 /* Return true if the EDID has a CTA extension or a DisplayID CTA data block */
4517 * the EDID, or NULL on errors.
4900 * Iterate through all CTA Data Blocks in both EDID CTA Extensions and DisplayID
4906 * cea_db_iter_edid_begin(edid, &iter);
5008 * - VESA E-EDID v1.4
5087 * the EDID CTA Extensions, then all the DisplayID CTA blocks. in __cea_db_iter_next()
5089 * Per DisplayID v1.3 Appendix B: DisplayID as an EDID in __cea_db_iter_next()
5170 * Get the HF-EEODB override extension block count from EDID.
5172 * The passed in EDID may be partially read, as long as it has at least two
5173 * blocks (base block and one extension block) if EDID extension count is > 0.
5180 * - HDMI 2.1 section 10.3.6 HDMI Forum EDID Extension Override Data Block
5182 static int edid_hfeeodb_extension_block_count(const struct edid *edid) in edid_hfeeodb_extension_block_count() argument
5187 if (!edid_extension_block_count(edid)) in edid_hfeeodb_extension_block_count()
5190 /* HF-EEODB is always in the first EDID extension block only */ in edid_hfeeodb_extension_block_count()
5191 cta = edid_extension_block_data(edid, 0); in edid_hfeeodb_extension_block_count()
5200 * Sinks that include the HF-EEODB in their E-EDID shall include one and in edid_hfeeodb_extension_block_count()
5201 * only one instance of the HF-EEODB in the E-EDID, occupying bytes 4 in edid_hfeeodb_extension_block_count()
5202 * through 6 of Block 1 of the E-EDID. in edid_hfeeodb_extension_block_count()
5275 /* Add 4:2:0(only) modes present in EDID */ in add_cea_modes()
5475 * drm_edid_get_monitor_name - fetch the monitor name from the edid
5476 * @edid: monitor EDID information
5481 void drm_edid_get_monitor_name(const struct edid *edid, char *name, int bufsize) in drm_edid_get_monitor_name() argument
5488 if (edid) { in drm_edid_get_monitor_name()
5491 .edid = edid, in drm_edid_get_monitor_name()
5492 .size = edid_size(edid), in drm_edid_get_monitor_name()
5537 * drm_edid_to_eld - build ELD from EDID
5539 * @drm_edid: EDID to parse
5541 * Fill the ELD (EDID-Like Data) buffer for passing to the audio driver. The
5567 eld[DRM_ELD_MANUFACTURER_NAME0] = drm_edid->edid->mfg_id[0]; in drm_edid_to_eld()
5568 eld[DRM_ELD_MANUFACTURER_NAME1] = drm_edid->edid->mfg_id[1]; in drm_edid_to_eld()
5569 eld[DRM_ELD_PRODUCT_CODE0] = drm_edid->edid->prod_code[0]; in drm_edid_to_eld()
5570 eld[DRM_ELD_PRODUCT_CODE1] = drm_edid->edid->prod_code[1]; in drm_edid_to_eld()
5650 * drm_edid_to_sad - extracts SADs from EDID
5651 * @edid: EDID to parse
5654 * Looks for CEA EDID block and extracts SADs (Short Audio Descriptors) from it.
5660 int drm_edid_to_sad(const struct edid *edid, struct cea_sad **sads) in drm_edid_to_sad() argument
5664 return _drm_edid_to_sad(drm_edid_legacy_init(&drm_edid, edid), sads); in drm_edid_to_sad()
5695 * drm_edid_to_speaker_allocation - extracts Speaker Allocation Data Blocks from EDID
5696 * @edid: EDID to parse
5699 * Looks for CEA EDID block and extracts the Speaker Allocation Data Block from it.
5706 int drm_edid_to_speaker_allocation(const struct edid *edid, u8 **sadb) in drm_edid_to_speaker_allocation() argument
5710 return _drm_edid_to_speaker_allocation(drm_edid_legacy_init(&drm_edid, edid), in drm_edid_to_speaker_allocation()
5744 * Convert raw EDID values to millisecond. in drm_av_sync_delay()
5780 * @edid: monitor EDID information
5784 * Drivers that have added the modes parsed from EDID to drm_display_info
5789 bool drm_detect_hdmi_monitor(const struct edid *edid) in drm_detect_hdmi_monitor() argument
5793 return _drm_detect_hdmi_monitor(drm_edid_legacy_init(&drm_edid, edid)); in drm_detect_hdmi_monitor()
5841 * @edid: EDID block to scan
5847 * audio' is not defined in EDID.
5851 bool drm_detect_monitor_audio(const struct edid *edid) in drm_detect_monitor_audio() argument
5855 return _drm_detect_monitor_audio(drm_edid_legacy_init(&drm_edid, edid)); in drm_detect_monitor_audio()
6114 * * Availability of a HF-VSDB block in EDID (check) in drm_parse_hdmi_forum_scds()
6251 * See EDID extension for head-mounted and specialized monitors, specified at:
6252 …* https://docs.microsoft.com/en-us/windows-hardware/drivers/display/specialized-monitors-edid-exte…
6345 const struct edid *edid = closure->drm_edid->edid; in get_monitor_range() local
6365 if (edid->revision >= 4) { in get_monitor_range()
6382 if (drm_edid->edid->revision < 4) in drm_get_monitor_range()
6385 if (!(drm_edid->edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ)) in drm_get_monitor_range()
6470 /* A connector has no EDID information, so we've got no EDID to compute quirks from. Reset
6471 * all of the values which would have been set from EDID
6538 const struct edid *edid; in update_display_info() local
6546 edid = drm_edid->edid; in update_display_info()
6550 info->width_mm = edid->width_cm * 10; in update_display_info()
6551 info->height_mm = edid->height_cm * 10; in update_display_info()
6555 if (edid->revision < 3) in update_display_info()
6567 * Digital sink with "DFP 1.x compliant TMDS" according to EDID 1.3? in update_display_info()
6569 * For such displays, the DFP spec 1.0, section 3.10 "EDID support" in update_display_info()
6570 * tells us to assume 8 bpc color depth if the EDID doesn't have in update_display_info()
6573 if (info->bpc == 0 && edid->revision == 3 && in update_display_info()
6574 edid->input & DRM_EDID_DIGITAL_DFP_1_X) { in update_display_info()
6582 if (edid->revision < 4) in update_display_info()
6585 switch (edid->input & DRM_EDID_DIGITAL_DEPTH_MASK) { in update_display_info()
6611 "[CONNECTOR:%d:%s] Assigning EDID-1.4 digital sink color depth as %d bpc.\n", in update_display_info()
6614 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444) in update_display_info()
6616 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422) in update_display_info()
6750 * EDID spec says modes should be preferred in this order: in _drm_edid_connector_add_modes()
6770 if (drm_edid->edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) in _drm_edid_connector_add_modes()
6789 const struct edid *old_edid = connector->edid_blob_ptr->data; in _drm_edid_connector_property_update()
6792 if (!drm_edid_are_equal(drm_edid ? drm_edid->edid : NULL, old_edid)) { in _drm_edid_connector_property_update()
6794 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] EDID changed, epoch counter %llu\n", in _drm_edid_connector_property_update()
6804 drm_edid ? drm_edid->edid : NULL, in _drm_edid_connector_property_update()
6808 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] EDID property update failed (%d)\n", in _drm_edid_connector_property_update()
6834 * drm_edid_connector_update - Update connector information from EDID
6836 * @drm_edid: EDID
6839 * etc. from the passed in EDID.
6841 * If EDID is NULL, reset the information.
6859 * drm_edid_connector_add_modes - Update probed modes from the EDID property
6862 * Add the modes from the previously updated EDID property to the connector
6866 * EDID property.
6888 * drm_connector_update_edid_property - update the edid property of a connector
6890 * @edid: new value of the edid property
6893 * connector's edid property.
6894 * Since we also parse tile information from EDID's displayID block, we also
6904 const struct edid *edid) in drm_connector_update_edid_property() argument
6908 return drm_edid_connector_update(connector, drm_edid_legacy_init(&drm_edid, edid)); in drm_connector_update_edid_property()
6913 * drm_add_edid_modes - add modes from EDID data, if available
6915 * @edid: EDID data
6919 * can be derived from the edid.
6925 int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) in drm_add_edid_modes() argument
6930 if (edid && !drm_edid_is_valid(edid)) { in drm_add_edid_modes()
6931 drm_warn(connector->dev, "[CONNECTOR:%d:%s] EDID invalid.\n", in drm_add_edid_modes()
6933 edid = NULL; in drm_add_edid_modes()
6936 drm_edid = drm_edid_legacy_init(&_drm_edid, edid); in drm_add_edid_modes()
6945 * drm_add_modes_noedid - add modes for the connectors without EDID
7377 * @drm_edid: The EDID
7383 return drm_edid && drm_edid->edid && in drm_edid_is_digital()
7384 drm_edid->edid->input & DRM_EDID_INPUT_DIGITAL; in drm_edid_is_digital()