Skip to content

drm/apple: qualify external SDR color and monitor EDID on J700 - #280

Closed
RyanTheTide wants to merge 10 commits into
test/t8140-external-public45from
test/t8140-external-output-qualification
Closed

RyanTheTide wants to merge 10 commits into
test/t8140-external-public45from
test/t8140-external-output-qualification

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

J700 external output selected BT.2020 for an SDR desktop, exposed timing/colour combinations the firmware marks unsafe, and reported an unknown monitor when DPAV did not announce its service. Prefer advertised sRGB/full-range modes, enforce per-timing restrictions, and restore bounded DPAV EDID handling.

When raw EDID is unavailable, expose a clearly marked firmware-derived base block containing the reported identity, primaries, gamma and validated preferred timing. Require complete data from the same initial connection; never use the derived block as a raw EDID cache entry or synthesize extra timings, audio, HDR, VRR or link capabilities. Route/cable loss invalidates this fallback. Serialize property/cache updates and defer commit-context cleanup through a persistent invalidation flag.

H17P advertises one byte after the aligned serialized object without sending it. Validate the entire object against delivered bytes, accepting only exact lengths or that observed framing convention. Reject missing values, transfer gaps and trailing objects. Perform the structural walk outside the metadata spinlock. Disabled tracepoints expose bounded wire and admission-state diagnostics without monitor contents.

Based on #278's working output path. Shutdown/reconnect qualification remains separate in #279. Independently authored public code uses owner-authorized audited hardware/protocol facts; no private implementation or firmware copied.

Validation:

  • Adversarial reviews drove fixes for inline sizing, opaque wire fields, metadata provenance, duplicate fields, explicit timing eligibility, property lifetime and lock ordering.
  • 153 binary-parser cases cover unsafe/DSC restrictions, malformed input, legacy behavior and high-refresh modes. 23 metadata cases plus independent edid-decode verify the derived block.
  • ASan/UBSan tests exercise actual production paths for concurrent probes, hotplug cleanup, blob readers, commit-context deferral, rapid reconnect, raw EDID precedence, complete property framing and truncation rejection. Four captured properties validate the one-byte convention; captured files and unique serials remain private.
  • Public b44fc82: full Clang/Rust kernel build passed without compiler warnings/errors; ARM64/QEMU Apple KUnit 37/37 passed.
  • R34 booted with both displays. GNOME now identifies Acer QG270 S3, exports a valid 128-byte derived EDID and automatically assigns an ICC profile with the reported primaries and gamma.
  • R32 baseline delivered 900 presentation-feedback frames in 15.146 seconds at 60 Hz and 1,178 in 10.295 seconds in a temporary 120 Hz trial. Kernel confirmed colour 80/sRGB/full-range/8 bpc at 120 Hz, then restored 60 Hz/colour 85/10 bpc. R34 frame regression passed: 911 feedback frames in 15.349 seconds at 60 Hz, 1,254 in 10.778 seconds at temporary 120 Hz, then 60 Hz restored with the Acer identity retained.

The public output diagnostic at 363fb57 checks actual connector placement and explicitly separates compositor feedback from physical scanout. It adds a bounded, attended grey/checkerboard comparison; no automated colour-accuracy claim is made.

Draft limits: owner reports badly washed-out/pastel colour on the external Acer only, including with monitor HDR Off. Colour qualification has failed and root cause remains under investigation. A reported detached/frozen reconnect and absent animation were confounded by the monitor selecting another computer; those physical-failure claims are withdrawn. Software reconnect passed, but correct-input physical reconnect remains unverified and monitor identity/profile loss after reconnect is confirmed. Raw DPAV service announcement remains absent; R33's initialized RX/TX rings were empty at timeout. Derived metadata is limited to the initial connection. Physical reconnect, DPMS, suspend and release qualification remain open. An earlier 180 Hz software presentation run is not a qualification: every 180 Hz colour candidate is marked unsafe on the current dock route. No release tag or merge is justified yet.

Colour follow-up: the generated profile has gamma 2.2 on every channel and no VCGT ramp. Current installed Mutter 51 uses default colour mode 0 on both outputs; matching upstream source selects sRGB/GAMMA22 for that mode. These checks do not establish physical colour accuracy or a driver fix. Attended gamma comparison remains pending.

Choose advertised full-range 8/10-bit SDR RGB modes for the experimental external H17P profile. Prefer sRGB or BT.709 over default RGB, then use firmware scores. Reject timings that only offer incompatible color modes instead of selecting BT.2020 for native SDR scanout. Leave internal and legacy policy unchanged.

