Lines Matching full:edid

58  * EDID blocks out in the wild have a variety of bugs, try to collect
178 /* Rotel RSX-1058 forwards sink's EDID but only does HDMI 1.1*/
591 * modes are old-school Mac modes. The EDID spec says the 1152x864@75 mode
1567 * The opaque EDID type, internal to drm_edid.c.
1570 /* Size allocated for edid */
1572 const struct edid *edid; member
1578 const struct edid *edid = drm_edid->edid; in version_greater() local
1580 return edid->version > version || in version_greater()
1581 (edid->version == version && edid->revision > revision); in version_greater()
1584 static int edid_hfeeodb_extension_block_count(const struct edid *edid);
1586 static int edid_hfeeodb_block_count(const struct edid *edid) in edid_hfeeodb_block_count() argument
1588 int eeodb = edid_hfeeodb_extension_block_count(edid); in edid_hfeeodb_block_count()
1593 static int edid_extension_block_count(const struct edid *edid) in edid_extension_block_count() argument
1595 return edid->extensions; in edid_extension_block_count()
1598 static int edid_block_count(const struct edid *edid) in edid_block_count() argument
1600 return edid_extension_block_count(edid) + 1; in edid_block_count()
1608 static int edid_size(const struct edid *edid) in edid_size() argument
1610 return edid_size_by_blocks(edid_block_count(edid)); in edid_size()
1613 static const void *edid_block_data(const struct edid *edid, int index) in edid_block_data() argument
1615 BUILD_BUG_ON(sizeof(*edid) != EDID_LENGTH); in edid_block_data()
1617 return edid + index; in edid_block_data()
1620 static const void *edid_extension_block_data(const struct edid *edid, int index) in edid_extension_block_data() argument
1622 return edid_block_data(edid, index + 1); in edid_extension_block_data()
1630 num_blocks = edid_block_count(drm_edid->edid); in drm_edid_block_count()
1640 eeodb = edid_hfeeodb_block_count(drm_edid->edid); in drm_edid_block_count()
1658 return edid_block_data(drm_edid->edid, index); in drm_edid_block_data()
1664 return edid_extension_block_data(drm_edid->edid, index); in drm_edid_extension_block_data()
1669 * trust edid size. Not for general purpose use.
1672 const struct edid *edid) in drm_edid_legacy_init() argument
1674 if (!edid) in drm_edid_legacy_init()
1679 drm_edid->edid = edid; in drm_edid_legacy_init()
1680 drm_edid->size = edid_size(edid); in drm_edid_legacy_init()
1686 * EDID base and extension block iterator.
1737 static void edid_header_fix(void *edid) in edid_header_fix() argument
1739 memcpy(edid, edid_header, sizeof(edid_header)); in edid_header_fix()
1743 * drm_edid_header_is_valid - sanity check the header of the base EDID block
1744 * @_edid: pointer to raw base EDID block
1746 * Sanity check the header of the base EDID block.
1752 const struct edid *edid = _edid; in drm_edid_header_is_valid() local
1756 if (edid->header[i] == edid_header[i]) in drm_edid_header_is_valid()
1767 "Minimum number of valid EDID header bytes (0-8, default 6)");
1785 const struct edid *block = _block; in edid_block_get_checksum()
1797 static bool edid_block_is_zero(const void *edid) in edid_block_is_zero() argument
1799 return !memchr_inv(edid, 0, EDID_LENGTH); in edid_block_is_zero()
1803 * drm_edid_are_equal - compare two edid blobs.
1807 * edid had changed.
1809 bool drm_edid_are_equal(const struct edid *edid1, const struct edid *edid2) in drm_edid_are_equal()
1848 const struct edid *block = _block; in edid_block_check()
1896 const struct edid *block, in edid_block_status_print()
1903 pr_debug("EDID block %d read failed\n", block_num); in edid_block_status_print()
1906 pr_debug("EDID block %d pointer is NULL\n", block_num); in edid_block_status_print()
1909 pr_notice("EDID block %d is all zeroes\n", block_num); in edid_block_status_print()
1912 pr_notice("EDID has corrupt header\n"); in edid_block_status_print()
1915 pr_debug("EDID corrupt header needs repair\n"); in edid_block_status_print()
1918 pr_debug("EDID corrupt header fixed\n"); in edid_block_status_print()
1922 pr_debug("EDID block %d (tag 0x%02x) checksum is invalid, remainder is %d, ignoring\n", in edid_block_status_print()
1926 pr_notice("EDID block %d (tag 0x%02x) checksum is invalid, remainder is %d\n", in edid_block_status_print()
1932 pr_notice("EDID has major version %d, instead of 1\n", in edid_block_status_print()
1936 WARN(1, "EDID block %d unknown edid block status code %d\n", in edid_block_status_print()
1960 * drm_edid_block_valid - Sanity check the EDID block (base or extension)
1961 * @_block: pointer to raw EDID block
1963 * @print_bad_edid: if true, dump bad EDID blocks to the console
1966 * Validate a base or extension EDID block and optionally dump bad blocks to
1974 struct edid *block = (struct edid *)_block; in drm_edid_block_valid()
1984 DRM_DEBUG("Fixing EDID header, your hardware may be failing\n"); in drm_edid_block_valid()
2011 pr_notice("Raw EDID:\n"); in drm_edid_block_valid()
2020 * drm_edid_is_valid - sanity check EDID data
2021 * @edid: EDID data
2023 * Sanity-check an entire EDID record (including extensions)
2025 * Return: True if the EDID data is valid, false otherwise.
2027 bool drm_edid_is_valid(struct edid *edid) in drm_edid_is_valid() argument
2031 if (!edid) in drm_edid_is_valid()
2034 for (i = 0; i < edid_block_count(edid); i++) { in drm_edid_is_valid()
2035 void *block = (void *)edid_block_data(edid, i); in drm_edid_is_valid()
2045 static struct edid *edid_filter_invalid_blocks(struct edid *edid, in edid_filter_invalid_blocks() argument
2048 struct edid *new; in edid_filter_invalid_blocks()
2052 * Note: If the EDID uses HF-EEODB, but has invalid blocks, we'll revert in edid_filter_invalid_blocks()
2056 for (i = 0; i < edid_block_count(edid); i++) { in edid_filter_invalid_blocks()
2057 const void *src_block = edid_block_data(edid, i); in edid_filter_invalid_blocks()
2060 void *dst_block = (void *)edid_block_data(edid, valid_blocks); in edid_filter_invalid_blocks()
2069 kfree(edid); in edid_filter_invalid_blocks()
2073 edid->extensions = valid_blocks - 1; in edid_filter_invalid_blocks()
2074 edid->checksum = edid_block_compute_checksum(edid); in edid_filter_invalid_blocks()
2078 new = krealloc(edid, *alloc_size, GFP_KERNEL); in edid_filter_invalid_blocks()
2080 kfree(edid); in edid_filter_invalid_blocks()
2087 * drm_do_probe_ddc_edid() - get EDID information via I2C
2089 * @buf: EDID data buffer to be filled
2090 * @block: 128 byte EDID block to start fetching from
2091 * @len: EDID data buffer length to fetch
2093 * Try to fetch EDID information by calling I2C driver functions.
2150 const struct edid *edid, int num_blocks) in connector_bad_edid() argument
2156 * 0x7e in the EDID is the number of extension blocks. The EDID in connector_bad_edid()
2158 * of 0x7e in the EDID of the _index_ of the last block in the in connector_bad_edid()
2161 last_block = edid->extensions; in connector_bad_edid()
2163 /* Calculate real checksum for the last edid extension block data */ in connector_bad_edid()
2166 edid_block_compute_checksum(edid + last_block); in connector_bad_edid()
2171 drm_dbg_kms(connector->dev, "%s: EDID is invalid:\n", connector->name); in connector_bad_edid()
2173 edid_block_dump(KERN_DEBUG, edid + i, i); in connector_bad_edid()
2176 /* Get override or firmware EDID */
2177 static struct edid *drm_get_override_edid(struct drm_connector *connector, in drm_get_override_edid()
2180 struct edid *override = NULL; in drm_get_override_edid()
2196 int drm_edid_override_set(struct drm_connector *connector, const void *edid, in drm_edid_override_set() argument
2201 if (size < EDID_LENGTH || edid_size(edid) > size) in drm_edid_override_set()
2206 ret = drm_connector_update_edid_property(connector, edid); in drm_edid_override_set()
2222 * drm_add_override_edid_modes - add modes from override/firmware EDID
2225 * Add modes from the override/firmware EDID, if available. Only to be used from
2227 * failed during drm_get_edid() and caused the override/firmware EDID to be
2234 struct edid *override; in drm_add_override_edid_modes()
2243 DRM_DEBUG_KMS("[CONNECTOR:%d:%s] adding %d modes via fallback override/firmware EDID\n", in drm_add_override_edid_modes()
2286 static struct edid *_drm_do_get_edid(struct drm_connector *connector, in _drm_do_get_edid()
2292 struct edid *edid, *new; in _drm_do_get_edid() local
2295 edid = drm_get_override_edid(connector, &alloc_size); in _drm_do_get_edid()
2296 if (edid) in _drm_do_get_edid()
2299 edid = kmalloc(alloc_size, GFP_KERNEL); in _drm_do_get_edid()
2300 if (!edid) in _drm_do_get_edid()
2303 status = edid_block_read(edid, 0, read_block, context); in _drm_do_get_edid()
2305 edid_block_status_print(status, edid, 0); in _drm_do_get_edid()
2310 /* FIXME: Clarify what a corrupt EDID actually means. */ in _drm_do_get_edid()
2316 if (!edid_block_status_valid(status, edid_block_tag(edid))) { in _drm_do_get_edid()
2320 connector_bad_edid(connector, edid, 1); in _drm_do_get_edid()
2324 if (!edid_extension_block_count(edid)) in _drm_do_get_edid()
2327 alloc_size = edid_size(edid); in _drm_do_get_edid()
2328 new = krealloc(edid, alloc_size, GFP_KERNEL); in _drm_do_get_edid()
2331 edid = new; in _drm_do_get_edid()
2333 num_blocks = edid_block_count(edid); in _drm_do_get_edid()
2335 void *block = (void *)edid_block_data(edid, i); in _drm_do_get_edid()
2347 * If the first EDID extension is a CTA extension, and in _drm_do_get_edid()
2355 int eeodb = edid_hfeeodb_block_count(edid); in _drm_do_get_edid()
2360 new = krealloc(edid, alloc_size, GFP_KERNEL); in _drm_do_get_edid()
2363 edid = new; in _drm_do_get_edid()
2369 connector_bad_edid(connector, edid, num_blocks); in _drm_do_get_edid()
2371 edid = edid_filter_invalid_blocks(edid, &alloc_size); in _drm_do_get_edid()
2378 return edid; in _drm_do_get_edid()
2381 kfree(edid); in _drm_do_get_edid()
2386 * drm_do_get_edid - get EDID data using a custom EDID block read function
2388 * @read_block: EDID block read function
2392 * exposes a different interface to read EDID blocks this function can be used
2393 * to get EDID data using a custom block read function.
2399 * The EDID may be overridden using debugfs override_edid or firmware EDID
2401 * order. Having either of them bypasses actual EDID reads.
2403 * Return: Pointer to valid EDID or NULL if we couldn't find any.
2405 struct edid *drm_do_get_edid(struct drm_connector *connector, in drm_do_get_edid()
2414 * drm_edid_raw - Get a pointer to the raw EDID data.
2417 * Get a pointer to the raw EDID data.
2421 * Return: Pointer to raw EDID data.
2423 const struct edid *drm_edid_raw(const struct drm_edid *drm_edid) in drm_edid_raw()
2429 * Do not return pointers where relying on EDID extension count would in drm_edid_raw()
2432 if (WARN_ON(edid_size(drm_edid->edid) > drm_edid->size)) in drm_edid_raw()
2435 return drm_edid->edid; in drm_edid_raw()
2439 /* Allocate struct drm_edid container *without* duplicating the edid data */
2440 static const struct drm_edid *_drm_edid_alloc(const void *edid, size_t size) in _drm_edid_alloc() argument
2444 if (!edid || !size || size < EDID_LENGTH) in _drm_edid_alloc()
2449 drm_edid->edid = edid; in _drm_edid_alloc()
2458 * @edid: Pointer to raw EDID data
2459 * @size: Size of memory allocated for EDID
2461 * Allocate a new drm_edid container. Do not calculate edid size from edid, pass
2463 * of the raw EDID data against the size, but at least the EDID base block must
2470 const struct drm_edid *drm_edid_alloc(const void *edid, size_t size) in drm_edid_alloc() argument
2474 if (!edid || !size || size < EDID_LENGTH) in drm_edid_alloc()
2477 edid = kmemdup(edid, size, GFP_KERNEL); in drm_edid_alloc()
2478 if (!edid) in drm_edid_alloc()
2481 drm_edid = _drm_edid_alloc(edid, size); in drm_edid_alloc()
2483 kfree(edid); in drm_edid_alloc()
2491 * @drm_edid: EDID to duplicate
2502 return drm_edid_alloc(drm_edid->edid, drm_edid->size); in drm_edid_dup()
2508 * @drm_edid: EDID to free
2515 kfree(drm_edid->edid); in drm_edid_free()
2536 * drm_get_edid - get EDID data, if available
2540 * Poke the given I2C channel to grab EDID data if possible. If found,
2543 * Return: Pointer to valid EDID or NULL if we couldn't find any.
2545 struct edid *drm_get_edid(struct drm_connector *connector, in drm_get_edid()
2548 struct edid *edid; in drm_get_edid() local
2556 edid = _drm_do_get_edid(connector, drm_do_probe_ddc_edid, adapter, NULL); in drm_get_edid()
2557 drm_connector_update_edid_property(connector, edid); in drm_get_edid()
2558 return edid; in drm_get_edid()
2563 * drm_edid_read_custom - Read EDID data using given EDID block read function
2565 * @read_block: EDID block read function
2569 * exposes a different interface to read EDID blocks this function can be used
2570 * to get EDID data using a custom block read function.
2577 * The EDID may be overridden using debugfs override_edid or firmware EDID
2579 * order. Having either of them bypasses actual EDID reads.
2583 * Return: Pointer to EDID, or NULL if probe/read failed.
2590 struct edid *edid; in drm_edid_read_custom() local
2593 edid = _drm_do_get_edid(connector, read_block, context, &size); in drm_edid_read_custom()
2594 if (!edid) in drm_edid_read_custom()
2600 drm_edid = _drm_edid_alloc(edid, size); in drm_edid_read_custom()
2602 kfree(edid); in drm_edid_read_custom()
2609 * drm_edid_read_ddc - Read EDID data using given I2C adapter
2613 * Read EDID using the given I2C adapter.
2615 * The EDID may be overridden using debugfs override_edid or firmware EDID
2617 * order. Having either of them bypasses actual EDID reads.
2624 * Return: Pointer to EDID, or NULL if probe/read failed.
2646 * drm_edid_read - Read EDID data using connector's I2C adapter
2649 * Read EDID using the connector's I2C adapter.
2651 * The EDID may be overridden using debugfs override_edid or firmware EDID
2653 * order. Having either of them bypasses actual EDID reads.
2657 * Return: Pointer to EDID, or NULL if probe/read failed.
2668 static u32 edid_extract_panel_id(const struct edid *edid) in edid_extract_panel_id() argument
2683 return (u32)edid->mfg_id[0] << 24 | in edid_extract_panel_id()
2684 (u32)edid->mfg_id[1] << 16 | in edid_extract_panel_id()
2685 (u32)EDID_PRODUCT_ID(edid); in edid_extract_panel_id()
2692 * This function reads the first block of the EDID of a panel and (assuming
2693 * that the EDID is valid) extracts the ID out of it. The ID is a 32-bit value
2699 * assume that the EDID of the panel is correct, at least as far as the ID
2703 * be read the EDID, but there is no caching between them. Since we're only
2720 * the EDID then we'll just return 0. in drm_edid_get_panel_id()
2741 * drm_get_edid_switcheroo - get EDID data for a vga_switcheroo output
2747 * switch DDC to the GPU which is retrieving EDID.
2749 * Return: Pointer to valid EDID or %NULL if we couldn't find any.
2751 struct edid *drm_get_edid_switcheroo(struct drm_connector *connector, in drm_get_edid_switcheroo()
2756 struct edid *edid; in drm_get_edid_switcheroo() local
2762 edid = drm_get_edid(connector, adapter); in drm_get_edid_switcheroo()
2765 return edid; in drm_get_edid_switcheroo()
2770 * drm_edid_duplicate - duplicate an EDID and the extensions
2771 * @edid: EDID to duplicate
2773 * Return: Pointer to duplicated EDID or NULL on allocation failure.
2775 struct edid *drm_edid_duplicate(const struct edid *edid) in drm_edid_duplicate() argument
2777 return kmemdup(edid, edid_size(edid), GFP_KERNEL); in drm_edid_duplicate()
2781 /*** EDID parsing ***/
2784 * edid_get_quirks - return quirk flags for a given EDID
2785 * @drm_edid: EDID to process
2791 u32 panel_id = edid_extract_panel_id(drm_edid->edid); in edid_get_quirks()
2957 cb(&drm_edid->edid->detailed_timings[i], closure); in drm_for_each_detailed_block()
2991 /* EDID 1.4 defines this explicitly. For EDID 1.3, we guess, badly. */
2995 if (drm_edid->edid->revision >= 4) { in drm_monitor_supports_rb()
3002 return ((drm_edid->edid->input & DRM_EDID_INPUT_DIGITAL) != 0); in drm_monitor_supports_rb()
3083 const struct edid *edid = drm_edid->edid; in standard_timing_level() local
3085 if (edid->revision >= 2) { in standard_timing_level()
3086 if (edid->revision >= 4 && (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF)) in standard_timing_level()
3090 if (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF) in standard_timing_level()
3137 /* According to the EDID spec, the hdisplay = hsize * 8 + 248 */ in drm_mode_std()
3143 if (drm_edid->edid->revision < 3) in drm_mode_std()
3231 * EDID is delightfully ambiguous about how interlaced modes are to be
3273 * Create a new mode from an EDID detailed timing section. An EDID detailed
3366 mode->width_mm = drm_edid->edid->width_cm * 10; in drm_mode_detailed()
3367 mode->height_mm = drm_edid->edid->height_cm * 10; in drm_mode_detailed()
3378 const struct edid *edid, const u8 *t) in mode_in_hsync_range() argument
3383 if (edid->revision >= 4) in mode_in_hsync_range()
3386 if (edid->revision >= 4) in mode_in_hsync_range()
3395 const struct edid *edid, const u8 *t) in mode_in_vsync_range() argument
3400 if (edid->revision >= 4) in mode_in_vsync_range()
3403 if (edid->revision >= 4) in mode_in_vsync_range()
3411 range_pixel_clock(const struct edid *edid, const u8 *t) in range_pixel_clock() argument
3418 if (edid->revision >= 4 && t[10] == 0x04) in range_pixel_clock()
3429 const struct edid *edid = drm_edid->edid; in mode_in_range() local
3433 if (!mode_in_hsync_range(mode, edid, t)) in mode_in_range()
3436 if (!mode_in_vsync_range(mode, edid, t)) in mode_in_range()
3439 if ((max_clock = range_pixel_clock(edid, t))) in mode_in_range()
3444 if (edid->revision >= 4 && t[10] == 0x04) in mode_in_range()
3659 * Get established modes from EDID and add them. Each EDID block contains a
3667 const struct edid *edid = drm_edid->edid; in add_established_modes() local
3668 unsigned long est_bits = edid->established_timings.t1 | in add_established_modes()
3669 (edid->established_timings.t2 << 8) | in add_established_modes()
3670 ((edid->established_timings.mfg_rsvd & 0x80) << 9); in add_established_modes()
3720 * Get standard modes from EDID and add them. Standard modes can be calculated
3721 * using the appropriate standard (DMT, GTF, or CVT). Grab them from EDID and
3737 &drm_edid->edid->standard_timings[i]); in add_standard_modes()
3867 * @drm_edid: EDID block to scan
3882 (drm_edid->edid->features & DRM_EDID_FEATURE_PREFERRED_TIMING); in add_detailed_modes()
3911 * Search EDID for CEA extension block.
3913 * FIXME: Prefer not returning pointers to raw EDID data.
3921 /* No EDID or EDID extensions */ in drm_find_edid_extension()
3940 /* Return true if the EDID has a CTA extension or a DisplayID CTA data block */
4733 * Iterate through all CTA Data Blocks in both EDID CTA Extensions and DisplayID
4739 * cea_db_iter_edid_begin(edid, &iter);
4841 * - VESA E-EDID v1.4
4920 * the EDID CTA Extensions, then all the DisplayID CTA blocks. in __cea_db_iter_next()
4922 * Per DisplayID v1.3 Appendix B: DisplayID as an EDID in __cea_db_iter_next()
5003 * Get the HF-EEODB override extension block count from EDID.
5005 * The passed in EDID may be partially read, as long as it has at least two
5006 * blocks (base block and one extension block) if EDID extension count is > 0.
5013 * - HDMI 2.1 section 10.3.6 HDMI Forum EDID Extension Override Data Block
5015 static int edid_hfeeodb_extension_block_count(const struct edid *edid) in edid_hfeeodb_extension_block_count() argument
5020 if (!edid_extension_block_count(edid)) in edid_hfeeodb_extension_block_count()
5023 /* HF-EEODB is always in the first EDID extension block only */ in edid_hfeeodb_extension_block_count()
5024 cta = edid_extension_block_data(edid, 0); in edid_hfeeodb_extension_block_count()
5033 * Sinks that include the HF-EEODB in their E-EDID shall include one and in edid_hfeeodb_extension_block_count()
5034 * only one instance of the HF-EEODB in the E-EDID, occupying bytes 4 in edid_hfeeodb_extension_block_count()
5035 * through 6 of Block 1 of the E-EDID. in edid_hfeeodb_extension_block_count()
5106 /* Add 4:2:0(only) modes present in EDID */ in add_cea_modes()
5314 * drm_edid_get_monitor_name - fetch the monitor name from the edid
5315 * @edid: monitor EDID information
5320 void drm_edid_get_monitor_name(const struct edid *edid, char *name, int bufsize) in drm_edid_get_monitor_name() argument
5327 if (edid) { in drm_edid_get_monitor_name()
5330 .edid = edid, in drm_edid_get_monitor_name()
5331 .size = edid_size(edid), in drm_edid_get_monitor_name()
5355 * drm_edid_to_eld - build ELD from EDID
5357 * @drm_edid: EDID to parse
5359 * Fill the ELD (EDID-Like Data) buffer for passing to the audio driver. The
5385 eld[DRM_ELD_MANUFACTURER_NAME0] = drm_edid->edid->mfg_id[0]; in drm_edid_to_eld()
5386 eld[DRM_ELD_MANUFACTURER_NAME1] = drm_edid->edid->mfg_id[1]; in drm_edid_to_eld()
5387 eld[DRM_ELD_PRODUCT_CODE0] = drm_edid->edid->prod_code[0]; in drm_edid_to_eld()
5388 eld[DRM_ELD_PRODUCT_CODE1] = drm_edid->edid->prod_code[1]; in drm_edid_to_eld()
5471 * drm_edid_to_sad - extracts SADs from EDID
5472 * @edid: EDID to parse
5475 * Looks for CEA EDID block and extracts SADs (Short Audio Descriptors) from it.
5481 int drm_edid_to_sad(const struct edid *edid, struct cea_sad **sads) in drm_edid_to_sad() argument
5485 return _drm_edid_to_sad(drm_edid_legacy_init(&drm_edid, edid), sads); in drm_edid_to_sad()
5516 * drm_edid_to_speaker_allocation - extracts Speaker Allocation Data Blocks from EDID
5517 * @edid: EDID to parse
5520 * Looks for CEA EDID block and extracts the Speaker Allocation Data Block from it.
5527 int drm_edid_to_speaker_allocation(const struct edid *edid, u8 **sadb) in drm_edid_to_speaker_allocation() argument
5531 return _drm_edid_to_speaker_allocation(drm_edid_legacy_init(&drm_edid, edid), in drm_edid_to_speaker_allocation()
5565 * Convert raw EDID values to millisecond. in drm_av_sync_delay()
5601 * @edid: monitor EDID information
5605 * Drivers that have added the modes parsed from EDID to drm_display_info
5610 bool drm_detect_hdmi_monitor(const struct edid *edid) in drm_detect_hdmi_monitor() argument
5614 return _drm_detect_hdmi_monitor(drm_edid_legacy_init(&drm_edid, edid)); in drm_detect_hdmi_monitor()
5662 * @edid: EDID block to scan
5668 * audio' is not defined in EDID.
5672 bool drm_detect_monitor_audio(const struct edid *edid) in drm_detect_monitor_audio() argument
5676 return _drm_detect_monitor_audio(drm_edid_legacy_init(&drm_edid, edid)); in drm_detect_monitor_audio()
5773 * * Availability of a HF-VSDB block in EDID (check) in drm_parse_hdmi_forum_scds()
5805 DRM_DEBUG_KMS("hdmi_21 sink detected. parsing edid\n"); in drm_parse_hdmi_forum_scds()
5952 * See EDID extension for head-mounted and specialized monitors, specified at:
5953 …* https://docs.microsoft.com/en-us/windows-hardware/drivers/display/specialized-monitors-edid-exte…
6030 const struct edid *edid = closure->drm_edid->edid; in get_monitor_range() local
6047 if (edid->revision >= 4) { in get_monitor_range()
6140 /* A connector has no EDID information, so we've got no EDID to compute quirks from. Reset
6141 * all of the values which would have been set from EDID
6175 const struct edid *edid = drm_edid->edid; in update_display_info() local
6181 info->width_mm = edid->width_cm * 10; in update_display_info()
6182 info->height_mm = edid->height_cm * 10; in update_display_info()
6186 if (edid->revision < 3) in update_display_info()
6189 if (!(edid->input & DRM_EDID_INPUT_DIGITAL)) in update_display_info()
6196 * Digital sink with "DFP 1.x compliant TMDS" according to EDID 1.3? in update_display_info()
6198 * For such displays, the DFP spec 1.0, section 3.10 "EDID support" in update_display_info()
6199 * tells us to assume 8 bpc color depth if the EDID doesn't have in update_display_info()
6202 if (info->bpc == 0 && edid->revision == 3 && in update_display_info()
6203 edid->input & DRM_EDID_DIGITAL_DFP_1_X) { in update_display_info()
6210 if (edid->revision < 4) in update_display_info()
6213 switch (edid->input & DRM_EDID_DIGITAL_DEPTH_MASK) { in update_display_info()
6238 DRM_DEBUG("%s: Assigning EDID-1.4 digital sink color depth as %d bpc.\n", in update_display_info()
6241 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444) in update_display_info()
6243 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422) in update_display_info()
6373 * EDID spec says modes should be preferred in this order: in _drm_edid_connector_update()
6393 if (drm_edid->edid->features & DRM_EDID_FEATURE_DEFAULT_GTF) in _drm_edid_connector_update()
6424 const struct edid *old_edid = connector->edid_blob_ptr->data; in _drm_edid_connector_property_update()
6427 if (!drm_edid_are_equal(drm_edid ? drm_edid->edid : NULL, old_edid)) { in _drm_edid_connector_property_update()
6429 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] EDID changed, epoch counter %llu\n", in _drm_edid_connector_property_update()
6439 drm_edid ? drm_edid->edid : NULL, in _drm_edid_connector_property_update()
6443 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] EDID property update failed (%d)\n", in _drm_edid_connector_property_update()
6469 * drm_edid_connector_update - Update connector information from EDID
6471 * @drm_edid: EDID
6474 * properties, etc. from the passed in EDID.
6476 * If EDID is NULL, reset the information.
6489 * If override_edid is set, and the EDID passed in here originates from in drm_edid_connector_update()
6490 * drm_edid_read() and friends, it will be the override EDID, and there in drm_edid_connector_update()
6492 * to set the EDID dates back to a time when override EDID was not in drm_edid_connector_update()
6493 * handled at the low level EDID read. in drm_edid_connector_update()
6495 * The only way the EDID passed in here can be different from the in drm_edid_connector_update()
6496 * override EDID is when a driver passes in an EDID that does *not* in drm_edid_connector_update()
6498 * cached version. This, in turn, is a question of when an override EDID in drm_edid_connector_update()
6516 /* ignore requests to set edid when overridden */ in _drm_connector_update_edid_property()
6521 * Set the display info, using edid if available, otherwise resetting in _drm_connector_update_edid_property()
6539 * drm_connector_update_edid_property - update the edid property of a connector
6541 * @edid: new value of the edid property
6544 * connector's edid property.
6545 * Since we also parse tile information from EDID's displayID block, we also
6555 const struct edid *edid) in drm_connector_update_edid_property() argument
6560 drm_edid_legacy_init(&drm_edid, edid)); in drm_connector_update_edid_property()
6565 * drm_add_edid_modes - add modes from EDID data, if available
6567 * @edid: EDID data
6571 * can be derived from the edid.
6577 int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) in drm_add_edid_modes() argument
6581 if (edid && !drm_edid_is_valid(edid)) { in drm_add_edid_modes()
6582 drm_warn(connector->dev, "%s: EDID invalid.\n", in drm_add_edid_modes()
6584 edid = NULL; in drm_add_edid_modes()
6588 drm_edid_legacy_init(&drm_edid, edid)); in drm_add_edid_modes()
6593 * drm_add_modes_noedid - add modes for the connectors without EDID