Repository navigation
drm/apple: accept ADT panel serials longer than 256 bytes - #3502
Conversation
Firmware 27 sends the internal panel's ProductAttributes without a serial number. dcp_panel_metadata_replace() took that record as the whole identity, so the serial hashed from the ADT's raw-panel-serial-number was dropped. The K114s (T6050) EDID then read model 0, serial "unspecified". On desktop 26.6 (J616s) the firmware reports its own serial, so it never showed there. Fill a missing serial from the ADT identity when the firmware names the same manufacturer and product and gives no text serial either. A serial the firmware does report still wins. Signed-off-by: Ryan Murray <[email protected]>
There was a problem hiding this comment.
Verdict: FINISH, then merge, at e9bde48b0789. The code is right; the two hardware rows from "Not yet" are what's left.
Before merge:
- K114s row at this head:
edid-decodeon eDP-1 shows the ADT-hash serial instead ofunspecified, 0 DCP crashes, panel + brightness as before. Please record the Stage 2 sha with it. - J616s inert row: serial stays
544655bb(the desktop 26.6 path returns before the ADT fill because the firmware gives a serial). - CI green at this head (all pending at 19:30).
Worth one line in Risk, not blocking: for an existing K114s/T6041 install the internal panel's identity changes once (serial unspecified -> hash). That means a new colord device id and a new GNOME monitors.xml key, so a user's saved scale/refresh for the built-in panel resets once after the update. That's expected and harmless, but users will notice it.
Checked:
- Match condition on the real machine:
ProductIDis parsed into a u16 (parse_metadata_number(..., 0, U16_MAX)), and on non-desktop firmwaredcp_panel_read_adt()seedsidentity.product = 0. The K114s EDID showsModel: 0, somerged.product == id->adt.product(0 == 0) andAPP==APPhold there, and the fill runs. A laptop panel whose firmware does send a nonzero ProductID gets no ADT serial, which is the old behaviour. - ADT source:
dcp-panel-adt.creadsraw-panel-serial-numberfrom/product(machines without/panel) and storesdcp_adt_serial()(a hash, not the raw serial). It is not a hard-coded value. - Precedence and stability: a firmware numeric or text serial wins (
!merged.serial && !merged.serial_text[0]). After the first fill,old->serialis the ADT hash, so a later serial-less ProductAttributes keeps it through the existingsame_serialmerge, with no flip-flop and no repeated hotplug. Hotplug is still queued only when the metadata really changes and no raw EDID exists. - KUnit reproduced locally (arm64 QEMU, display.kunitconfig + parser bounds, at e9bde48): 210 run, 209 passed, 1 skipped,
parser_panel_identity_adt_serialpasses. With dcp.c reverted to its parent and the test kept, it fails at parser-test.c:1771 (Expected id->metadata.serial == 0x1234abcdU), so the test covers the fix. - No per-board gating, no binding/DT change, no attribution.
|
Thanks. Per item:
Risk: added the one-time identity change (colord id / monitors.xml key) as you suggested. |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
This reverts commit e9bde48. On the K114s the panel identity never takes the firmware-metadata merge this changed: its EDID comes from the ADT identity directly (generation 0, no ProductAttributes replace), so the ADT serial was already the one used. The serial was missing because the ADT parser rejected the property itself; the next commit fixes that. Signed-off-by: Ryan Murray <[email protected]>
The K114s (T6050) /product raw-panel-serial-number property is 362 bytes, a string of serials. dcp_adt_panel_property() only took serial properties up to 256 bytes, so the K114s panel got no serial and its EDID read serial "unspecified". The J616s property is 170 bytes and was already taken. Accept serial properties up to 1024 bytes. Only their hash is used, so the size limit is a sanity bound. Panels whose serial was already read keep the same serial. Signed-off-by: Ryan Murray <[email protected]>
|
Correction, and a new head (a094059). The K114s row on bridge4 (7.3.0-k114sstack3, carrying e9bde48) FAILED: EDID still |
There was a problem hiding this comment.
Verdict: FINISH, then merge at a094059f
Blockers:
- Missing exact-head K114s hardware row at
a094059f(edid-decodeon eDP-1 showing the 8-hex-digit ADT-hash serial instead ofunspecified, 0 DCP crashes, panel + brightness unchanged, and Stage 2 SHA). - Wait for queued CI (
kunit,apple-build,host-tests,pr-text, KUnit matrix) andpr-readinessto complete green.
Checked:
- Code is clean and minimal (
+56/-1net after85b11c70revertse9bde48b): raising the serial-property length bound indrivers/gpu/drm/apple/dcp-panel-adt.c:109-115from256toDCP_ADT_SERIAL_MAX(1024) is safe —dcp_adt_serial()streams oversizebytes with no fixed buffer anddcp_adt_bytes()already bounds-checks against the ADT size. - Panels with
<= 256-byte serial properties (e.g. J616s at 170 B) take the identical code path and hash unchanged. parser_adt_long_serialKUnit test (drivers/gpu/drm/apple/parser-test.c:1777-1822) covers 170, 362, 1024 (accepted, nonzero, distinct) and 1025 (ignored = 0) and was shown to fail without the driver change.- No per-board/chip gating, no cmdline/module params, no Apple material, no AI attribution, no private serials, human
Signed-off-byon all commits, andRisk:documents theone-waycolord/monitors.xmlidentity transition.
Evidence
- Head:
a094059f7ef6(base: main,mergeable: MERGEABLE,+56/-1acrossdrivers/gpu/drm/apple/dcp-panel-adt.canddrivers/gpu/drm/apple/parser-test.c). - Inspected
dcp_adt_serial()anddcp_adt_bytes()indrivers/gpu/drm/apple/dcp-panel-adt.conmainto confirm streaming FNV-1a with no 256-byte stack/buffer assumption. - Author reported KUnit 344/345 pass (1 unrelated skip) at
a094059fwithparser_adt_long_serialfailing when thedcp-panel-adt.cchange is reverted.
|
K114s row at a094059's change: PASS. 2026-11-28 23:47, K114s (T6050), kernel 7.3.0-k114sstack (Ryan's v4) with a one-shot appledrm built from v4 + a094059's dcp-panel-adt.c change. The module also carries two lab knobs for an unrelated SDR measurement; they were at their inert default (-1) for this read. Stage 2 1.0.0b17-ge2a8cf96. eDP-1 EDID serial is now an 8-hex-digit ADT hash (both the numeric serial and the serial descriptor; previously |
|
Re blocker 1: the K114s row at a094059's change is posted above (2026-11-28 23:47): EDID serial = 8-hex-digit ADT hash on both the numeric serial and the descriptor (was |
|
code-owner ping <@422957901716652033> / @DjDeveloperr: merge train at |
There was a problem hiding this comment.
Verdict: MERGE at a094059f
Blockers: none. Both items from my FINISH verdict are met: the K114s row at this change and green hosted CI (apple-build, host-tests, kunit and pr-text all SUCCESS at a094059f).
Checked:
- The net diff is the bound only.
e9bde48bis reverted by85b11c70, sodcp.cis unchanged against main. The fix raises the/productraw-panel-serial-number/serial-numberlimit from 256 to 1024 bytes (DCP_ADT_SERIAL_MAX). - Memory safety at the larger bound:
dcp_adt_node()validates every property extent in its first pass (dcp_adt_bytes(c, ALIGN(size, 4))againstc->size) before the second pass handsprop + 36todcp_adt_panel_property(). So 1024 bytes can't read past the ADT buffer. There is no fixed-size copy: the bytes only go through the FNV hash, and the raw serial is never stored or logged. - No hard-coded hardware value: the 1024 bound is a sanity cap. The serial comes from the ADT (
/product/raw-panel-serial-number), and the 362/170-byte sizes appear only in a comment. - Regression: panels at 256 bytes or less take the identical path with the same hash (J616s 170 B,
544655bb:traces/display/20261128-k114s-3502-row/j616s-fleet89-before.txt). Properties above 1024 bytes are still ignored, as the test asserts. No per-board gating, no DT/binding change. - Test:
parser_adt_long_serialcovers 170/362/1024/1025 bytes, and the author reports it fails without the bound (seen[1] != 0). The 362 B case would be 0 under the old<= 256check, so the test does discriminate. - K114s row (
traces/display/20261128-k114s-3502-row/k114s-v4-sdrlab-a094059f.txt): v4 + a one-shot appledrm carrying exactly this hunk (lab params at the inert -1, build-id matched). The EDID serial is the 8-hex-digit ADT hash on both the numeric serial and the descriptor, 0 DCP crashes, backlight 1000/1000, 0 failed units. The before file showsunspecified. - Risk line present: the one-time colord /
monitors.xmlidentity change on existing K-board installs.
|
Merging under the 6-point rule (Ryan 09:29, permanent), at |
What
The K114s (T6050) internal panel publishes an EDID with serial
unspecified. The J616s (M4 Pro), our reference, publishes544655bb, the hash of its ADT panel serial.Both get the internal panel's identity from the ADT (
dcp_panel_read_adt()):/product/raw-panel-serial-numberis hashed into the EDID serial. The K114s property is 362 bytes (a string of serials).dcp_adt_panel_property()only took serial properties up to 256 bytes, so the K114s got none. The J616s one is 170 bytes and was already taken.Accept serial properties up to 1024 bytes. Only the hash is used, so the limit is a sanity bound. Panels whose serial was already read (J616s) keep the same value.
The first commit here (e9bde48, a firmware-metadata merge fill) was based on a wrong reading. On the K114s the EDID comes straight from the ADT identity (connection generation 0, no ProductAttributes replace), so that path never runs. It is reverted in 85b11c7; the net change is the parser bound only.
Tested
Tested: KUnit at a094059 (arm64 QEMU, 344/345, 1 unrelated skip). New
parser_adt_long_serial(synthetic 170/362/1024/1025-byte/productserials: nonzero distinct serials up to 1024, ignored above) fails without the dcp-panel-adt.c change (Expected seen[1] != 0U). K114s row at this head follows.unspecifiedwithusing firmware-derived EDID metadata for connection 0(generation 0 = ADT identity, never replaced). Walking the K114s runtime ADT (/dev/mtd2"adt") with the parser's rules:/productis at depth 1,raw-panel-serial-numberis 362 bytes, identical to the 11-27 dump (stable across boots). J616s runtime ADT: 170 bytes.544655bbis that hash).Risk: one-way · internal panels whose ADT panel serial is 257-1024 bytes (K114s; likely other T6050 K-boards): the EDID gains the ADT-derived serial (an FNV hash, the raw serial is never published). On an existing install the internal panel's identity changes once (serial
unspecified-> hash): a new colord device id and a new GNOMEmonitors.xmlkey, so saved scale/refresh for the built-in panel resets once after the update. Panels already reporting a serial are unchanged.Not yet
unspecified), 0 DCP crashes, panel + brightness as before.