Skip to content

drm/apple: don't offer PQ on firmware 27 panels - #3423

Merged
RyanTheTide merged 2 commits into
mainfrom
fix/dcp-fw27-no-pq
Nov 28, 2026
Merged

RyanTheTide merged 2 commits into
mainfrom
fix/dcp-fw27-no-pq

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What

Turning HDR on in GNOME on a K114s (T6050, firmware 27) makes the internal panel blinding ("flash-bang"): most of the desktop is clipped to white, and colour is left only in the darkest areas.

Measured on the K114s with flat full-screen greys from a small atomic KMS client (no compositor in the loop) and the ambient light sensor as the meter, the firmware 27 panel path has no PQ decode:

  • A surface tagged ST 2084 (xfer 16) is decoded with the sRGB curve, then scaled by about 10000/100. The light divided by sRGB(code) stays constant within 4% from code 16 to 192, and everything above about a quarter of the code range sits at the panel's peak, whatever the backlight level.
  • Every other transfer function value (0, 1, 2, 8, 13, 18) gives the plain sRGB decode at SDR white. PQ code 594 (203 cd/m²) shows at 0.296 × SDR white, which is sRGB(0.581).
  • The colour space (0, 2, 9, 12) changes nothing, and neither do the 47 bytes the firmware 27 surface adds after the common fields.

So no surface tag lets a PQ desktop show correctly on firmware 27. This change adds dcp_fw_panel_decodes_pq() and, on firmware 27 panels, stops advertising PQ: no EDR (dcp_panel_edr(), dcp_panel_edr_supported()), so no Colorspace and HDR_OUTPUT_METADATA properties, and no HDR static metadata in the panel's EDID. Compositors then keep the panel in SDR and don't offer the HDR switch. Desktop 26.x panels (J614s/J616s), which do decode PQ, don't change.

Showing HDR properly on firmware 27 needs a different mapping, for example decoding without the PQ tag and remapping through the output gamma table with EDR headroom, or whatever macOS 27 sends. That is follow-up work.

Tested

Tested: K114s (T6050, firmware 27) and J616s (M4 Pro, desktop 26.x) at 945fd32 (driver files as 7a8f8c9): K114s no HDR offered, SDR/P3/backlight unchanged; J616s HDR still offered and active, EDID byte-identical; 0 failed units; KUnit 372/373 + apple-dcp host tests 96/96.

  • KUnit (edr.kunitconfig: display tests + CONFIG_DRM_APPLE_KUNIT_TEST=y, arm64 QEMU): 373 tests, 372 passed, 1 skipped.
  • Measurements behind the change: K114s, lab kernel with runtime knobs for the PQ surface's transfer function, colour space and tail bytes (not part of this PR), plus the knob-free PQ map on the stock 7.3.0-42 kernel.

Risk: one-way · firmware 27 internal panels (T6050 K boards): HDR is no longer offered (it was unusable); SDR unchanged · desktop 26.x panels unchanged

Not yet

  • Ryan's veto window (ORCH5 approved 11-28 06:11 as a measured-capability change: PQ is withdrawn only where the firmware's surface path has no PQ decode).
  • Firmware 27 panels other than the K114s (J714s/J716c mini-LED) lose the HDR switch too; only the K114s was measured. Dj's J714s check (pqfill pq 128: near black = PQ decoded) decides whether this narrows to a per-panel check.
  • Real HDR on firmware 27 panels: follow-up (macOS 27 EDR swap capture, or the output gamma table).

