Lines Matching full:edid
63 * EDID blocks out in the wild have a variety of bugs, try to collect
200 /* Rotel RSX-1058 forwards sink's EDID but only does HDMI 1.1*/
614 * modes are old-school Mac modes. The EDID spec says the 1152x864@75 mode
1590 * The opaque EDID type, internal to drm_edid.c.
1593 /* Size allocated for edid */
1595 const struct edid *edid; member
1598 static int edid_hfeeodb_extension_block_count(const struct edid *edid);
1600 static int edid_hfeeodb_block_count(const struct edid *edid) in edid_hfeeodb_block_count() argument
1602 int eeodb = edid_hfeeodb_extension_block_count(edid); in edid_hfeeodb_block_count()
1607 static int edid_extension_block_count(const struct edid *edid) in edid_extension_block_count() argument
1609 return edid->extensions; in edid_extension_block_count()
1612 static int edid_block_count(const struct edid *edid) in edid_block_count() argument
1614 return edid_extension_block_count(edid) + 1; in edid_block_count()
1622 static int edid_size(const struct edid *edid) in edid_size() argument
1624 return edid_size_by_blocks(edid_block_count(edid)); in edid_size()
1627 static const void *edid_block_data(const struct edid *edid, int index) in edid_block_data() argument
1629 BUILD_BUG_ON(sizeof(*edid) != EDID_LENGTH); in edid_block_data()
1631 return edid + index; in edid_block_data()
1634 static const void *edid_extension_block_data(const struct edid *edid, int index) in edid_extension_block_data() argument
1636 return edid_block_data(edid, index + 1); in edid_extension_block_data()
1639 /* EDID block count indicated in EDID, may exceed allocated size */
1645 num_blocks = edid_block_count(drm_edid->edid); in __drm_edid_block_count()
1655 eeodb = edid_hfeeodb_block_count(drm_edid->edid); in __drm_edid_block_count()
1663 /* EDID block count, limited by allocated size */
1671 /* EDID extension block count, limited by allocated size */
1679 return edid_block_data(drm_edid->edid, index); in drm_edid_block_data()
1685 return edid_extension_block_data(drm_edid->edid, index); in drm_edid_extension_block_data()
1690 * trust edid size. Not for general purpose use.
1693 const struct edid *edid) in drm_edid_legacy_init() argument
1695 if (!edid) in drm_edid_legacy_init()
1700 drm_edid->edid = edid; in drm_edid_legacy_init()
1701 drm_edid->size = edid_size(edid); in drm_edid_legacy_init()
1707 * EDID base and extension block iterator.
1758 static void edid_header_fix(void *edid) in edid_header_fix() argument
1760 memcpy(edid, edid_header, sizeof(edid_header)); in edid_header_fix()
1764 * drm_edid_header_is_valid - sanity check the header of the base EDID block
1765 * @_edid: pointer to raw base EDID block
1767 * Sanity check the header of the base EDID block.
1773 const struct edid *edid = _edid; in drm_edid_header_is_valid() local
1777 if (edid->header[i] == edid_header[i]) in drm_edid_header_is_valid()
1788 "Minimum number of valid EDID header bytes (0-8, default 6)");
1806 const struct edid *block = _block; in edid_block_get_checksum()
1818 static bool edid_block_is_zero(const void *edid) in edid_block_is_zero() argument
1820 return mem_is_zero(edid, EDID_LENGTH); in edid_block_is_zero()
1826 bool edid1_present = drm_edid && drm_edid->edid && drm_edid->size; in drm_edid_eq()
1836 if (memcmp(drm_edid->edid, raw_edid, drm_edid->size)) in drm_edid_eq()
1858 const struct edid *block = _block; in edid_block_check()
1906 const struct edid *block, in edid_block_status_print()
1913 pr_debug("EDID block %d read failed\n", block_num); in edid_block_status_print()
1916 pr_debug("EDID block %d pointer is NULL\n", block_num); in edid_block_status_print()
1919 pr_notice("EDID block %d is all zeroes\n", block_num); in edid_block_status_print()
1922 pr_notice("EDID has corrupt header\n"); in edid_block_status_print()
1925 pr_debug("EDID corrupt header needs repair\n"); in edid_block_status_print()
1928 pr_debug("EDID corrupt header fixed\n"); in edid_block_status_print()
1932 pr_debug("EDID block %d (tag 0x%02x) checksum is invalid, remainder is %d, ignoring\n", in edid_block_status_print()
1936 pr_notice("EDID block %d (tag 0x%02x) checksum is invalid, remainder is %d\n", in edid_block_status_print()
1942 pr_notice("EDID has major version %d, instead of 1\n", in edid_block_status_print()
1946 WARN(1, "EDID block %d unknown edid block status code %d\n", in edid_block_status_print()
1970 * Validate a base or extension EDID block and optionally dump bad blocks to
1976 struct edid *block = _block; in drm_edid_block_valid()
1986 DRM_DEBUG_KMS("Fixing EDID header, your hardware may be failing\n"); in drm_edid_block_valid()
2013 pr_notice("Raw EDID:\n"); in drm_edid_block_valid()
2021 * drm_edid_is_valid - sanity check EDID data
2022 * @edid: EDID data
2024 * Sanity-check an entire EDID record (including extensions)
2026 * Return: True if the EDID data is valid, false otherwise.
2028 bool drm_edid_is_valid(struct edid *edid) in drm_edid_is_valid() argument
2032 if (!edid) in drm_edid_is_valid()
2035 for (i = 0; i < edid_block_count(edid); i++) { in drm_edid_is_valid()
2036 void *block = (void *)edid_block_data(edid, i); in drm_edid_is_valid()
2047 * drm_edid_valid - sanity check EDID data
2048 * @drm_edid: EDID data
2050 * Sanity check an EDID. Cross check block count against allocated size and
2053 * Return: True if the EDID data is valid, false otherwise.
2076 static struct edid *edid_filter_invalid_blocks(struct edid *edid, in edid_filter_invalid_blocks() argument
2079 struct edid *new; in edid_filter_invalid_blocks()
2083 * Note: If the EDID uses HF-EEODB, but has invalid blocks, we'll revert in edid_filter_invalid_blocks()
2087 for (i = 0; i < edid_block_count(edid); i++) { in edid_filter_invalid_blocks()
2088 const void *src_block = edid_block_data(edid, i); in edid_filter_invalid_blocks()
2091 void *dst_block = (void *)edid_block_data(edid, valid_blocks); in edid_filter_invalid_blocks()
2100 kfree(edid); in edid_filter_invalid_blocks()
2104 edid->extensions = valid_blocks - 1; in edid_filter_invalid_blocks()
2105 edid->checksum = edid_block_compute_checksum(edid); in edid_filter_invalid_blocks()
2109 new = krealloc(edid, *alloc_size, GFP_KERNEL); in edid_filter_invalid_blocks()
2111 kfree(edid); in edid_filter_invalid_blocks()
2118 * drm_do_probe_ddc_edid() - get EDID information via I2C
2120 * @buf: EDID data buffer to be filled
2121 * @block: 128 byte EDID block to start fetching from
2122 * @len: EDID data buffer length to fetch
2124 * Try to fetch EDID information by calling I2C driver functions.
2181 const struct edid *edid, int num_blocks) in connector_bad_edid() argument
2187 * 0x7e in the EDID is the number of extension blocks. The EDID in connector_bad_edid()
2189 * of 0x7e in the EDID of the _index_ of the last block in the in connector_bad_edid()
2192 last_block = edid->extensions; in connector_bad_edid()
2194 /* Calculate real checksum for the last edid extension block data */ in connector_bad_edid()
2197 edid_block_compute_checksum(edid + last_block); in connector_bad_edid()
2202 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID is invalid:\n", in connector_bad_edid()
2205 edid_block_dump(KERN_DEBUG, edid + i, i); in connector_bad_edid()
2208 /* Get override or firmware EDID */
2235 seq_write(m, drm_edid->edid, drm_edid->size); in drm_edid_override_show()
2243 int drm_edid_override_set(struct drm_connector *connector, const void *edid, in drm_edid_override_set() argument
2248 drm_edid = drm_edid_alloc(edid, size); in drm_edid_override_set()
2250 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID override invalid\n", in drm_edid_override_set()
2256 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID override set\n", in drm_edid_override_set()
2272 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID override reset\n", in drm_edid_override_reset()
2286 * drm_edid_override_connector_update - add modes from override/firmware EDID
2289 * Add modes from the override/firmware EDID, if available. Only to be used from
2291 * failed during drm_get_edid() and caused the override/firmware EDID to be
2309 "[CONNECTOR:%d:%s] adding %d modes via fallback override/firmware EDID\n", in drm_edid_override_connector_update()
2352 static struct edid *_drm_do_get_edid(struct drm_connector *connector, in _drm_do_get_edid()
2359 struct edid *edid, *new; in _drm_do_get_edid() local
2365 edid = kmemdup(override->edid, alloc_size, GFP_KERNEL); in _drm_do_get_edid()
2367 if (!edid) in _drm_do_get_edid()
2372 edid = kmalloc(alloc_size, GFP_KERNEL); in _drm_do_get_edid()
2373 if (!edid) in _drm_do_get_edid()
2376 status = edid_block_read(edid, 0, read_block, context); in _drm_do_get_edid()
2378 edid_block_status_print(status, edid, 0); in _drm_do_get_edid()
2383 /* FIXME: Clarify what a corrupt EDID actually means. */ in _drm_do_get_edid()
2389 if (!edid_block_status_valid(status, edid_block_tag(edid))) { in _drm_do_get_edid()
2393 connector_bad_edid(connector, edid, 1); in _drm_do_get_edid()
2397 if (!edid_extension_block_count(edid)) in _drm_do_get_edid()
2400 alloc_size = edid_size(edid); in _drm_do_get_edid()
2401 new = krealloc(edid, alloc_size, GFP_KERNEL); in _drm_do_get_edid()
2404 edid = new; in _drm_do_get_edid()
2406 num_blocks = edid_block_count(edid); in _drm_do_get_edid()
2408 void *block = (void *)edid_block_data(edid, i); in _drm_do_get_edid()
2420 * If the first EDID extension is a CTA extension, and in _drm_do_get_edid()
2428 int eeodb = edid_hfeeodb_block_count(edid); in _drm_do_get_edid()
2433 new = krealloc(edid, alloc_size, GFP_KERNEL); in _drm_do_get_edid()
2436 edid = new; in _drm_do_get_edid()
2442 connector_bad_edid(connector, edid, num_blocks); in _drm_do_get_edid()
2444 edid = edid_filter_invalid_blocks(edid, &alloc_size); in _drm_do_get_edid()
2451 return edid; in _drm_do_get_edid()
2454 kfree(edid); in _drm_do_get_edid()
2459 * drm_edid_raw - Get a pointer to the raw EDID data.
2462 * Get a pointer to the raw EDID data.
2466 * Return: Pointer to raw EDID data.
2468 const struct edid *drm_edid_raw(const struct drm_edid *drm_edid) in drm_edid_raw()
2474 * Do not return pointers where relying on EDID extension count would in drm_edid_raw()
2477 if (WARN_ON(edid_size(drm_edid->edid) > drm_edid->size)) in drm_edid_raw()
2480 return drm_edid->edid; in drm_edid_raw()
2484 /* Allocate struct drm_edid container *without* duplicating the edid data */
2485 static const struct drm_edid *_drm_edid_alloc(const void *edid, size_t size) in _drm_edid_alloc() argument
2489 if (!edid || !size || size < EDID_LENGTH) in _drm_edid_alloc()
2494 drm_edid->edid = edid; in _drm_edid_alloc()
2503 * @edid: Pointer to raw EDID data
2504 * @size: Size of memory allocated for EDID
2506 * Allocate a new drm_edid container. Do not calculate edid size from edid, pass
2508 * of the raw EDID data against the size, but at least the EDID base block must
2515 const struct drm_edid *drm_edid_alloc(const void *edid, size_t size) in drm_edid_alloc() argument
2519 if (!edid || !size || size < EDID_LENGTH) in drm_edid_alloc()
2522 edid = kmemdup(edid, size, GFP_KERNEL); in drm_edid_alloc()
2523 if (!edid) in drm_edid_alloc()
2526 drm_edid = _drm_edid_alloc(edid, size); in drm_edid_alloc()
2528 kfree(edid); in drm_edid_alloc()
2536 * @drm_edid: EDID to duplicate
2547 return drm_edid_alloc(drm_edid->edid, drm_edid->size); in drm_edid_dup()
2553 * @drm_edid: EDID to free
2560 kfree(drm_edid->edid); in drm_edid_free()
2581 * drm_get_edid - get EDID data, if available
2585 * Poke the given I2C channel to grab EDID data if possible. If found,
2588 * Return: Pointer to valid EDID or NULL if we couldn't find any.
2590 struct edid *drm_get_edid(struct drm_connector *connector, in drm_get_edid()
2593 struct edid *edid; in drm_get_edid() local
2601 edid = _drm_do_get_edid(connector, drm_do_probe_ddc_edid, adapter, NULL); in drm_get_edid()
2602 drm_connector_update_edid_property(connector, edid); in drm_get_edid()
2603 return edid; in drm_get_edid()
2608 * drm_edid_read_custom - Read EDID data using given EDID block read function
2610 * @read_block: EDID block read function
2614 * exposes a different interface to read EDID blocks this function can be used
2615 * to get EDID data using a custom block read function.
2622 * The EDID may be overridden using debugfs override_edid or firmware EDID
2624 * order. Having either of them bypasses actual EDID reads.
2628 * Return: Pointer to EDID, or NULL if probe/read failed.
2635 struct edid *edid; in drm_edid_read_custom() local
2638 edid = _drm_do_get_edid(connector, read_block, context, &size); in drm_edid_read_custom()
2639 if (!edid) in drm_edid_read_custom()
2645 drm_edid = _drm_edid_alloc(edid, size); in drm_edid_read_custom()
2647 kfree(edid); in drm_edid_read_custom()
2654 * drm_edid_read_ddc - Read EDID data using given I2C adapter
2658 * Read EDID using the given I2C adapter.
2660 * The EDID may be overridden using debugfs override_edid or firmware EDID
2662 * order. Having either of them bypasses actual EDID reads.
2669 * Return: Pointer to EDID, or NULL if probe/read failed.
2691 * drm_edid_read - Read EDID data using connector's I2C adapter
2694 * Read EDID using the connector's I2C adapter.
2696 * The EDID may be overridden using debugfs override_edid or firmware EDID
2698 * order. Having either of them bypasses actual EDID reads.
2702 * Return: Pointer to EDID, or NULL if probe/read failed.
2715 * @drm_edid: EDID
2721 if (drm_edid && drm_edid->edid && drm_edid->size >= EDID_LENGTH) in drm_edid_get_product_id()
2722 memcpy(id, &drm_edid->edid->product_id, sizeof(*id)); in drm_edid_get_product_id()
2744 * @id: EDID product id
2747 * See VESA E-EDID 1.4 section 3.4.
2771 * drm_edid_get_panel_id - Get a panel's ID from EDID
2772 * @drm_edid: EDID that contains panel ID.
2774 * This function uses the first block of the EDID of a panel and (assuming
2775 * that the EDID is valid) extracts the ID out of it. The ID is a 32-bit value
2782 * ID. Return 0 if the EDID size is less than a base block.
2786 const struct edid *edid = drm_edid->edid; in drm_edid_get_panel_id() local
2804 return (u32)edid->mfg_id[0] << 24 | in drm_edid_get_panel_id()
2805 (u32)edid->mfg_id[1] << 16 | in drm_edid_get_panel_id()
2806 (u32)EDID_PRODUCT_ID(edid); in drm_edid_get_panel_id()
2811 * drm_edid_read_base_block - Get a panel's EDID base block
2814 * This function returns the drm_edid containing the first block of the EDID of
2819 * assume that the EDID of the panel is correct, at least as far as the base
2825 * be read the EDID, but there is no caching between them. Since we're only
2829 * during the early probe of panel. The EDID read from the function is temporary
2830 * and should be replaced by the full EDID returned from other drm_edid_read.
2832 * Return: Pointer to allocated EDID base block, or NULL on any failure.
2858 * drm_get_edid_switcheroo - get EDID data for a vga_switcheroo output
2864 * switch DDC to the GPU which is retrieving EDID.
2866 * Return: Pointer to valid EDID or %NULL if we couldn't find any.
2868 struct edid *drm_get_edid_switcheroo(struct drm_connector *connector, in drm_get_edid_switcheroo()
2873 struct edid *edid; in drm_get_edid_switcheroo() local
2879 edid = drm_get_edid(connector, adapter); in drm_get_edid_switcheroo()
2882 return edid; in drm_get_edid_switcheroo()
2887 * drm_edid_read_switcheroo - get EDID data for a vga_switcheroo output
2893 * temporarily switch DDC to the GPU which is retrieving EDID.
2895 * Return: Pointer to valid EDID or %NULL if we couldn't find any.
2916 * drm_edid_duplicate - duplicate an EDID and the extensions
2917 * @edid: EDID to duplicate
2919 * Return: Pointer to duplicated EDID or NULL on allocation failure.
2921 struct edid *drm_edid_duplicate(const struct edid *edid) in drm_edid_duplicate() argument
2923 if (!edid) in drm_edid_duplicate()
2926 return kmemdup(edid, edid_size(edid), GFP_KERNEL); in drm_edid_duplicate()
2930 /*** EDID parsing ***/
2933 * edid_get_quirks - return quirk flags for a given EDID
2934 * @drm_edid: EDID to process
3107 cb(&drm_edid->edid->detailed_timings[i], closure); in drm_for_each_detailed_block()
3141 /* EDID 1.4 defines this explicitly. For EDID 1.3, we guess, badly. */
3145 if (drm_edid->edid->revision >= 4) { in drm_monitor_supports_rb()
3258 const struct edid *edid = drm_edid->edid; in standard_timing_level() local
3260 if (edid->revision >= 4) { in standard_timing_level()
3270 } else if (edid->revision >= 3 && drm_gtf2_hbreak(drm_edid)) { in standard_timing_level()
3272 } else if (edid->revision >= 2) { in standard_timing_level()
3349 /* According to the EDID spec, the hdisplay = hsize * 8 + 248 */ in drm_mode_std()
3355 if (drm_edid->edid->revision < 3) in drm_mode_std()
3427 * EDID is delightfully ambiguous about how interlaced modes are to be
3469 * Create a new mode from an EDID detailed timing section. An EDID detailed
3573 mode->width_mm = drm_edid->edid->width_cm * 10; in drm_mode_detailed()
3574 mode->height_mm = drm_edid->edid->height_cm * 10; in drm_mode_detailed()
3585 const struct edid *edid, const u8 *t) in mode_in_hsync_range() argument
3590 if (edid->revision >= 4) in mode_in_hsync_range()
3593 if (edid->revision >= 4) in mode_in_hsync_range()
3602 const struct edid *edid, const u8 *t) in mode_in_vsync_range() argument
3607 if (edid->revision >= 4) in mode_in_vsync_range()
3610 if (edid->revision >= 4) in mode_in_vsync_range()
3618 range_pixel_clock(const struct edid *edid, const u8 *t) in range_pixel_clock() argument
3625 if (edid->revision >= 4 && t[10] == DRM_EDID_CVT_SUPPORT_FLAG) in range_pixel_clock()
3636 const struct edid *edid = drm_edid->edid; in mode_in_range() local
3640 if (!mode_in_hsync_range(mode, edid, t)) in mode_in_range()
3643 if (!mode_in_vsync_range(mode, edid, t)) in mode_in_range()
3646 max_clock = range_pixel_clock(edid, t); in mode_in_range()
3652 if (edid->revision >= 4 && t[10] == DRM_EDID_CVT_SUPPORT_FLAG) in mode_in_range()
3817 if (closure->drm_edid->edid->revision < 2) in do_inferred_modes()
3832 if (closure->drm_edid->edid->revision < 4) in do_inferred_modes()
3853 if (drm_edid->edid->revision >= 1) in add_inferred_modes()
3900 * Get established modes from EDID and add them. Each EDID block contains a
3908 const struct edid *edid = drm_edid->edid; in add_established_modes() local
3909 unsigned long est_bits = edid->established_timings.t1 | in add_established_modes()
3910 (edid->established_timings.t2 << 8) | in add_established_modes()
3911 ((edid->established_timings.mfg_rsvd & 0x80) << 9); in add_established_modes()
3930 if (edid->revision >= 1) in add_established_modes()
3961 * Get standard modes from EDID and add them. Standard modes can be calculated
3962 * using the appropriate standard (DMT, GTF, or CVT). Grab them from EDID and
3978 &drm_edid->edid->standard_timings[i]); in add_standard_modes()
3985 if (drm_edid->edid->revision >= 1) in add_standard_modes()
4065 if (drm_edid->edid->revision >= 3) in add_cvt_modes()
4108 * @drm_edid: EDID block to scan
4118 if (drm_edid->edid->revision >= 4) in add_detailed_modes()
4122 drm_edid->edid->features & DRM_EDID_FEATURE_PREFERRED_TIMING; in add_detailed_modes()
4151 * Search EDID for CEA extension block.
4153 * FIXME: Prefer not returning pointers to raw EDID data.
4161 /* No EDID or EDID extensions */ in drm_edid_find_extension()
4180 /* Return true if the EDID has a CTA extension or a DisplayID CTA data block */
4560 * the EDID, or NULL on errors.
4943 * Iterate through all CTA Data Blocks in both EDID CTA Extensions and DisplayID
4949 * cea_db_iter_edid_begin(edid, &iter);
5051 * - VESA E-EDID v1.4
5130 * the EDID CTA Extensions, then all the DisplayID CTA blocks. in __cea_db_iter_next()
5132 * Per DisplayID v1.3 Appendix B: DisplayID as an EDID in __cea_db_iter_next()
5213 * Get the HF-EEODB override extension block count from EDID.
5215 * The passed in EDID may be partially read, as long as it has at least two
5216 * blocks (base block and one extension block) if EDID extension count is > 0.
5223 * - HDMI 2.1 section 10.3.6 HDMI Forum EDID Extension Override Data Block
5225 static int edid_hfeeodb_extension_block_count(const struct edid *edid) in edid_hfeeodb_extension_block_count() argument
5230 if (!edid_extension_block_count(edid)) in edid_hfeeodb_extension_block_count()
5233 /* HF-EEODB is always in the first EDID extension block only */ in edid_hfeeodb_extension_block_count()
5234 cta = edid_extension_block_data(edid, 0); in edid_hfeeodb_extension_block_count()
5243 * Sinks that include the HF-EEODB in their E-EDID shall include one and in edid_hfeeodb_extension_block_count()
5244 * only one instance of the HF-EEODB in the E-EDID, occupying bytes 4 in edid_hfeeodb_extension_block_count()
5245 * through 6 of Block 1 of the E-EDID. in edid_hfeeodb_extension_block_count()
5318 /* Add 4:2:0(only) modes present in EDID */ in add_cea_modes()
5508 /* Allow white space before EDID string terminator. */ in match_identity()
5518 * @drm_edid: EDID
5519 * @ident: the EDID identity to match with
5521 * Check if the EDID matches with the given identity.
5523 * Return: True if the given identity matched with EDID, false otherwise.
5578 * drm_edid_get_monitor_name - fetch the monitor name from the edid
5579 * @edid: monitor EDID information
5584 void drm_edid_get_monitor_name(const struct edid *edid, char *name, int bufsize) in drm_edid_get_monitor_name() argument
5591 if (edid) { in drm_edid_get_monitor_name()
5594 .edid = edid, in drm_edid_get_monitor_name()
5595 .size = edid_size(edid), in drm_edid_get_monitor_name()
5642 * drm_edid_to_eld - build ELD from EDID
5644 * @drm_edid: EDID to parse
5646 * Fill the ELD (EDID-Like Data) buffer for passing to the audio driver. The
5674 eld[DRM_ELD_MANUFACTURER_NAME0] = drm_edid->edid->mfg_id[0]; in drm_edid_to_eld()
5675 eld[DRM_ELD_MANUFACTURER_NAME1] = drm_edid->edid->mfg_id[1]; in drm_edid_to_eld()
5676 eld[DRM_ELD_PRODUCT_CODE0] = drm_edid->edid->prod_code[0]; in drm_edid_to_eld()
5677 eld[DRM_ELD_PRODUCT_CODE1] = drm_edid->edid->prod_code[1]; in drm_edid_to_eld()
5759 * drm_edid_to_sad - extracts SADs from EDID
5760 * @edid: EDID to parse
5763 * Looks for CEA EDID block and extracts SADs (Short Audio Descriptors) from it.
5769 int drm_edid_to_sad(const struct edid *edid, struct cea_sad **sads) in drm_edid_to_sad() argument
5773 return _drm_edid_to_sad(drm_edid_legacy_init(&drm_edid, edid), sads); in drm_edid_to_sad()
5804 * drm_edid_to_speaker_allocation - extracts Speaker Allocation Data Blocks from EDID
5805 * @edid: EDID to parse
5808 * Looks for CEA EDID block and extracts the Speaker Allocation Data Block from it.
5815 int drm_edid_to_speaker_allocation(const struct edid *edid, u8 **sadb) in drm_edid_to_speaker_allocation() argument
5819 return _drm_edid_to_speaker_allocation(drm_edid_legacy_init(&drm_edid, edid), in drm_edid_to_speaker_allocation()
5853 * Convert raw EDID values to millisecond. in drm_av_sync_delay()
5889 * @edid: monitor EDID information
5893 * Drivers that have added the modes parsed from EDID to drm_display_info
5898 bool drm_detect_hdmi_monitor(const struct edid *edid) in drm_detect_hdmi_monitor() argument
5902 return _drm_detect_hdmi_monitor(drm_edid_legacy_init(&drm_edid, edid)); in drm_detect_hdmi_monitor()
5950 * @edid: EDID block to scan
5956 * audio' is not defined in EDID.
5960 bool drm_detect_monitor_audio(const struct edid *edid) in drm_detect_monitor_audio() argument
5964 return _drm_detect_monitor_audio(drm_edid_legacy_init(&drm_edid, edid)); in drm_detect_monitor_audio()
6223 * * Availability of a HF-VSDB block in EDID (check) in drm_parse_hdmi_forum_scds()
6360 * See EDID extension for head-mounted and specialized monitors, specified at:
6361 …* https://docs.microsoft.com/en-us/windows-hardware/drivers/display/specialized-monitors-edid-exte…
6454 const struct edid *edid = closure->drm_edid->edid; in get_monitor_range() local
6474 if (edid->revision >= 4) { in get_monitor_range()
6491 if (drm_edid->edid->revision < 4) in drm_get_monitor_range()
6494 if (!(drm_edid->edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ)) in drm_get_monitor_range()
6579 /* A connector has no EDID information, so we've got no EDID to compute quirks from. Reset
6580 * all of the values which would have been set from EDID
6652 const struct edid *edid; in update_display_info() local
6660 edid = drm_edid->edid; in update_display_info()
6664 info->width_mm = edid->width_cm * 10; in update_display_info()
6665 info->height_mm = edid->height_cm * 10; in update_display_info()
6669 if (edid->revision < 3) in update_display_info()
6681 * Digital sink with "DFP 1.x compliant TMDS" according to EDID 1.3? in update_display_info()
6683 * For such displays, the DFP spec 1.0, section 3.10 "EDID support" in update_display_info()
6684 * tells us to assume 8 bpc color depth if the EDID doesn't have in update_display_info()
6687 if (info->bpc == 0 && edid->revision == 3 && in update_display_info()
6688 edid->input & DRM_EDID_DIGITAL_DFP_1_X) { in update_display_info()
6696 if (edid->revision < 4) in update_display_info()
6699 switch (edid->input & DRM_EDID_DIGITAL_DEPTH_MASK) { in update_display_info()
6725 "[CONNECTOR:%d:%s] Assigning EDID-1.4 digital sink color depth as %d bpc.\n", in update_display_info()
6728 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444) in update_display_info()
6730 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422) in update_display_info()
6864 * EDID spec says modes should be preferred in this order: in _drm_edid_connector_add_modes()
6884 if (drm_edid->edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) in _drm_edid_connector_add_modes()
6908 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] EDID changed, epoch counter %llu\n", in _drm_edid_connector_property_update()
6917 drm_edid ? drm_edid->edid : NULL, in _drm_edid_connector_property_update()
6921 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] EDID property update failed (%d)\n", in _drm_edid_connector_property_update()
6946 /* For sysfs edid show implementation */
6950 const void *edid; in drm_edid_connector_property_show() local
6959 edid = connector->edid_blob_ptr->data; in drm_edid_connector_property_show()
6961 if (!edid) in drm_edid_connector_property_show()
6970 memcpy(buf, edid + off, count); in drm_edid_connector_property_show()
6980 * drm_edid_connector_update - Update connector information from EDID
6982 * @drm_edid: EDID
6985 * etc. from the passed in EDID.
6987 * If EDID is NULL, reset the information.
7005 * drm_edid_connector_add_modes - Update probed modes from the EDID property
7008 * Add the modes from the previously updated EDID property to the connector
7012 * EDID property.
7034 * drm_connector_update_edid_property - update the edid property of a connector
7036 * @edid: new value of the edid property
7039 * connector's edid property.
7040 * Since we also parse tile information from EDID's displayID block, we also
7050 const struct edid *edid) in drm_connector_update_edid_property() argument
7054 return drm_edid_connector_update(connector, drm_edid_legacy_init(&drm_edid, edid)); in drm_connector_update_edid_property()
7059 * drm_add_edid_modes - add modes from EDID data, if available
7061 * @edid: EDID data
7065 * can be derived from the edid.
7071 int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) in drm_add_edid_modes() argument
7076 if (edid && !drm_edid_is_valid(edid)) { in drm_add_edid_modes()
7077 drm_warn(connector->dev, "[CONNECTOR:%d:%s] EDID invalid.\n", in drm_add_edid_modes()
7079 edid = NULL; in drm_add_edid_modes()
7082 drm_edid = drm_edid_legacy_init(&_drm_edid, edid); in drm_add_edid_modes()
7091 * drm_add_modes_noedid - add modes for the connectors without EDID
7501 * @drm_edid: The EDID
7507 return drm_edid && drm_edid->edid && in drm_edid_is_digital()
7508 drm_edid->edid->input & DRM_EDID_INPUT_DIGITAL; in drm_edid_is_digital()