Repository navigation
drm/apple: Offer internal-panel HDR only on panels with EDR headroom - #2694
RyanTheTide wants to merge 2 commits into
Conversation
Every internal panel on firmware 27 (and desktop 26.x) got a Colorspace and HDR_OUTPUT_METADATA property, and on firmware 27 a peak from the ADT's LmaxProduct, which also put PQ into the panel's EDID-equivalent metadata. The choice was made by firmware version alone, so an SDR panel such as the M4 Air's (525 nit LmaxProduct, no EDR headroom) showed an HDR switch in the desktop and could be driven into EDR it does not have. Take the decision from the machine instead: the ADT backlight node of an XDR panel carries EDRPotentialHeadroom above 1.0 (16.0 on the M1 Pro and M4 Pro), an SDR panel has none. The panel's EDR ceiling is now read on every firmware, and a panel without one gets no peak (neither from the ADT nor from res_max_panel_brightness()), no PQ metadata and no HDR connector properties. The firmware check stays only for what it really describes, the swap interface the EDR path is written for (dcp_fw_swap_has_edr()). Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Looks good; approve once a firmware-27 XDR panel row and the J615 row are in. I checked the decision path:
HW row: an XDR Mac with its panel on firmware 27 (for example an M1/M2 Pro/Max on 27.2) on fleet78 + this commit. Pass criteria: the eDP connector has Colorspace/HDR_OUTPUT_METADATA, the panel's EDID has PQ, the ADT peak is logged, and GNOME bt2100 on/off logs EDR on/off. This is the path this commit changes (peak from the ADT now gated on headroom), and the J616s row on desktop 26.x does not cover it. Also the queued J615 row: no HDR properties and no PQ on the internal panel, external HDR unchanged, plus 0 AVC, 0 failed units and 0 new kernel errors. Assisted-by: LLM (Claude:Opus 5.5) |
A panel without EDR headroom never gets a peak, so the EDR path does not run for it at all; say that rather than how dcp_edr_target() would treat a zero ceiling. Drop the per-model values from the ADT comment: the code does not depend on them. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Both nits fixed in ced0f42 (comments only, no code change). The J615 one-shot is queued on the J615. For the firmware-27 XDR panel row: none of our lab Macs has a panel on firmware 27 with headroom. The J616s runs desktop 26.x, and the M1 Pro's panel is removed. I'm asking for a row on an M5 Pro (fw27 XDR, the linux#1659 machine) with the pass criteria above. Assisted-by: LLM (Claude:Opus 5.5) |
|
J615 row (fleet78 + this change, one-shot): the internal panel no longer has Colorspace or HDR_OUTPUT_METADATA, its EDID has no HDR static metadata block, and GNOME offers only default and sdr-native. Before, fleet78 offered bt2100 and PQ, and logged Assisted-by: LLM (Claude:Opus 5.5) |
|
Merge-train adversarial review (MERGETRAIN-LINUX2) at ced0f42: NO BLOCKERS. Code read only, nothing built here. Before the merge it still needs Dj's verdict at this head; the missing rows are listed below. Full review#2694 drm/apple: Offer internal-panel HDR only on panels with EDR headroom @ced0f429VERDICT: NO BLOCKERS What I checked:
Nits:
Missing rows:
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial pre-PR checklist review at ced0f429efaa828400112b14b62256a36066dc52 (COMMENT — 0 code/policy/attribution blockers, holding only for missing §5 HW row(s)).
Checklist Summary
- §1 (No model gating): Pass — replaces the firmware-version-only panel HDR decision (
dcp_fw_compat_panel_edr()) with machine-reported ADTEDRPotentialHeadroomviadcp_panel_edr(). The remainingdcp_fw_swap_has_edr()(drivers/gpu/drm/apple/dcp-internal.h:1303-1307) describes the swap-record wire ABI (DCP_FIRMWARE_V_26_6_DESKTOP/DCP_FIRMWARE_V_27_0) rather than a board/panel gate. - §2 (No hacks / default cmdline): Pass.
- §3 (Safety / correctness): Pass — verified:
dcp_panel_read_adt()runs indcp_bind()(dcp.c:6461) before firmware start (res_max_panel_brightness()atiomfb_template.c:4713) and before connector creation (apple_connector_create()atapple_drv.c:1061).- Missing ADT or
EDRPotentialHeadroom <= 1.0yieldsedr_ceiling == 0(dcp-edr.h:41-46, no overflow onu32 -> u64), failing closed acrosspeak_nits, EDID PQ metadata (dcp.c:1474),dcp_panel_edr_supported()(iomfb.c:3201-3205), and connector HDR properties (dcp.c:4121-4127). - Pre-27 firmwares (12.3/13.5) remain unaffected because
dcp_fw_swap_has_edr()is false anddcp_edr_prepare*()only run on the desktop 26.x / fw27 paths. - External connectors (
USB,DisplayPort,HDMIA) are unchanged (apple_drv.c:995-1007).
- §4 (Clean-room & attribution): Pass — both commits (
46ff84f8,ced0f429) have human author/committer (Ryan Murray <ryan@aurorasilicon.org>) andSigned-off-by:only; PR body includesAssisted-by:; ADT numbers are our own machine readings. - §5 (Evidence): Incomplete — J615 (fw 27.2 SDR), J713 (fw 27.2 SDR + external DP-2 HDR), and J616s (desktop 26.x XDR) rows are complete; holding for the remaining HW row below.
- §6 (Naming): Pass.
- CI: 1/1 checks PASS (
host-tests).
Non-blocking Nits
drivers/gpu/drm/apple/dcp.c:1305still mentions(1600 nits on the M5 Pro)right below the comment tightened inced0f429.ced0f429is a comment-only fixup of46ff84f8and can be squashed if convenient.- On
V_27_0,peak_nitsis known at bind time;dcp_panel_edr()could optionally requirepeak_nitsas well so userspace never sees HDR properties ifLmaxProductis unusable (pre-existing behavior, still fails closed indcp_crtc_atomic_check()).
Remaining §5 HW Row(s) Before Approval
- Firmware-27 XDR internal-panel positive row (e.g., M5 Pro or M1/M2/M4 Pro XDR on fw 27.x), covering the exact path where
dcp->panel.edr_ceiling &&now gates the ADTLmaxProductpeak (dcp.c:1308): confirm eDPColorspace/HDR_OUTPUT_METADATApresent, EDID PQ present, ADT peak luminance logged, GNOMEbt2100EDR on/off working, and §5 regression checks (SELinux Enforcing, 0 AVC denials, 0 failed units, 0 new kernel errors). - (Optional/noted in PR) J616C (M4 Max, desktop 26.x) row once reported.
Assisted-by: LLM (Gemini 4 Neon)
|
Still needed: integration/aurora at daa9e2d decides internal-panel HDR by firmware version ( |
|
J616C (Apple MacBook Pro 16", M4 Max, T6041, desktop firmware 26.6.2 / XDR panel) read-only verification at exact head
Assisted-by: LLM (Google:Gemini 4 Neon) |
RyanTheTide
left a comment
There was a problem hiding this comment.
Independent source review at ced0f429efaa. EDR headroom is now a panel property and the remaining check selects the implemented swap interface. Please qualify a positive panel with headroom and the J413 negative control with the final #2951 connector logic in the same tree, checking that external PQ capability remains independent of internal-panel EDR.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR re-review at ced0f429efaa828400112b14b62256a36066dc52 against live integration/aurora (70a00e583b03).
Status & Code Assessment (0 code, CI, or attribution blockers)
- Not superseded: Live
integration/aurora(drivers/gpu/drm/apple/dcp.c:1308,4158,apple_drv.c:1058,iomfb.c:3206,iomfb_template.c:4718) still usesdcp_fw_compat_panel_edr()and gatesedr_ceilingby firmware version. - §1 No model gating: Pass — replaces the firmware-only internal-panel HDR decision with machine-reported ADT
EDRPotentialHeadroom(dcp_panel_edr()). The remainingdcp_fw_swap_has_edr()(dcp-internal.h:1299-1307) selects the swap-record wire ABI (DCP_FIRMWARE_V_26_6_DESKTOP/DCP_FIRMWARE_V_27_0), not a board or panel gate. - §2 Production-ready & §3 Safety: Pass —
dcp_panel_read_adt()runs indcp_bind()(dcp.c:6605) before firmware start (res_max_panel_brightness()) and connector creation (apple_connector_create()). Missing ADT orEDRPotentialHeadroom <= 1.0yieldsedr_ceiling == 0, failing closed acrosspeak_nits, EDID PQ metadata,dcp_panel_edr_supported(), and connector HDR properties while leaving external connectors (USB/DisplayPort/HDMIA) and pre-27 firmwares unchanged. - §4 Clean-room & attribution: Pass — both commits (
46ff84f8d7e5,ced0f429efaa) carry human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and humanSigned-off-by:only, zero AI trailers;Assisted-by:is in the PR body. - §6 Naming & Live CI: Pass —
host-testsis COMPLETED / SUCCESS onced0f429efaa. - Hardware rows verified so far: J615 (fw 27.2 SDR negative A/B + Enforcing/0 AVC/0 failed units), J713 (fw 27.2 SDR negative + external DP-2 HDR unaffected), J616s (desktop 26.x XDR positive + GNOME
bt2100toggle + Enforcing/0 AVC/0 failed units), and the newly posted J616C (M4 Max, desktop 26.6.2 XDR) exact-head row atced0f429efaa(16.0 headroom, 1600 nits peak,Colorspace/HDR_OUTPUT_METADATA/PQ_REFERENCE_LUMINANCE+ EDID ST2084, 0 failed units, 0 oops).
Blocker Holding APPROVE / MERGETRAIN-LINUX4
- §5 Firmware-27 XDR internal-panel positive row still missing: Both desktop 26.x XDR rows (J616s, J616C) exercise
res_max_panel_brightness(), not the firmware-27 ADTLmaxProductpeak path newly gated bydcp->panel.edr_ceiling &&(drivers/gpu/drm/apple/dcp.c:1315). Please post one positive firmware-27 XDR internal-panel row (e.g., M5 Pro/Max or M1/M2/M4 Pro XDR on fw 27.x) confirming eDPColorspace/HDR_OUTPUT_METADATApresent, EDID PQ present, ADT peak luminance logged,bt2100EDR toggle working, and §5 regression checks (0 SELinux denials, 0 failed units, 0 new kernel errors).
Non-blocking Nits (carried from earlier review)
drivers/gpu/drm/apple/dcp.c:1312still mentions(1600 nits on the M5 Pro)right below the comment tightened inced0f429, andced0f429is a comment-only fixup that can be squashed if convenient.
Assisted-by: LLM (Gemini 4 Neon)
Problem
The M4 Air (J713) and M3 Air (J615) show an HDR switch in the desktop for their built-in panel. Those are 500-nit SDR panels with no EDR headroom. The driver decided internal-panel HDR by firmware version (
dcp_fw_compat_panel_edr(): desktop 26.x or firmware 27). So every internal panel on firmware 27 got theColorspaceandHDR_OUTPUT_METADATAproperties. On firmware 27 it also got a peak luminance from the ADT'sLmaxProduct(525 nits on the Airs, just above their SDR maximum). That peak put PQ into the panel's HDR static metadata and turned on the EDR path.Change
Whether the panel can do EDR now comes from the machine. The ADT
backlightnode of an XDR panel carriesEDRPotentialHeadroom, and an SDR panel has none.dcp_panel_read_adt()already parsed it, but only on two firmware versions. It now reads it on every firmware:dcp_panel_edr()replacesdcp_fw_compat_panel_edr(). It returns true only if the panel has EDR headroom (EDRPotentialHeadroom above 1.0) and the firmware's swap interface carries EDR.res_max_panel_brightness()(desktop 26.x). So it gets no PQ metadata, no EDR path and no HDR connector properties.dcp_fw_swap_has_edr(), only describes the interface ABI the EDR path is written for (desktop 26.x, 27). It is no longer the panel decision.ADT values we read from our own machines:
Testing
Build: fleet78 + this commit (7.3.0-aurora-f4hdr, config byte-identical to fleet78) and the J713 bring-up kernel b7 + this commit; drm/apple builds without new warnings; checkpatch --strict clean.
Probes (read-only: eDP connector properties, the EDID HDR static metadata block, GNOME's colour modes = the desktop HDR switch):
panel peak luminance 525 nits (ADT)).panel EDR headroom up to 16.000andpanel peak luminance 1600 nitsare logged as before. Switching GNOME bt2100 -> default -> bt2100 logsEDR off without a mode set/EDR on without a mode set. The boot shows Enforcing, 0 failed units, 0 AVC, 0 kernel errors, 0 oops.Still to run
Reviewer detail
Before, the panel decision in
apple_connector_create()wasdcp_fw_compat_panel_edr(dcp), which is true forDCP_FIRMWARE_V_26_6_DESKTOP || DCP_FIRMWARE_V_27_0. Since firmware 27.2 maps the M1/M2/M3-class Macs toV_27_0, every one of their internal panels got HDR. On firmware 27,dcp_panel_read_adt()also setpeak_nitsfromLmaxProductwhenever it was aboveapple,max-brightness. On the Airs that is 525 > 500, which is enough fordcp_panel_edr_supported()and for the PQ static metadata indcp_panel_metadata(dcp.c).After:
dcp->panel.edr_ceiling = dcp_edr_ceiling(EDRPotentialHeadroom)on every firmware. A value that is missing or not above 1.0 gives 0.peak_nitsis set only whenedr_ceiling != 0, both from the ADT (fw27) and fromres_max_panel_brightness()(desktop 26.x).dcp_panel_edr(pdev)=dcp_fw_swap_has_edr(dcp) && dcp_has_panel(dcp) && edr_ceilingdecides whether the connector gets Colorspace/HDR_OUTPUT_METADATA.dcp_panel_edr_supported()(the EDR path) now also needsedr_ceiling.dcp_fw_swap_has_edr()is the swap-record ABI check: only the desktop 26.x and fw27 swap records have the EDR scale/headroom/limit fields (iomfb_template.h,iomfb_v27.h).The source is the runtime ADT the boot loader hands over (phram
adtregion, parsed bydcp-panel-adt.c). There is no per-board table. If a machine lacks the ADT region, the panel gets no HDR. That is the safe side.ADT backlight values, read from our own machines' ADT dumps:
Related: linux#1659 (fw27 panel EDR), linux#1424 (EDR without a mode set), linux#789 (J616s HDR), linux#1832 (27.2 -> V_27_0), linux#2087 (draft, touches the same fw27 peak block; small textual overlap).
Assisted-by: LLM (Claude:Opus 5.5)