Rows: K114s (batched with #3427) and J616s before/after (HDR unchanged) are posted below.

Turning HDR on in GNOME on a K114s (T6050, firmware 27) makes the
internal panel blinding, with most of the desktop clipped to white.

Measured on the K114s with flat full-screen greys and the ambient light
sensor, no compositor in the loop: a surface tagged ST 2084 is decoded
with the sRGB curve and then scaled by about 10000/100, so everything
above a quarter of the code range sits at the panel's peak.  Every other
transfer function value gives the plain sRGB decode at SDR white, and
the colour space doesn't change it.  Firmware 27 has no PQ decode on
this path, so a PQ desktop can't be shown correctly with any surface tag.

Add dcp_fw_panel_decodes_pq() and, on firmware 27 panels, stop
advertising PQ: no EDR (dcp_panel_edr(), dcp_panel_edr_supported()), so
no Colorspace and HDR_OUTPUT_METADATA properties, and no HDR static
metadata in the panel's EDID.  Compositors then keep the panel in SDR.
Desktop 26.x panels (J614s/J616s, which decode PQ) don't change.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

K114s row (M5 Pro, T6050, firmware 27), batched boot. Kernel 7.3.0-k114srow = main aa3351bc + #3427 (f4c4b038) + #3423 (7a8f8c9a), the K114s's own config, no extra kernel arguments, one-shot boot (default untouched). The panel was still being handed over at 60 Hz (state left by a macOS session), the case in which every boot of the current main crashes the internal DCP.

  • drm/apple: keep the refresh rate iBoot left the T6050 panel at #3427: the firmware logs update_rr_index syncrate 60 and the driver asks timing 3 → Already set to timingID: 3 colorID: 1. No DCP crash, apple-panel-bl present (set 200 → actual 200), eDP connected, GNOME greeter up, SELinux enforcing, 0 AVC denials. On main, the same handover gives hard_power_state 0 → shutdown_link → mode_set_gated ...@120 → DCP has crashed.
  • drm/apple: don't offer PQ on firmware 27 panels #3423: the eDP connector's properties are EDID, DPMS, TILE and vrr_capable only: no Colorspace, HDR_OUTPUT_METADATA or PQ_REFERENCE_LUMINANCE, so GNOME offers no HDR. EDID is 128 bytes with no extension block (no HDR static metadata), and the P3 primaries are still present. output_pq/output_edr 0.

Still to run: a 120 Hz handover on this head (after a cold boot) and the J616s row for #3423 (desktop 26.x, HDR must stay offered).

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J616s row (M4 Pro, desktop 26.x firmware, mini-LED panel with EDR), before/after. Kernel 7.3.0-j6row = main aa3351bc + #3427 (f4c4b038) + #3423 (7a8f8c9a), the J616s's fleet89 config trimmed to its loaded modules, one-shot boot, then a plain reboot back to fleet89 (verified, test files removed).

fleet89 (before) 7.3.0-j6row (after)
eDP connector props Colorspace, HDR_OUTPUT_METADATA, PQ_REFERENCE_LUMINANCE, vrr_capable same
EDID 256 bytes, 1 extension, sha256 77c02158cfc574a4… same bytes
Mutter supported colour modes [0, 2, 1] (BT.2100 offered) [0, 2, 1]
Current colour mode / EDR 1 (BT.2100), output_edr 1 1, output_edr 1
SELinux / failed units / DCP crashes Enforcing / 0 / 0 Enforcing / 0 / 0

HDR stays offered and active on the desktop 26.x panel, so the change only withdraws PQ where the firmware has no PQ decode (firmware 27). #3427 is inert here (only_120hz_modes is T6050-only; no rate line latched).

@RyanTheTide
RyanTheTide marked this pull request as ready for review November 27, 2026 19:44
@RyanTheTide
RyanTheTide requested review from a team as code owners November 27, 2026 19:44
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Non-author merge-train review at 7a8f8c9a: MERGE once CI is green (an interim, ORCH5-approved 06:11). Firmware-27 panels stop offering PQ and EDR output: dcp_fw_panel_decodes_pq() gates PQ_REFERENCE, the HDR metadata and output_edr. The comment gives the measured reason: on the K114s, a surface tagged ST 2084 is decoded with the sRGB curve ×100, so a PQ desktop clips. That's a firmware-version gate, which the no-gates rule asks us to avoid. It's accepted here as an interim with the measurement documented, and the follow-up is to key it on the EDR path's measured PQ capability. Rows: K114s (no flash-bang) and J616s before/after (HDR unchanged).

@DjDeveloperr code-owner ping (interim rule, point 6): I'll merge after 07:49 AEDT if CI is green, the App approves, and you have no objection. Ryan may veto the interim. Revert: git revert -m 1 <merge>.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: HOLD for hosted checks and the recorded code-owner wait. Approved the ORCH5-authorized interim.

Checked: The common panel PQ predicate gates EDID HDR metadata, HDR property exposure and the EDR path. It applies to the affected firmware interface across boards. The batched K114s row exercises the affected path and the J616s row verifies preservation of 26.x desktop HDR. Keep the documented follow-up to replace the interim firmware check with a measured EDR-path capability.

…entity units

The panel identity, j616s identity and colorimetry units extract
dcp_panel_edid_snapshot(), which now asks dcp_fw_panel_decodes_pq().
Stub it, and check that a firmware 27 panel with a peak gets no HDR
static metadata block.

Signed-off-by: Ryan Murray <[email protected]>

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: HOLD for hosted checks and the code-owner wait.

Checked: The new commit changes only the desktop selftest. The stub supplies the firmware PQ capability used by the extracted EDID helper, and the new case verifies that a firmware-27 panel with a nonzero peak omits the HDR extension. The existing HDR-positive control remains. The runtime delta and scope are the same as in the prior approval.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

host-tests fix pushed (945fd323): the apple-dcp panel identity, j616s identity and colorimetry units extract dcp_panel_edid_snapshot() and lacked a stub for the new dcp_fw_panel_decodes_pq(). Added it, plus a check that a firmware 27 panel with a peak gets the 128-byte EDID without the HDR block. Local apple-dcp suite: 96/96 ok. Test-only commit: the driver files the K114s and J616s rows ran are byte-identical.

@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:one-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Merge readiness at 945fd323: not ready yet

Check Detail
CI at head no failing: pr-text / pr-text, pr-text / pr-text
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at 945fd323
Conflicts ok none
PR text ok Risk: one-way · firmware 27 internal panels (T6050 K boards): HDR is no longer offered (it was unusable); SDR unchanged · desktop 26.x panels unchanged Not yet - Ryan's veto window (ORCH5 approved 11-28 06:11 as a measured-capability change: PQ is withdrawn only where the firmware's surface path has no PQ decode). - Firmware 27 panels other than the K114s (J714s/J716c mini-LED) lose the HDR switch too; only the K114s was measured. Dj's J714s check (pqfill pq 128: near black = PQ decoded) decides whether this narrows to a per-panel check. - Real HDR on firmware 27 panels: follow-up (macOS 27 EDR swap capture, or the output gamma table). Rows: K114s (batched with #3427) and J616s before/after (HDR unchanged) are posted below.

