Repository navigation
drm/apple: give an external sink a firmware-derived EDID with what it reports - #2032
Conversation
… reports An external display on a T6050 or T6041 external DCP, or on T8140's, gets its EDID from the firmware's DisplayAttributes: the driver builds a base block from the sink's identity, size, colour description and preferred timing. Every one of those had to be present and in range, or the sink got no EDID at all. A sink that reports no image size, a name longer than a descriptor holds, an alphanumeric serial number that is empty, too long or not printable, a model year (week 255), no colour description, or a preferred timing faster than a detailed timing descriptor can hold (655.35 MHz) was left without one, so compositors listed it with an empty description and could not tell it apart from another. Require only the identity, the manufacturer and product code, as a sink's own EDID does, and leave the rest undefined when the firmware does not report it: - no image size: both size bytes 0; - no or an invalid colour description: the sRGB primaries, D65 and gamma 2.2, the panel path's fallback; - a name longer than 13 characters is cut to 13, as for the panel; no name gives a text descriptor instead of a name; - an alphanumeric serial number the parser cannot take is left out; the numeric serial number stays; - no ManufacturerID: it is taken from LegacyManufacturerID, as for the panel; - a missing or invalid manufacture date: week 0 and year byte 0 (1990), as EDID has no unknown year; week 255 stays a model year; - no preferred timing that fits a detailed timing descriptor: a dummy descriptor, without the preferred timing feature bit. The descriptor names a timing only: a polarity the firmware leaves out is given as positive, as the mode list stays authoritative. The preferred timing is now picked among the timings a descriptor holds, so a sink whose preferred timing is above 655.35 MHz gets the best-scored timing that fits instead of no EDID. The EDID is published once the identity is current; a timing is no longer required for it. The log line names what the parser found missing or out of range. On a J714s, a 1920x1280 display behind a Thunderbolt dock reports an alphanumeric serial number the parser refuses. It had no EDID and was listed without a name; it now gets a 128-byte EDID and is listed as "JTG S123". A 3840x2160 display that reports everything keeps the EDID it had. Signed-off-by: Diljit Singh <hey@djdev.me>
The previous commit makes an external sink's DisplayAttributes need only its identity. A size, colour description, date, name or serial number the firmware leaves out or reports out of range is noted in the metadata's defaults (DCP_METADATA_DEFAULT_*) and left undefined, and the EDID builder writes a dummy first descriptor when no detailed timing holds the preferred mode. The host units that compile parser.c and the EDID builder still modelled the old rules, so they no longer built or held: - The parser fixture takes the DCP_METADATA_DEFAULT_* values from dcp-display-metadata.h with the metadata struct. - The publication fixture's dcp_firmware_edid() stub takes the defaults argument, and dcp_metadata_timing_fits() is stubbed with the detailed timing's clock limit (655.35 MHz in 10 kHz steps). - metadata-decoder: a missing sync polarity now gives a positive one, and a mode no descriptor holds gives a dummy descriptor and no preferred timing, instead of no EDID. Its malformed inputs are split: a bad identity or a duplicated key is still refused with the output untouched; a bad or missing size, colour description or date parses with that default noted, its fields zero, and still builds an EDID; a name over 13 characters is cut to 13. No production code changes. Signed-off-by: Diljit Singh <hey@djdev.me>
e60adae to
1c0c9dd
Compare
|
Rebased onto current integration/aurora (a450ca0). The production commit is unchanged (same patch-id), now cf76b17. I've added one tools-only commit, 1c0c9dd, because the host units that compile parser.c and the EDID builder still assumed the old rules. It changes three things in
apple-dcp passed 88/88 in the CI container on integration + this change. |
|
Neo (J700, T8140) no-regression row on hardware, 2026-11-15:
Result: PASS, no T8140 regression found (internal panel, DCP, USB, Type-C, sleep). |
|
Note on the row above: it booted the PR's kernel commit as of e60adae. The merged kernel commit cf76b17 is the same change rebased (identical patch-id); the merged head's other commit, 1c0c9dd, touches only the host test tools/testing/selftests/drivers/gpu/apple-dcp/rate.py. So the result applies to the kernel change as merged. |
Part of a set of seven J714s external-display PRs, measured together (table below): #2032 EDID defaults, #2033 atc tunnel open, #2034 tunnel-only first (stacks on #1921), #2035 merged-mode limit, #2036 tunnel clock, #2037 DPTX connection DP IN and #2038 DP IN bandwidth allocation (merge those two together). Suggested order: #1921, #2006, then the set in any order.
What
One commit,
drm/apple: give an external sink a firmware-derived EDID with what it reports.An external display whose EDID the driver derives from the firmware's DisplayAttributes (T6050 and T6041 external DCPs, and T8140's) got no EDID at all unless the firmware reported every field: image size, a name that fits a descriptor, a readable alphanumeric serial number, a valid manufacture date, a colour description and a preferred timing that fits a detailed timing descriptor. Such a display showed up in compositors with an empty description.
Now only the identity (manufacturer and product code) is required, as in a sink's own EDID. The rest is left undefined when it is missing:
The preferred timing is picked among the timings a descriptor holds (a sink whose preferred timing is above 655.35 MHz gets the best-scored timing that fits), the EDID is published as soon as the identity is current (a timing is no longer required), and the log line names what the parser found missing or out of range. A colour description that parses but is rejected when the block is built (degenerate primaries) also falls back to sRGB without being named in the log.
The only changes from what ran in the kits: a comment moved to the function it describes, and the log line also names
serial. In the kits that bit was set for the JTG but not printed, so the line ended in an emptynot reported:.Stacking
None. This applies to integration/aurora alone and is independent of #1921 and #2006. In the kits it ran with them (see below).
Tested
On the J714s, the JTG S123 behind the dock reports an alphanumeric serial number the parser refuses:
edid_bytes=0), listed with an empty description;JTG S123. The kernel logsusing firmware-derived EDID metadata for connection 3; not reported:(withserialadded now).Compile: fedora-kcheck (cross build, M5 intg6 config): OK, vmlinux + Image + modules, 0 warnings. checkpatch --strict: 0 errors; its one warning is the From/Signed-off-by name mismatch these commits always have.
Rig and kits
J714s (MacBook Pro 14", M5 Pro):
Each kit was integration/aurora 514ae1f + #2006 (which carries #1921) + #2018 as it was at 0521255 (its earlier PHY-side version) + the changes up to that row. Built natively on the M5, one-shot test boot, read-outs only (sysfs, debugfs, kernel log,
hyprctl monitors), then the default kernel restored and verified byte-identical. Since 514ae1f, integration/aurora has gained only #2022, which touches none of these files. The k6 tree is the tree of all seven PRs of this set merged on #2006, apart from a diagnostic log commit used only in the kits and theserialkeyword added to one log line in the EDID PR.The internal panel ran at 3024x1964@120 in every row. k6 was read at about 60 s and 150 s after boot, with the same result both times, and with no oops, WARN, DART fault or GPU fault.
¹ The left-front port's PD controller came up late in that boot and the Dell never entered DP alt mode. None of these changes touch that path.
² In k2b the JTG was on DP-1 and the compositor ran it at 1920x1080; from k3 on it is DP-5 at its native 1920x1280.
Neo rows needed
Yes. T8140's external DCP derives its EDID the same way, so a display on the Neo's USB-C port goes through this code. That needs a Neo row (an external display's EDID name and mode, before and after) before merge. T6041 externals take this path too; they were not tested.
Not tested
parser_mode_testand the other display suites) was not run.🤖 Generated with Claude Code