The working J700 selected BT.2020 RGB while displaying an SDR desktop. Production-parser tests cover 65 valid, malformed, legacy and high-refresh cases. Hardware color appearance still requires qualification.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…alls

Use the external DPAV endpoint's inline framing with independent request length and response capacity. Validate actual service and EDID lengths before reading them, retain timeout ownership, and queue a connector reprobe when the service appears late. Preserve the legacy padded OOB path and EDID reader, and keep internal H17P excluded.

Host tests exercise the production sender, service envelope, EDID reader, ring admission and late notification with malformed replies and timeout cases. Hardware identity and color qualification remain pending.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Expose AFK headers before protocol decoding, submitted surface metadata, CTM values, and A423/A428 reply values through disabled-by-default tracepoints. Capture at most 32 received header bytes and do not dereference firmware-advertised addresses. Preserve all firmware requests and callback results.

Host tests exercise the actual trace assignments and callback continuation with zero/short/null and unaligned inputs. These observers support investigating the unqualified DPAV announcement and output-color behavior without changing protocol policy.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Treat the transport/interface/reserved header fields as opaque, matching captured firmware responses and the owned-DMA validator, while retaining identity, type, tag, category and payload-bound checks. Add an optional read-only ring snapshot at the DPAV announcement timeout; it does not consume data or send another command.

Host tests preserve response mismatch rejection, short-reply checks and timeout ownership, and verify the snapshot's enable, readiness, stop and pointer guards.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Exclude firmware-listed unsafe and DSC-required color IDs before choosing an external H17P SDR candidate. Read restrictions independently of property order and reject malformed or duplicate lists instead of silently treating them as empty. Preserve internal and legacy parsing.

The captured dock route permits 60 Hz at 10-bit and 120 Hz at 8-bit; its 144/180 Hz timings have no eligible nonvirtual SDR candidate after exclusions. This is metadata admission, not a new physical-link qualification or a global refresh cap.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…hment

Expose the firmware-reported identity, primaries and preferred timing while
raw DPAV EDID is unavailable on the experimental H17P external path. Keep
this synthetic base block out of the raw cache, require complete metadata
from the same initial connection, and invalidate it on route or cable loss.
Do not synthesize extra timings, audio, HDR, VRR or link capabilities.

Serialize EDID property and cache changes with connector probing. Defer
commit-context disconnect cleanup through a persistent invalidation flag,
so rapid reconnection cannot lose it or invert DRM modeset lock ordering.
Include bounded-parser, independent EDID decoding and concurrent lifetime
tests. Hardware qualification remains pending.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Record bounded connection tickets and validity flags while holding the
metadata lock. Trace initial association, property receipt and probing
to distinguish an ineligible connection from incomplete or rejected
metadata without logging monitor contents or weakening admission.

The tracepoint is disabled by default. Exercise the observation path in
the existing metadata lifetime test.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
H17P advertises one extra byte after the word-aligned serialized property,
but does not send that byte. Requiring received == advertised discarded
complete same-connection TimingElements and DisplayAttributes.

Validate the complete serialized object against bytes actually received.
Accept exact lengths or the observed one-byte framing convention only;
reject gaps, excess trailing content and truncated values. Perform the
bounded structural walk outside the metadata spinlock, then retain the
existing connection-ticket checks. No absent byte is used as payload.

Exercise captured property extents, truncation mutations and a missing
final string byte alongside metadata lifetime and decoder tests.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The frame test measures GTK/compositor feedback, which cannot prove the
monitor is showing the selected input or new scanout. Record the actual
GDK surface output and state the measurement scope explicitly.

Add a bounded manual grayscale comparison pattern to measure the output
midtone response without changing monitor settings or kernel controls.
Retain the existing moving pattern and feedback fields.

Generated-by: LLM
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Track placement in frame ticks, since the first static draw can precede fullscreen mapping. Retry drawing while placement differs from the requested output.

Generated-by: LLM

Assisted-by: LLM

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

This older SDR/EDID trial is superseded by the reviewed and merged corrections #289, #292 and #297. Colours and both EDID provider classes have been exercised on hardware. The historical source branch is retained; automatic PHY/PM qualification remains separate in #293.

@RyanTheTide
RyanTheTide deleted the test/t8140-external-output-qualification branch October 13, 2026 14:32
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