Areas: area:display

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 945fd3235666 as the ORCH5-approved interim, once the hosted checks are green, with one point recorded for the follow-up.

Blockers: none.

Point for Dj / the follow-up (not blocking): dcp_fw_panel_decodes_pq() is keyed on fw_compat == V_27_0, so it withdraws PQ/EDR from every firmware-27 internal panel, not only the K boards: the J714s/J716c (and J714c/J775c) mini-LED panels lose the HDR offer too. The no-PQ-decode measurement is from the K114s OLED only, and the v27 EDR model in iomfb_template.c came from Dj's macOS 27 trace on his M5 Pro. If HDR displayed correctly on a J714s under Linux before this, this change regresses it there. That is reversible (no crash, SDR unchanged), which is why I don't block the interim. @DjDeveloperr, one check on your J714s would settle it: is HDR offered and correct at main, and does it go away at this head? If it was correct, the follow-up should key on the measured capability (for example the panel path) rather than the firmware version.

Checked: read the whole diff; the predicate gates all three HDR exposures (EDID HDR static metadata, Colorspace/HDR_OUTPUT_METADATA via dcp_panel_edr_supported(), and dcp_panel_edr()), so a compositor can't half-enable PQ. Desktop 26.x is unchanged (J616s before/after table: same connector properties, byte-identical EDID, BT.2100 still active). 945fd323 is test-only over the rowed 7a8f8c9a. K114s row: no HDR offered, P3 primaries kept, backlight fine. No attribution.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Re the firmware 27 reach (J714s/J716c): right, the measurement is the K114s only. The firmware 27 surface path has no PQ curve there, and the decision is keyed on the firmware interface because the swap layout and the EDR model (dcp_edr_prepare_v27()) are shared by every firmware 27 panel. If HDR looked right on a J714s before this change, that contradicts the K114s measurement and the check should become per panel. A 2-minute check settles it: on any firmware 27 Mac, a flat PQ grey at code 128 (0.6 cd/m²) should be near black. Under the firmware path we have, it shows at about 1.5× SDR white. The tool is pqfill (atomic KMS, gdm stopped): pqfill pq 128 10 vs pqfill sdr 1023 10. Until then, a J714s with this change keeps SDR and its brightness and loses only the HDR switch.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merging under the 6-point rule (Ryan 09:29: kept permanently), at 945fd323.

  1. The review App approved at this head. Its verdict is MERGE as the interim, with no blockers.
  2. CI is green, including host-tests after the stub commit.
  3. K114s row: no HDR offer, P3 kept, backlight fine.
  4. J616s (desktop 26.x) before/after is unchanged.
  5. There's no blocking review. ORCH5 approved the interim (06:11), and Ryan may veto.
  6. Dj was pinged here at 06:44 AEDT with no objection.

Recorded follow-up (not blocking): the gate is keyed on firmware 27, so J714s/J716c/J714c/J775c lose the HDR offer too, and only the K114s was measured. It's reversible: SDR and brightness are unchanged. @DjDeveloperr, a pqfill pq 128 vs pqfill sdr 1023 check on your J714s settles whether it should become per panel.

Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit 9edf0b2 into main Nov 28, 2026
22 of 27 checks passed
@RyanTheTide
RyanTheTide deleted the fix/dcp-fw27-no-pq branch November 28, 2026 01:29
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Correction (post-merge): the measurement behind this change does not reproduce on today's K114s stack. With Ryan's current Stage 2 (aura b17 + aura#535, live-DCP hand-off) and the same stock kernel, PQ surfaces decode correctly on firmware 27 (PQ 128 near black, PQ 594 = 2.0× SDR white, highlights to the panel peak; lock-in ALS rows by the FW27-HDR lane). My map ran on an older b14-family Stage 2 after overnight macOS guest sessions. So this change now hides HDR that works; FW27-HDR is attributing the cause (Stage 2 vs panel state) and will revert this in its series.

RyanTheTide added a commit that referenced this pull request Nov 28, 2026
drm/apple: offer HDR on firmware 27 panels again (revert #3423)
RyanTheTide added a commit to AxxzyWasTaken/linux that referenced this pull request Nov 28, 2026
This reverts commit 9edf0b2
("Merge pull request aurora-silicon#3423 from aurora-silicon/fix/dcp-fw27-no-pq").

aurora-silicon#3423 hid the PQ/HDR switch on firmware 27 panels because an overnight
measurement on the K114s (T6050) showed ST 2084 surfaces decoded with
the sRGB curve.  That does not reproduce: with the current Stage 2 the
same firmware 27 panel decodes PQ as designed with the existing EDR
model (PQ code 128 = black, 594 = 2.0x SDR white = 203 nits, highlights
up to the panel peak), on both an unmodified 7.3.0-42 module and main.
FP16 extended-linear surfaces show EDR too (1.0 = SDR white, linear to
the panel peak).

So the panel EDR path is the same on firmware 26.6 and 27; drop the
firmware 27 exception.  Measurements (relative ambient-light lock-in,
fill vs black under the same tag): traces/display/20261128-fw27-hdr.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:display Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:one-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant