Skip to content

drm/apple: give an external sink a firmware-derived EDID with what it reports - #2032

Merged
DjDeveloperr merged 2 commits into
integration/aurorafrom
djdev/t6050-external-edid-defaults
Nov 16, 2026
Merged

DjDeveloperr merged 2 commits into
integration/aurorafrom
djdev/t6050-external-edid-defaults

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • no image size: size bytes 0;
  • no or an invalid colour description: sRGB primaries, D65, gamma 2.2 (the panel path's fallback);
  • a name longer than 13 characters is cut to 13; no name gives a text descriptor instead;
  • an unreadable alphanumeric serial number is left out; the numeric serial stays;
  • no ManufacturerID: taken from LegacyManufacturerID, as for the panel;
  • a missing or invalid date: week 0 and year byte 0 (1990), as EDID has no unknown year (week 255 stays a model year);
  • no timing that fits a descriptor: a dummy descriptor, without the preferred-timing feature bit.

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 empty not 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:

  • stock: no EDID (edid_bytes=0), listed with an empty description;
  • with this change (k2b to k6): a 128-byte EDID, listed as JTG S123. The kernel logs using firmware-derived EDID metadata for connection 3; not reported: (with serial added now).
  • The Dell S2725QC reports everything and keeps the EDID it had on the stock kernel: 256 bytes, the same name, the same first detailed timing (3840x2160@60). The Odyssey G81SF, never connected on the stock kernel, has a 256-byte EDID with its name in k6.

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):

  • internal panel;
  • Dell S2725QC (3840x2160@120) on the left-front port, DP alt mode;
  • Thunderbolt 5 dock on the right port: JTG S123 (1920x1280@60) on DP IN 0, Samsung Odyssey G81SF (3840x2160, up to 240 Hz) on DP IN 1.

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 the serial keyword added to one log line in the EDID PR.

kit adds Dell (left-front) JTG (dock DP IN 0) G81SF (dock DP IN 1) DP IN 1 in the kernel log
stock (default kernel) 3840x2160@120 1920x1080@60, no EDID, no name dark
k2b EDID defaults, and an earlier tunnel clock restart not up in that boot ¹ 1920x1080@60 ², "JTG S123" dark 11 IRQ_HPD, 3 relinks, 5 failed paired mode sets
k3 + atc tunnel open, + tunnel-only first 3840x2160@120 1920x1280@60 dark 10 IRQ_HPD, 3 relinks, 4 failed paired mode sets
k4 + merged-mode limit 3840x2160@120 1920x1280@60 dark 8 IRQ_HPD, 3 relinks, 1 failed paired mode set
k5 + no paired call under the limit, + tunnel clock only for its link 3840x2160@120 1920x1280@60 dark 7 IRQ_HPD, 3 relinks, no failed paired mode set, no clock rate change
k6 + DPTX connection DP IN, + held CM Ack bandwidth allocation 3840x2160@120 1920x1280@60 3840x2160@120 no IRQ_HPD, no relink

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

  • KUnit (parser_mode_test and the other display suites) was not run.
  • A sink without a preferred timing that fits a descriptor (a dummy descriptor); none of the rig's displays has that case.
  • The notify now fires on DisplayAttributes alone. If the firmware sends them before the timing elements, the connector's hotplug work runs a second time for that connection. Nothing wrong was seen on the J714s rig, but watch for it in the Neo row.

🤖 Generated with Claude Code

… 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>
@DjDeveloperr
DjDeveloperr force-pushed the djdev/t6050-external-edid-defaults branch from e60adae to 1c0c9dd Compare November 16, 2026 02:00
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

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 tools/testing/selftests/drivers/gpu/apple-dcp/rate.py:

  • The parser fixture now takes DCP_METADATA_DEFAULT_*.
  • The publication fixture's dcp_firmware_edid() stub now takes the defaults argument, and dcp_metadata_timing_fits() is stubbed with the descriptor's clock limit.
  • metadata-decoder now follows the new rules. A missing sync polarity gives a positive one, and a mode no descriptor holds gives a dummy descriptor instead of no EDID. 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 and its fields zero, and still builds an EDID. An over-long name is cut to 13 characters.

apple-dcp passed 88/88 in the CI container on integration + this change.

@DjDeveloperr
DjDeveloperr merged commit c33c5fd into integration/aurora Nov 16, 2026
1 check passed
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Neo (J700, T8140) no-regression row on hardware, 2026-11-15:

  • Kernel: a one-shot test kit, 7.3.0-neo-m5prs1 = integration/aurora 07ade53 + drm/apple: give an external sink a firmware-derived EDID with what it reports #2032 (e60adae) + thunderbolt: run a T6050 host DP IN's bandwidth allocation as macOS does #2038 (40acc31), with the same config and toolchain as the Neo's current default kernel. It booted once; then the Neo went back to its default kernel, with a byte-identical undo verified.
  • Boot: desktop up, no failed units; the running kernel and its module build IDs match the kit.
  • Internal panel (eDP and its DCP): connected and enabled, with the same mode list, EDID and native mode as on the default kernel. No display/DCP warnings beyond those the default kernel logs.
  • USB, the r8152 Ethernet adapter and both Type-C ports came up. One sleep and wake: the panel came back in the same state, USB stayed in place (no re-enumeration), and the Ethernet carrier was back at the resume. No new USB, Type-C or Thunderbolt warnings.
  • Seen, but not from this change: two TLB-invalidation timeouts on the internal display's DART at desktop start. The same lines appear on Neo boots without this change, the shipped 7.3.0-40 kernel included.
  • Not exercised: no external display was attached, so the external-sink EDID path this PR changes did not run on the Neo.

Result: PASS, no T8140 regression found (internal panel, DCP, USB, Type-C, sleep).

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

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.

@RyanTheTide
RyanTheTide deleted the djdev/t6050-external-edid-defaults branch November 16, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant