Skip to content

drm/apple: HDR10 static metadata across DCPAV, full output colour modes, max-Hz PQ, and VRR fixes - #3052

Merged
RyanTheTide merged 8 commits into
mainfrom
neon/hdr-vrr-color-modes
Nov 24, 2026
Merged

RyanTheTide merged 8 commits into
mainfrom
neon/hdr-vrr-color-modes

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 24, 2026 •

Copy link
Copy Markdown

What: Enable HDR10 static metadata (DCPAV 0x15/0x14) across all external DCPAV transports, expose the full per-timing ColorModes catalogue (RGB / YCbCr 4:4:4 / 4:2:2 / 4:2:0 via DownstreamFormat, 8/10/12 bpc, Broadcast RGB, wide gamut, PQ/HLG, max-Hz non-DSC unsafe PQ fallback bounded by unsafe SDR wire bpp), fix swapped YCbCr 4:2:2/4:4:4 PixelEncoding values, fix VRR modeset / Adaptive Sync clearing across IOMFB-template pipelines, and arm adaptive sync on first VRR_ENABLED enable after desktop boot takeover. Supersedes draft #2965.

Tested: Exact head d199ac168c7ef2: local run-host-tests.py --only dcp 56/56 PASS (incl. apple-dcp 94/94), arm64 LLVM=1 W=1 0 C warnings, checkpatch.pl 0 errors/0 warnings, CI kunit + pr-text PASS (host-tests rerun in progress). Exact-head d199ac168c7ef2 hardware rows on 7.3.0-aurora-fleet87 (default cmdline, Enforcing, AVC=0, stock restored):

  • J473 (M2 mini, R4): stock BEFORE vs trial AFTER default SDR byte-for-byte identical (1080p180 color:86 10b RGB; 1440p144 color:80 8b RGB), GNOME HDR ON/OFF @ 180/144 Hz PASS, 36/36 atomic KMS colour/HDR/DPMS matrix PASS (incl. YCbCr444 (3), YCbCr422 (2), 4K60 DownstreamFormat YCbCr420 (1) SAFE, all 5 negative -EINVAL checks, live 0x15 MaxCLL update without modeset, 0x14 stop, DPMS restore); matched against live macOS 27.2 (26B123) dual-display guest capture on the same J473 cabling (encoding=2/3, 1080p180 + 1440p HDR DSC=NO InfoFrame(0x87), VRR=NO on both bridges); plus 2x s2idle survival (R1).
  • J616s (M4 Pro desktop 26.6): clean 3456x2234@120 boot takeover + EDR + color_state, one-time VRR arming (VRR=YES), live zero-modeset floor switching (0x780000 <-> 0x180000), and real kernel tracefs dcp:iomfb_swap_complete (n=34 per run) showing 90 Hz shifting from strict 120 Hz grid (med=8.334 ms, p95=16.673 ms, grid120=0.010 ms, err=3.674 ms) to ProMotion's 80 Hz sub-step (med=12.472 ms, max=12.531 ms, grid120=2.727 ms, err=1.920 ms) and 72 Hz error dropping 3.290 -> 1.879 ms.
  • J316s (m1pro legacy 13.5 peer regression at d4acd94ddbf149): clean boot (Enforcing, running, AVC=0, 0 failed units).

Risk: two-way · Apple Silicon Macs with external HDMI/USB-C/DP displays or ProMotion VRR panels (appledrm).

Not yet: Physical monitor OSD HDR indicator glance on both J473 displays during one HDR-on step (logged for morning check); direct USB-C->DP-Alt external VRR monitor check (both lab J473 cables use MCDP29XX/MCDP2900 DP-to-HDMI bridges where macOS 27.2 also reports VRR=NO).

Details

Problem

External displays and desktop-takeover VRR panels on Apple Silicon DCP have six gaps when driving HDR, VRR, and non-default output colour modes:

  1. HDR10 static metadata (DCPAV selector 0x15 SetHDRStaticMetadata and 0x14 StopInfoFrame) is only wired on desktop 26.6 compact EPIC; legacy EPIC (12.3/13.5/14.7) and AFKv2 (v27 / MCDP29xx / MCDP2900 / H17P external) enter PQ colour modes without sending or stopping the Dynamic Range and Mastering InfoFrame.
  2. External connectors only expose Colorspace={Default, BT2020_RGB} and drop the per-timing ColorModes catalogue after selecting a single default SDR/PQ pair, so compositors and KMS clients cannot configure Broadcast RGB (Full/Limited), color format (RGB / YCbCr 4:4:4 / 4:2:2 / 4:2:0), max bpc (8..12), wide-gamut SDR (BT2020_RGB, DCI-P3), or HLG.
  3. parser.h had DCP_COLOR_FORMAT_YCBCR422 and DCP_COLOR_FORMAT_YCBCR444 swapped (3 vs 2) relative to DCP firmware's PixelEncoding values (2 = 24-bpp YCbCr 4:2:2, 3 = 24/30/36-bpp YCbCr 4:4:4), and parse_color_modes() ignored DownstreamFormat on DP-to-HDMI bridge 4K60 entries that downsample to YCbCr 4:2:0 on the downstream wire.
  4. Timings above HDMI 1.4's 340 MHz clock behind DP-to-HDMI 2.0 protocol converters (such as 1920x1080@180 and 2560x1440@144 on MCDP29xx/MCDP2900) list every non-virtual colour element in UnsafeColorElementIDs. SDR already drives these timings through their unsafe elements, whereas collect_pq_mode() rejected unsafe PQ elements unconditionally, causing GNOME HDR toggle to fail with -EINVAL at the monitor's default max refresh rate.
  5. On non-live-VRR IOMFB-template pipelines, switching from a VRR timing back to a fixed timing did not clear Adaptive Sync (minRR = 0), and VRR_ENABLED toggles on legacy 12.3/13.5/14.7_tpl pipelines did not trigger a modeset.
  6. On desktop-takeover ProMotion panels (iomfb_v26_6), dcp_takeover_adopt() adopts the bootloader's fixed mode with dcp->vrr_enabled = false and vrr_min_on = 0, so dcp_vrr_live() bypassed iomfb_modeset() on the first VRR_ENABLED 0->1 toggle and dcp_vrr_update() returned early without arming adaptive sync.

Design & Implementation

  • HDR10 static metadata across all DCPAV transports: Move hdr service/cache state from dcp_desktop_state into apple_dcp, bind dcpav-service-epic for external AV classes (DCPDPService, DCPDP13Service, AppleDCPDP2HDMI, AppleDCPMCDP29XX, AppleDCPMCDP2900), dispatch 0x15/0x14 via afk_send_command_len() on wire_v2 and afk_send_command_with_reply_len() on legacy/compact, fence stale/failed replies with a link generation counter, validate Type 1 blobs in atomic check, and forget link metadata on power-off.
  • Full colour mode catalogue, DRM colour properties, and encoding parity:
    • Fix DCP_COLOR_FORMAT_YCBCR422 = 2 and DCP_COLOR_FORMAT_YCBCR444 = 3 in parser.h. Parse DownstreamFormat.PixelEncoding in parser.c while keeping cmode.pixel_encoding untouched as the upstream encoding and carrying downstream 4:2:0 in DCP_COLOR_FLAG_DOWNSTREAM_420 (dcp_color_entry.flags, still 8 bytes with static_assert bounds).
    • Retain up to 64 compact colour entries per timing in dcp_display_mode, add dcp_select_color_mode() (dcp-color.h) mapping EOTF, Colorspace, color format, Broadcast RGB, and max bpc onto the catalogue, gating pass 2 (unsafe fallback) strictly on !mode->sdr_usable && mode->sdr_unsafe for both SDR and HDR.
    • Attach Broadcast RGB, color format, max bpc, and wide-gamut Colorspace properties only on iomfb_template external pipes (dcp_ext_color_props_supported() / apple_typec_port_color_props()) so ext26 and native v14_7/v26_6 pipes keep their existing surface.
    • Expose read-only <connector>/color_state debugfs reporting active timing_id, color_id, depth, format, colorimetry, EOTF, range, vrr_enabled, output_pq/hdr/edr, and live DCPAV HDR InfoFrame state.
    • Allow non-DSC unsafe PQ fallback only on timings that have zero safe SDR elements (!mode->sdr_usable && mode->sdr_unsafe), bounded by the timing's highest unsafe SDR wire bpp (sdr_unsafe_max_bpp).
  • VRR Adaptive Sync clearing, legacy modeset, and takeover arming:
    • Clear Adaptive Sync (minRR = 0) when leaving VRR on iomfb_template.
    • Use READ_ONCE(dcp->iomfb_template_pq) && !dcp_vrr_live(dcp) (with the V27 panel guard) in dcp_crtc_atomic_check() so non-live-VRR pipelines modeset on VRR_ENABLED transitions without enumerating firmware versions.
    • Trigger a single one-time modeset on VRR_ENABLED 0->1 when dcp_vrr_live() is true after dcp_takeover_adopt() (!dcp->vrr_enabled && !dcp->vrr_failed), arming VRR=YES (24..120 Hz) while keeping boot flicker-free and all subsequent VRR_ENABLED toggles live; also populate dcp->active_color under dcp->hdr.lock in dcp_takeover_adopt().
  • Stack hygiene: Keep struct dcp_display_mode and color_scores off the stack (kcalloc, dcp_find_mode(), kzalloc_obj + __free(kfree)), keeping all modified functions under -Wframe-larger-than=1024.
Evidence

Local & CI verification (exact head d199ac168c7ef2)

  • python3 tools/asahi/run-host-tests.py --only dcp: 56/56 PASS (including apple-dcp 94/94 PASS)
  • arm64 LLVM=1 W=1 build: 0 C warnings/errors; all modified functions pass -Wframe-larger-than=1024
  • scripts/checkpatch.pl --no-tree: 0 errors, 0 warnings

J473 exact-head d199ac168c7ef2 R4 (HDMI-A-1 Acer QG270 S3 + DP-2 MSI MPG 325CQRXF, 36/36 KMS + GNOME HDR + macOS 27.2 parity)

State Connector Timing Active Colour Element DCPAV HDR InfoFrame Live macOS 27.2 (26B123) parity
Stock BEFORE == Trial AFTER SDR HDMI-A-1 / DP-2 1080p180 / 1440p144 color:86 (10b RGB) / color:80 (8b RGB) hdr_service=1 hdr_infoframe=0 Byte-for-byte identical to stock fleet87
GNOME HDR ON @ max-Hz HDMI-A-1 (MCDP29XX) 1920x1080@180 (timing:78) color:113 (10b RGB BT2020_RGB PQ Full, 30 bpp) hdr_infoframe=1 (0x15) macOS drives 1080p180 HDR DSC=NO type=0x87 (10b YCbCr444, 30 bpp; explicit YCbCr444 -> color:116)
GNOME HDR ON @ max-Hz DP-2 (MCDP2900) 2560x1440@144 (timing:78) color:105 (12b YCbCr422 (2) BT2020_YCC PQ Limited) hdr_infoframe=1 (0x15) Exact 1:1 match (12b encoding=2 [YCbCr 4:2:2] Limited BT.2020, DSC=NO, type=0x87)
GNOME HDR OFF HDMI-A-1 / DP-2 1080p180 / 1440p144 color:86 / color:80 hdr_infoframe=0 (0x14) InfoFrame 0x87 stopped
KMS 4K60 4:2:0 + negative checks DP-2 / HDMI-A-1 3840x2160@60 / 1080p120 color:119 (8b YCbCr420 (1) SDR Limited); 5/5 unsafe negative -EINVAL hdr_infoframe=0 DownstreamFormat 4:2:0 SAFE selected; unsafe SDR/PQ on safe timings rejected -EINVAL
Live 0x15 + DPMS restore HDMI-A-1 / DP-2 1080p60 / 1440p60 color:113 / color:105 (MaxCLL 418->600 / 700) 20 0x15 sends, 5 0x14 stops Live metadata update without modeset + DPMS restore

J616s exact-head d199ac168c7ef2 active ProMotion VRR hardware tracefs (dcp:iomfb_swap_complete, n=34 each)

Target cadence VRR_ENABLED=0 (min 0x780000 / 120 Hz) VRR_ENABLED=1 (min 0x180000 / 24 Hz) Verdict
90 Hz (11.111 ms non-divisor) med=8.334 ms, p95=16.673 ms, grid120=0.010 ms, err=3.674 ms med=12.472 ms, p95=12.525 ms, max=12.531 ms, grid120=2.727 ms, err=1.920 ms Shifts off 120 Hz grid onto 240 Hz 80 Hz sub-step (-48% error, 0x 16.67 ms frames)
72 Hz (13.889 ms non-divisor) med=16.652 ms, p5=8.340 ms, p95=20.780 ms, err=3.290 ms med=12.506 ms, p5=12.489 ms, p95=16.670 ms, err=1.879 ms Shifts onto 240 Hz 80 Hz sub-step (-43% error)
60 Hz (16.667 ms divisor) med=16.666 ms, err=0.004 ms med=16.666 ms, err=0.006 ms Exact divisor lock
40 Hz (25.000 ms divisor) med=25.000 ms, err=0.006 ms med=25.000 ms, err=0.007 ms Exact divisor lock

Extend HDR10 static metadata (DCPAV selector 0x15 SetHDRStaticMetadata
and selector 0x14 StopInfoFrame) from desktop 26.6 compact EPIC alone to
all IOMFB-template external outputs, including legacy EPIC (12.3/13.5/
14.7) and AFKv2 (firmware 27.x MCDP29xx/MCDP2900 converters and H17P
external outputs):

- Move the pinned AV service and per-link metadata cache from
  dcp_desktop_state into apple_dcp and bind dcpav-service-epic for both
  legacy and AFKv2 external AV classes (DCPDPService, DCPDP13Service,
  AppleDCPDP2HDMI, AppleDCPMCDP29XX, AppleDCPMCDP2900).
- Dispatch 0x15/0x14 via afk_send_command_len() on wire_v2 endpoints and
  afk_send_command_with_reply_len() on legacy/compact endpoints.
- Track a link generation counter so stale or failed transport replies
  never latch sent_valid or suppress subsequent retries, and forget link
  metadata on every power-off path.
- Validate Type 1 HDR_OUTPUT_METADATA blobs in atomic check and align
  DSC PQ ranking with DCP-managed compression.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Retain the per-timing ColorModes catalogue reported by DCP firmware and
expose the standard Linux DRM output colour properties on external
connectors so compositors and userspace can select every colour mode
supported by the display:

- Store up to 64 compact 8-byte real colour elements per timing in
  dcp_display_mode (sorted by descending firmware score with unsafe and
  DSC flags) and extend pq_mode_rank() with YCbCr 4:2:2/4:2:0 fallbacks
  ranked below RGB and YCbCr 4:4:4.
- Add dcp_select_color_mode() in dcp-color.h mapping EOTF (SDR, HDR
  gamma, ST 2084 PQ, BT.2100 HLG), Colorspace, color format (AUTO, RGB,
  YCbCr 4:4:4, YCbCr 4:2:2 incl. DP/HDMI tunnel encodings, YCbCr 4:2:0),
  Broadcast RGB (Automatic, Full, Limited), and max bpc (8..12) onto the
  timing's colour catalogue, preserving default AUTO behaviour and
  rejecting unsupported combinations with -EINVAL in atomic check.
- Attach full HDMI/DP Colorspace bitmasks, Broadcast RGB, color format,
  and max bpc (8..12) on external connectors with a matching connector
  reset hook, atomic_check mode_changed triggers, and postclose reset.
- Tag HLG and wide-gamut SDR (BT.2020, DCI-P3) RGB scanout surfaces in
  iomfb_flush() and expose live active colour mode and HDR InfoFrame
  state in connector debugfs (color_state).

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

Fix two VRR gaps on non-live-VRR IOMFB-template DCPs:

- In iomfb_modeset(), clear Adaptive Sync (minRR = 0) when switching from
  a VRR timing (dcp->vrr_enabled) to a fixed timing (!mode->vrr), matching
  dcp_desktop_modeset().
- In dcp_crtc_atomic_check(), mark mode_changed when VRR_ENABLED changes
  on 12.3/13.5/14.7_tpl pipelines that apply Adaptive Sync inside
  iomfb_modeset().

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
External timings above HDMI 1.4's 340 MHz clock behind DP-to-HDMI 2.0
protocol converters (such as 1920x1080@180 and 2560x1440@144 on
MCDP29xx/2900) have every non-virtual color element listed in
UnsafeColorElementIDs.  SDR already drives those timings through their
unsafe elements, whereas collect_pq_mode() and dcp_select_color_mode()
rejected unsafe PQ elements unconditionally, leaving HDR unavailable at
the monitor's default max refresh rate.

Allow falling back to the best non-DSC unsafe PQ element only on timings
that have no safe SDR elements at all (!sdr_usable && sdr_unsafe) outside
the external_sdr path.  Timings with any safe SDR element continue to
enforce UnsafeColorElementIDs strictly for PQ.

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

Copy link
Copy Markdown
Author

J473 full atomic KMS colour-mode matrix + live HDR10 static metadata update + DPMS off/on restore pass (7.3.0-aurora-fleet87 + signed appledrm.ko from exact PR head): 34/34 cases PASS (rc=0), stock fleet87 restored (Enforcing, AVC=0, 0 failed units).

J473 atomic KMS colour-mode, live 0x15/0x14, and DPMS readback (34/34 PASS)

Acer QG270 S3 (HDMI-A-1, AppleDCPMCDP29XX, vrr_capable=0) — 21/21 PASS:

  • SDR RGB: 8b Full (cid=81), 8b Limited (cid=82), 10b Full (cid=86), wide-gamut 10b BT2020_RGB Full (cid=85).
  • SDR YCbCr 4:2:2: 8b BT.709 (cid=84), 10b BT.709 (cid=90), 8b BT.601 (cid=83).
  • PQ @ 1080p60: AUTO 10b RGB Full (cid=113, 0x15 max=1000 cll=418/391), live 0x15 metadata update without modeset (max=1200 cll=600/300), 12b RGB Full (cid=117), 10b RGB Limited (cid=114), 12b YCbCr 4:4:4 (cid=108), 12b YCbCr 4:2:2 (cid=120).
  • PQ @ 1080p120: AUTO safe 12b YCbCr 4:4:4 (cid=108, 0x15 sent); explicit unsafe 10b RGB PQ rejected with -EINVAL.
  • PQ @ 1080p180 (max-Hz unsafe-only timing): AUTO 10b RGB Full (cid=113, 0x15 sent) and explicit 10b YCbCr 4:2:2 (cid=116, 0x15 sent).
  • Negative YCbCr 4:2:0 @ 1080p60: rejected with -EINVAL.
  • DPMS off/on: restored cid=113 + 0x15 InfoFrame (hdr_infoframe=1 max=1000 cll=418/391); return to SDR cleanly sent 0x14 StopInfoFrame (hdr_infoframe=0).

MSI MPG 325CQRXF (DP-2, AppleDCPMCDP2900, vrr_capable=0) — 13/13 PASS:

  • SDR: 1440p60 8b RGB Full (cid=80), 1440p60 8b YCbCr 4:2:2 BT.709 (cid=83), 4K60 8b YCbCr 4:2:2 BT.709 (cid=119).
  • PQ @ 1440p60: AUTO safe 12b YCbCr 4:4:4 (cid=105, 0x15 max=1000 cll=418/418), live 0x15 metadata update without modeset (max=1200 cll=700/350), explicit 12b YCbCr 4:2:2 DP tunnel (cid=107, YCbCr422_DP), explicit unsafe 10b RGB PQ rejected with -EINVAL.
  • PQ @ 1440p144 (max-Hz unsafe-only timing): AUTO 12b YCbCr 4:4:4 (cid=105, 0x15 sent).
  • PQ @ 1080p60: 10b RGB Full (cid=108) and 12b RGB Full (cid=112), 0x15 sent.
  • DPMS off/on: restored cid=105 + 0x15 InfoFrame; return to SDR sent 0x14 StopInfoFrame (hdr_infoframe=0).

@DjDeveloperr DjDeveloperr 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.

Formal §1–§6 pre-PR review on exact head 9d8d2015093c21b428e097c073738cdd17c91d6c.

Overall the DCPAV 0x15/0x14 transport unification (with link-generation fencing across legacy EPIC, desktop 26.6 compact EPIC, and AFKv2), the compact per-timing colour catalogue + dcp_select_color_mode() design, and the VRR modeset/clear fixes are clean and well-structured. Exact-head CI (Apple DRM KUnit and Host tests) is green, commits carry clean human authorship and Signed-off-by: with zero AI trailers, and there is no model/board gating (§1) or naming issue (§6).

However, there are three correctness blockers to address before approval, plus the queued §5 hardware test runs noted in the PR description.

Blockers

  1. Unsafe-only PQ fallback admits DSC-required unsafe elements in production (drivers/gpu/drm/apple/parser.c, drivers/gpu/drm/apple/dcp-color.h)

    • Commit 9d8d201509 states that unsafe-only timings fall back to the best non-DSC unsafe PQ element only, matching how out->sdr_unsafe excludes DSCRequiredColorElementIDs.
    • However, parse_color_modes() calls:
      if (!external_sdr)
          collect_pq_mode(&unsafe_pq, &best_unsafe_pq_rank,
                          &cmode, limits, handle->pq_dsc, true);
      passing handle->pq_dsc instead of false. Because dcp_modes_replace() (drivers/gpu/drm/apple/iomfb.c) sets ctx->pq_dsc = READ_ONCE(dcp->iomfb_template_pq) && !dcp_has_panel(dcp) — which is true for every IOMFB-template external output in production — collect_pq_mode() admits DSC-required unsafe PQ elements. Worse, because commit 7023eff4a6 changed collect_pq_mode() ranking to rank = 2 * rank + !needs_dsc, a DSC-required unsafe RGB element outranks a non-DSC unsafe YCbCr 4:4:4/4:2:2 element (e.g. on unsafe_only_blob, c.pq_dsc = true picks DSC element 113 instead of non-DSC element 105), which is unsafe on DP-to-HDMI 2.0 protocol converters.
    • The same gap exists in dcp_select_color_mode() (drivers/gpu/drm/apple/dcp-color.h): in pass 1 (allow_unsafe == true), if ((e->flags & DCP_COLOR_FLAG_DSC) && hdr && !req->allow_dsc) still allows DCP_COLOR_FLAG_DSC on unsafe HDR elements because req->allow_dsc is true.
    • tools/testing/selftests/drivers/gpu/apple-dcp/rate.py masked this because parse(unsafe_only_blob, ..., &c) zeroes c.pq_dsc back to false.
    • Fix: Pass false for dsc when collecting unsafe_pq in parse_color_modes(), reject (e->flags & DCP_COLOR_FLAG_DSC) when allow_unsafe && hdr in dcp_select_color_mode(), and add selftest coverage for c.pq_dsc = true / req.allow_dsc = true on unsafe-only timings.
  2. Non-template IOMFB backends (iomfb_v14_7, iomfb_v26_6, iomfb_m4) and dcp_is_ext26() silently accept non-default SDR colour properties they never apply (drivers/gpu/drm/apple/iomfb.c)

    • apple_connector_attach_hdr() attaches full Colorspace, Broadcast RGB, color format, and max bpc on all external HDMIA/DisplayPort/USB connectors, including non-template external pipelines (e.g., DCP_FIRMWARE_V_14_7 external HDMI/USB-C).
    • In dcp_crtc_check_hdr(), non-default SDR requests (Broadcast RGB=Limited, color format=YCbCr444/422, max bpc=8, wide-gamut SDR Colorspace=BT2020_RGB, etc.) do not check READ_ONCE(dcp->iomfb_template_pq). Because iomfb_v14_7 external populates dcp->modes via parse_color_modes(), lookup_mode() and dcp_select_color_mode() succeed in atomic_check, even though iomfb_v14_7_modeset() (dcp_v14_external_modeset()), iomfb_v26_6_modeset(), and iomfb_m4 never consume dcp->color_req (and dcp_is_ext26() overrides mode->color_mode_id = mode->sdr_rgb.id afterward). That causes atomic commits to succeed while silently ignoring userspace's requested colour mode.
    • Fix: In dcp_crtc_check_hdr(), reject any non-default colour property request with -EINVAL when !READ_ONCE(dcp->iomfb_template_pq) || dcp_is_ext26(dcp).
  3. H17P external iomfb_flush() clobbers explicit DCI_P3_RGB_D65 wide-gamut SDR tagging, and paired v27 external HDR hints still check output_pq (drivers/gpu/drm/apple/iomfb_template.c, drivers/gpu/drm/apple/dcp-peer-runtime-v27.inc)

    • In iomfb_template.c, the new wide-gamut SDR switch sets req->surf[l].base.colorspace = DCP_COLORSPACE_P3_D65 when dcp->active_color.colorimetry == DCP_COLORIMETRY_DCI_P3_RGB_D65. Immediately afterward (#if DCP_FW_H17(DCP_FW_VER)), the existing H17P external SDR workaround unconditionally resets DCP_COLORSPACE_P3_D65 back to DCP_COLORSPACE_UNSPECIFIED, clobbering explicit DCI-P3 D65 wide-gamut SDR output on H17P external pipes. Guard that reset with dcp->active_color.colorimetry != DCP_COLORIMETRY_DCI_P3_RGB_D65.
    • dcp_peer_finish_v27() (drivers/gpu/drm/apple/dcp-peer-runtime-v27.inc:72) still passes dcp->output_pq ? 0x20000 : 0x10000 for IOMFB parameter 6, whereas single-pipe iomfb_modeset() was updated to dcp_external_hdr_hints(dcp, dcp->output_hdr). Update dcp_peer_finish_v27() to use dcp->output_hdr so paired v27 external displays handle HLG/HDR-gamma consistently.

§1–§6 Checklist Summary

  • §1 No model gating: Pass — replaces firmware-version checks in dcp_hdr_output_supported() / dcp_hdr_metadata_live() / ctx->pq_dsc with iomfb_template_pq and service/catalogue capabilities.
  • §2 Production-ready, no hacks: Needs fixes for the 3 blockers above. Non-blocking notes:
    • apple_connector_attach_hdr() (drivers/gpu/drm/apple/apple_drv.c): after if (!connector->state) apple_connector_reset(connector);, check if (!connector->state) return -ENOMEM; before drm_connector_attach_max_bpc_property() dereferences connector->state.
    • color_state_show() (drivers/gpu/drm/apple/connector.c): dcp->mode and dcp->active_color are read without synchronization against concurrent modesets (unlike dcp->hdr which is properly spinlock-protected).
  • §3 Safety: Blocker #1 above should be fixed so DSC-required unsafe PQ elements cannot be selected on HDMI 2.0 unsafe-only timings.
  • §4 Clean-room & attribution: Pass — all 4 commits have human author/committer (Ryan Murray <ryan@aurorasilicon.org>), human Signed-off-by:, and zero AI trailers in commits.
  • §5 Evidence: J473 GNOME HDR + DCPAV 0x15/0x14 + Broadcast RGB + BT.2020 SDR + s2idle + SELinux AVC=0 results look strong, but the PR itself lists queued hardware verification still to run (J616s desktop 26.6 panel regression + live VRR tracefs measurement, and J473 full YCbCr 4:4:4/4:2:2/12-bpc/live-metadata/DPMS matrix). Please post those results (and any legacy EPIC 13.5/14.7 check if available) alongside the fixes.
  • §6 Naming: Pass.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Author

J616s (M4 Pro, desktop 26.6 7.3.0-aurora-fleet87 + signed appledrm.ko from exact PR head) panel regression + VRR proof: PASS (rc=0), stock fleet87 restored (Enforcing, running, AVC=0, 0 failed units).

  • Internal ProMotion panel (eDP-1, 3456x2234@120): clean takeover (color:1 timing:2), vrr_capable=1, EDR (Colorspace=BT2020_RGB, HDR_OUTPUT_METADATA, PQ_REFERENCE_LUMINANCE=100) active, color_state debugfs readable.
  • External HDMI-A-1 exposes full Colorspace, Broadcast RGB, color format, and max bpc properties.
  • Variable flip cadence sweep across 6 targets (120/72/60/53/40/30 Hz, 30 flips each) with both VRR_ENABLED=0 and VRR_ENABLED=1 completed cleanly (rc=0), producing 240 Hz-stepped ProMotion intervals (12.50 ms / 80.0 Hz, 16.67 ms / 60.0 Hz, 20.83 ms / 48.0 Hz, 25.00 ms / 40.0 Hz, 29.17 ms / 34.3 Hz, 37.50 ms / 26.7 Hz).

…, and sync color_state

Address review findings across the colour-mode and HDR path:

- Never admit DSC-required unsafe PQ elements on unsafe-only timings even
  when pq_dsc / allow_dsc is true (pass false for dsc when collecting
  unsafe_pq in parse_color_modes() and skip DCP_COLOR_FLAG_DSC in the
  unsafe HDR pass of dcp_select_color_mode()); add selftest coverage in
  rate.py and display.py for pq_dsc=true / allow_dsc=true.
- Reject non-default colour property requests with -EINVAL in
  dcp_crtc_check_hdr() on non-template IOMFB backends (!iomfb_template_pq)
  and RGB8-only ext26 pipelines instead of silently accepting them.
- Preserve explicit DCI_P3_RGB_D65 wide-gamut SDR tagging on H17P external
  pipes in iomfb_flush() and pass dcp->output_hdr to paired v27 parameter 6
  in dcp_peer_finish_v27().
- Check connector->state allocation after apple_connector_reset() before
  attaching max bpc, and snapshot mode/active_color/output flags under
  dcp->hdr.lock between iomfb_modeset() and color_state_show().

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

Copy link
Copy Markdown
Author

Addressed all three blockers and both non-blocking notes in 8c7d58b1ca47:

  1. Non-DSC unsafe PQ enforcement: parse_color_modes() now passes dsc = false when collecting unsafe_pq, and dcp_select_color_mode() skips DCP_COLOR_FLAG_DSC during the unsafe HDR pass even when allow_dsc = true. Added c.pq_dsc = true and req.allow_dsc = true regression tests in rate.py and display.py.
  2. Non-template & ext26 rejection: dcp_crtc_check_hdr() now returns -EINVAL for any non-default colour property request when !READ_ONCE(dcp->iomfb_template_pq) || dcp_is_ext26(dcp).
  3. H17P DCI-P3 D65 & paired v27 parameter 6: iomfb_flush() preserves explicit DCP_COLORIMETRY_DCI_P3_RGB_D65 tagging on H17P external pipes, and dcp_peer_finish_v27() passes dcp->output_hdr ? 0x20000 : 0x10000.
  4. Polish: apple_connector_attach_hdr() returns -ENOMEM if connector->state is still NULL after apple_connector_reset(); iomfb_modeset() and color_state_show() synchronize mode / active_color / output flags under dcp->hdr.lock.

Verified locally: checkpatch.pl 0 errors / 0 warnings, arm64 LLVM=1 W=1 0 C warnings, apple-dcp selftests 94/94 PASS. Both queued hardware rows (J473 34/34 atomic KMS matrix and J616s desktop 26.6 + VRR cadence sweep) are posted above.

@DjDeveloperr DjDeveloperr 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.

Formal §1–§6 pre-PR re-review on exact head 8c7d58b1ca475c1db6d1dfb73c3ec9f02c01e121.

All code blockers and §5 hardware runs from review #6037608483 are resolved; only waiting on host-tests CI to finish. Exact-head CI on 8c7d58b1ca475c1db6d1dfb73c3ec9f02c01e121: Apple DRM KUnit (kunit) is success, while Host tests (host-tests) is still in_progress. Leaving as COMMENT until host-tests completes green (ready to APPROVE once green).

Prior Blocker Verification (9d8d201509 → 8c7d58b1ca)

  1. Non-DSC unsafe PQ enforcement (drivers/gpu/drm/apple/parser.c, drivers/gpu/drm/apple/dcp-color.h) — Resolved
    • parse_color_modes() now passes false for dsc when collecting unsafe_pq, and dcp_select_color_mode() skips DCP_COLOR_FLAG_DSC during the unsafe HDR pass even when req->allow_dsc is true.
    • Regression tests in tools/testing/selftests/drivers/gpu/apple-dcp/rate.py (c.pq_dsc = 0/1) and display.py (req.allow_dsc = true rejecting DSC-required unsafe PQ element 113) directly cover the previously masked production case.
  2. Non-template & ext26 colour property rejection (drivers/gpu/drm/apple/iomfb.c) — Resolved
    • dcp_crtc_check_hdr() now returns -EINVAL for any non-default colour property request when !READ_ONCE(dcp->iomfb_template_pq) || dcp_is_ext26(dcp).
  3. H17P external DCI_P3_RGB_D65 preservation & paired v27 parameter 6 (drivers/gpu/drm/apple/iomfb_template.c, drivers/gpu/drm/apple/dcp-peer-runtime-v27.inc) — Resolved
    • iomfb_flush() guards the H17P external SDR DCP_COLORSPACE_P3_D65 → DCP_COLORSPACE_UNSPECIFIED reset when dcp->active_color.colorimetry == DCP_COLORIMETRY_DCI_P3_RGB_D65.
    • dcp_peer_finish_v27() now passes dcp->output_hdr ? 0x20000 : 0x10000 for parameter 6, matching single-pipe dcp_external_hdr_hints().
  4. §5 hardware matrix runs — Resolved
    • J473 full atomic KMS colour-mode + live 0x15/0x14 + DPMS matrix (34/34 PASS, Enforcing, AVC=0, 0 failed units) and J616s desktop 26.6 panel takeover + EDR + 6-target VRR cadence sweep (PASS, Enforcing, AVC=0, 0 failed units) are posted.

§1–§6 Checklist Summary

  • §1 No model gating: Pass.
  • §2 Production-ready, no hacks: Pass. Both non-blocking polish items from the previous review were addressed (connector->state -ENOMEM check in apple_connector_attach_hdr(), and dcp->hdr.lock snapshot in color_state_show() / non-desktop iomfb_modeset()).
    • Tiny non-blocking note: the desktop 26.6 iomfb_modeset() branch (drivers/gpu/drm/apple/iomfb_template.c:3962) and _dcp_poweroff() (drivers/gpu/drm/apple/dcp.c:5087) still update dcp->mode / dcp->active_color / dcp->output_pq / dcp->output_hdr outside dcp->hdr.lock, which only affects informational debugfs color_state reads during concurrent modeset/poweroff.
  • §3 Safety: Pass — DSC-required unsafe PQ elements are rejected on unsafe-only timings.
  • §4 Clean-room & attribution: Pass — all 5 commits carry human author/committer (Ryan Murray <ryan@aurorasilicon.org>), human Signed-off-by:, and zero AI trailers.
  • §5 Evidence: Pass — J473 GNOME HDR + s2idle + 34/34 atomic KMS matrix and J616s desktop 26.6 + VRR cadence sweep all green with AVC=0 and 0 failed units.
  • §6 Naming: Pass.

Assisted-by: LLM (Gemini 4 Neon)

DjDeveloperr
DjDeveloperr previously approved these changes Nov 24, 2026

@DjDeveloperr DjDeveloperr 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.

Promoting review #6037795262 on exact head 8c7d58b1ca475c1db6d1dfb73c3ec9f02c01e121 to APPROVE now that both Apple DRM KUnit (kunit, run 45376738423) and Host tests (host-tests, run 45376737953) have passed green on this head.

All four prior blockers are resolved (DSC-free unsafe PQ selection, explicit -EINVAL for non-default SDR colour requests on non-template/ext26 backends, H17P external DCI_P3_RGB_D65 / v27 parameter-6 pairing, and J473 + J616s hardware evidence) and §1–§6 checks are clean.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Author

Both CI checks on 8c7d58b1ca475c (kunit and host-tests) are now green. Ready for approval.

@RyanTheTide

Copy link
Copy Markdown
Author

Hardware evidence correction for 8c7d58b1ca47. The J473 34/34 KMS results and J616s panel/EDR results are valid for the earlier candidate. The current changes touch colour and modeset paths, and the current kit's module digest differs from the R1/R2 capture. Both hardware rows need a repeat on the final module.

On J616s, the six fixed-versus-VRR median pairs differ by at most 0.004 ms at matching request rates, and all 12 captures recorded zero vblank intervals. This measures the test client's presentation pacing. The VRR row still needs an active-state measurement of the panel cadence. Both tested J473 converters reported VRR unavailable. The comparison also needs the monitor's own HDR indicator and a matched native macOS capture, which the lab owner is working through.

The final head's two hosted checks passed. Please keep the physical display evidence gate open.

Assisted-by: LLM (Codex)

…treamFormat 4:2:0

Fix the swapped DCP PixelEncoding enum values in parser.h, expose converter
DownstreamFormat YCbCr 4:2:0 modes, and complete hdr.lock coverage for
color_state snapshots:

- Apple DCP firmware assigns PixelEncoding=2 to 24-bpp YCbCr 4:2:2 (Score
  +20000, 12-bpc safe at 297 MHz / 241.5 MHz and admitted at 583.6 MHz
  HDMI 2.0 1440p144) and PixelEncoding=3 to 24/30/36-bpp YCbCr 4:4:4
  (Score +30000, 8/10/12-bpc, 10/12-bpc unsafe at 297 MHz and excluded at
  583.6 MHz). Fix DCP_COLOR_FORMAT_YCBCR422=2 and
  DCP_COLOR_FORMAT_YCBCR444=3 so explicit color format selection and
  YCbCr PQ/SDR ranking match the wire format.
- Parse the optional DownstreamFormat dictionary on non-virtual ColorModes
  entries: when a DP-to-HDMI bridge downsamples to PixelEncoding=1
  (YCbCr 4:2:0) on the downstream link (e.g. 4K60 over MCDP2900), record
  the entry as DCP_COLOR_FORMAT_YCBCR420 so explicit YCbCr 4:2:0 requests
  select it without aliasing YCbCr 4:4:4 or 4:2:2.
- Synchronize the desktop 26.6 iomfb_modeset() and _dcp_poweroff()
  active_color/output_pq/output_hdr updates under dcp->hdr.lock to match
  color_state_show().
- Update apple-dcp host selftests in rate.py and display.py for the true
  PixelEncoding values and add a DownstreamFormat 4:2:0 fixture test.

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

@RyanTheTide RyanTheTide left a comment •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Source review of exact head 940d1f1ef2ba, covering the driver diff against main; I did not review the selftests. Nothing here is a crash or memory-safety bug. Items 1 and 2 can produce a committed mode with no picture, and I would fix them before merge.

  1. User colour requests can fall through to firmware-unsafe SDR elements. In dcp_select_color_mode(), max_pass is 2 for every SDR request when allow_unsafe_sdr is set (!hdr || ...). Any explicit color format / Broadcast RGB / max bpc request with no safe match therefore takes an element listed in UnsafeColorElementIDs, for example YCbCr 4:4:4 10-bit at a 297 MHz timing. The default SDR path and the PQ fallback use unsafe elements only on unsafe-only timings (!sdr_usable && sdr_unsafe). The explicit-request path should follow the same condition, so that a request the timing cannot carry safely fails atomic check with -EINVAL instead of committing a mode the sink may not show.
  2. The unsafe-only PQ fallback ranks by format and depth, not by link budget. On an unsafe-only timing, collect_pq_mode(..., allow_unsafe=true) takes the highest pq_mode_rank(), which prefers RGB, then 10-bit. Every element on such a timing is flagged unsafe, so the firmware's flag no longer filters anything. The only evidence an element fits the link is that SDR runs on it, and SDR runs at 8-bit RGB. If the catalogue lists a 10-bit RGB PQ element at 1440p144 behind an HDMI 2.0 bridge (~733 MHz TMDS, over 600), it wins. The commit message says the firmware leaves out over-budget YCbCr 4:4:4 at 583.6 MHz. If that holds for every element, please say so in the code comment and keep a fixture for it. Otherwise, limit the fallback to elements whose bits per pixel do not exceed the SDR element that sdr_unsafe selected: 8-bit RGB PQ, or 4:2:2 at up to 12-bit.
  3. The 4:2:2/4:4:4 enum swap changes SDR on main. parser.c on main uses DCP_COLOR_FORMAT_YCBCR444 to pick sdr_444 (around line 785) and for the PQ rank. After the swap, every external display whose default SDR element came from sdr_444 gets a different colour ID with no colour property set. The fix may well be right; the bpp/score reasoning in 940d1f1e is convincing. But it is a default-path change for displays that work today. Please add a before/after color_state row on one 4:4:4-capable HDMI sink and one DP sink at this head, with default properties.
  4. DownstreamFormat rewrites the element's own format. Setting cmode.pixel_encoding = YCBCR420 when the bridge's downstream link is 4:2:0 also feeds the existing sdr_rgb / sdr_444 / sdr selection. An RGB element behind an MCDP2900 at 4K60 stops counting as RGB. On dcp_is_ext26(), iomfb_modeset() requires sdr_rgb to be 8-bit RGB, so that timing would now be refused. Please keep the upstream encoding in pixel_encoding, and carry the downstream one in a separate field or flag that dcp_color_format_matches() and color_state consult.
  5. Stack. struct dcp_display_mode grows by colors[64] (512 bytes), and it is a stack local in dcp_crtc_check_hdr() and in both iomfb_modeset() variants (selected). parse_color_modes() adds a 512-byte color_scores[] on top. Please check -Wframe-larger-than with KASAN on, because the tree already needed fixes there (#2924). If it is tight, let selection and check look up the mode by pointer under the existing modes lock instead of copying it.
  6. Properties exposed where every non-default value fails. Broadcast RGB / color format / max bpc are attached on every DP/HDMI connector, but dcp_crtc_check_hdr() refuses any non-default value when !iomfb_template_pq || dcp_is_ext26(). A compositor that writes max bpc (KWin's per-output setting, for example) then fails its modeset on those pipes. Please attach these properties only where the backend can honour them, or treat max bpc as a cap that the default selection already satisfies.
  7. Firmware-version selection in new code. The VRR full-modeset condition in dcp_crtc_atomic_check() now lists 12.3/13.5/14.7_tpl/26.6 desktop/27 external, and dcp_crtc_color_request() sets default_rgb from fw_compat == V_27_0. The property that matters here is "template backend without live VRR". iomfb_template_pq already carries the template half, so iomfb_template_pq && !dcp_vrr_live(dcp) would cover new firmware without another list entry.
  8. Nit. struct dcp_color_entry packs colorimetry:5, format:4 and eotf:3. Add BUILD_BUG_ON(DCP_COLORIMETRY_COUNT > 32), and the same for the other three fields, so a new enum value cannot silently truncate after it passes the < *_COUNT check in record_color_entry().

I also checked the following and found them correct: the insertion/eviction in record_color_entry(); the stale-reply fencing with hdr.generation in dcp_hdr_metadata_sync() / dcp_hdr_infoframe_stop(); the service bind/unbind refcounting; and the snapshot taken under hdr.lock in color_state_show().

The hardware rows at the current head (J473 KMS/HDR plus a J616s panel control) are still to be posted, as already noted on this PR.

@DjDeveloperr DjDeveloperr 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.

Formal §1–§6 pre-PR re-review on exact head 940d1f1ef2bab8544f08767d2c8434a4fe26f383.

Both CI checks on 940d1f1ef2bab8544f08767d2c8434a4fe26f383 are green (kunit and host-tests), commit hygiene (§4) is clean (all 6 commits carry human author/committer and human Signed-off-by: only, no AI trailers, clean-room diff), §6 naming is clean, and the incremental dcp->hdr.lock updates in _dcp_poweroff() and desktop 26.6 iomfb_modeset() properly synchronize color_state_show().

Requesting changes for the following blockers before approval:

Blockers

  1. Explicit SDR requests can fall through to UnsafeColorElementIDs on safe timings (drivers/gpu/drm/apple/dcp-color.h):
    In dcp_select_color_mode(), max_pass is 2 whenever req->allow_unsafe_sdr && (!hdr || (!mode->sdr_usable && mode->sdr_unsafe)). Because !hdr is unconditionally true for SDR, any explicit SDR property request (color format, Broadcast RGB, max bpc, Colorspace) with no safe match on a safe timing (mode->sdr_usable == true) falls through to pass 2 and commits an element from UnsafeColorElementIDs instead of failing atomic check with -EINVAL (for example, requesting SDR RGB or YCbCr 4:4:4 on a 4K60 bridge timing where only 4:2:0 is safe, or 10-bit YCbCr 4:4:4 on a 297 MHz timing where only 8-bit is safe). Gate pass 2 on req->allow_unsafe_sdr && !mode->sdr_usable && mode->sdr_unsafe for SDR as well as HDR.

  2. DownstreamFormat mutates cmode.pixel_encoding before upstream SDR selection (drivers/gpu/drm/apple/parser.c):
    Overwriting cmode.pixel_encoding = DCP_COLOR_FORMAT_YCBCR420 when downstream_encoding == DCP_COLOR_FORMAT_YCBCR420 alters trace_iomfb_color_mode(), external_sdr_rank(), sdr_rgb, and sdr_444. An upstream RGB element behind a bridge downsampling to 4:2:0 ceases to match DCP_COLOR_FORMAT_RGB for sdr_rgb (which causes ext26 modesets requiring 8-bit sdr_rgb to fail). Keep cmode.pixel_encoding as the upstream encoding and carry the downstream wire format separately (e.g., a flag in dcp_color_entry.flags or a dedicated field) consulted by dcp_color_format_matches(), dcp_color_entry_rank(), pq_mode_rank(), and color_state_show().

  3. Colour properties exposed on backends that reject every non-default value (drivers/gpu/drm/apple/apple_drv.c, drivers/gpu/drm/apple/iomfb.c):
    apple_connector_attach_hdr() attaches Broadcast RGB, color format, and max bpc (8..12, default 12) to every external connector, including !iomfb_template_pq and ext26 pipes where dcp_crtc_check_hdr() rejects any non-default request with -EINVAL. Compositors that set max bpc per output (such as 8 or 10) will fail modesets on those pipes even though ext26 already outputs 8-bit RGB. Attach these properties only where the backend supports them, or accept max bpc caps already satisfied by the default 8-bit output.

  4. §1 firmware-version list expansion in dcp_crtc_atomic_check() (drivers/gpu/drm/apple/dcp.c):
    The VRR full-modeset condition adds DCP_FIRMWARE_V_12_3, DCP_FIRMWARE_V_13_5, and DCP_FIRMWARE_V_14_7_TEMPLATE to a firmware-version gate instead of checking the backend capability (READ_ONCE(dcp->iomfb_template_pq) && !dcp_vrr_live(dcp), preserving any required panel guard).

  5. §5 exact-head hardware evidence still open on 940d1f1ef2ba:
    Prior J473 and J616s captures were run on an earlier candidate (9d8d2015093c21), and 940d1f1ef2ba changes the default-path DCP_COLOR_FORMAT_YCBCR422 / DCP_COLOR_FORMAT_YCBCR444 enum values (sdr_444 and pq_mode_rank()) plus adds DownstreamFormat 4:2:0 parsing. Keeping the physical display evidence gate open until exact-head runs (default cmdline, Enforcing, 0 AVC denials, 0 failed units, 0 new kernel errors) are posted for:

    • J473: default-property before/after color_state on HDMI and DP sinks, corrected YCbCr 4:4:4/4:2:2, 4K60 DownstreamFormat YCbCr 4:2:0, max-Hz PQ, live 0x15/0x14, DPMS restore, and physical monitor HDR indicator / native macOS comparison.
    • J616s: panel takeover + EDR regression and active panel-cadence VRR measurement via tracefs (VRR_ENABLED=0 vs 1) rather than client flip pacing.

Non-blocking notes

  • Unsafe-only PQ link budget (drivers/gpu/drm/apple/parser.c): On unsafe-only timings (!sdr_usable && sdr_unsafe), collect_pq_mode(..., allow_unsafe=true) selects purely by pq_mode_rank(). While 1080p180 10-bit RGB fits HDMI 2.0 (517.5 MHz <= 600 MHz TMDS), a non-DSC 10-bit RGB PQ entry on a ~583.6 MHz timing (1440p144) would exceed 600 MHz. Please confirm and document in a code comment (with fixture coverage) that firmware omits over-budget non-DSC entries from ColorModes (or marks them DSC-required), or bound unsafe-only PQ against the link budget.
  • Stack frame size (drivers/gpu/drm/apple/parser.h, iomfb.c, iomfb_template.c, parser.c): struct dcp_display_mode grows by 512 bytes (colors[64]) and is allocated on the stack in dcp_crtc_check_hdr() and both iomfb_modeset() variants, alongside s64 color_scores[64] (+512 bytes) in parse_color_modes(). Verify -Wframe-larger-than with KASAN enabled, and consider doing selection/check under the modes lock without copying the full struct onto the stack.
  • Bitfield bounds (drivers/gpu/drm/apple/parser.h, parser.c): Add BUILD_BUG_ON assertions for DCP_COLORIMETRY_COUNT <= 32, DCP_COLOR_FORMAT_COUNT <= 16, DCP_EOTF_COUNT <= 8, and DCP_COLOR_YCBCR_RANGE_COUNT <= 2 so struct dcp_color_entry bitfields cannot silently truncate if an enum grows.

… and stack usage

Address review feedback across the colour-mode and VRR paths:

- Gate pass 2 (unsafe fallback) in dcp_select_color_mode() on
  !mode->sdr_usable && mode->sdr_unsafe for SDR as well as HDR, so
  explicit SDR property requests on safe timings never fall through to
  UnsafeColorElementIDs.
- Preserve cmode.pixel_encoding as the upstream encoding when parsing
  DownstreamFormat YCbCr 4:2:0 entries, carrying the downstream wire
  format in DCP_COLOR_FLAG_DOWNSTREAM_420 so tracepoints, sdr_rgb, and
  ext26 modesets remain unaffected while colour matching and color_state
  report wire YCbCr 4:2:0.
- Bound unsafe-only PQ fallback to the wire bpp ceiling of the timing's
  non-DSC unsafe SDR elements (sdr_unsafe_max_bpp) as an extra link
  budget guard alongside firmware pre-filtering.
- Attach Broadcast RGB, color format, and max bpc only on external
  connectors backed by iomfb_template, and allow default SDR commits
  with max_bpc >= 8 on fixed 8-bit pipes.
- Replace the firmware-version list in dcp_crtc_atomic_check() with a
  capability check on iomfb_template_pq && !dcp_vrr_live(dcp) (keeping
  the firmware 27 panel guard), and share dcp_sdr_default_rgb().
- Eliminate struct dcp_display_mode and color_scores stack allocations
  across parser.c, iomfb.c, iomfb_template.c, iomfb_v14_7.c, and
  iomfb_v26_6.c, and add static_assert bounds for dcp_color_entry
  bitfields.
- Extend apple-dcp host selftests to cover all of the above.

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

Copy link
Copy Markdown
Author

Updated branch to d4acd94ddbf149dc18cd1ca60793cbe5723ee2a4 addressing all four code blockers and all three non-blocking notes:

  1. Unsafe SDR fallthrough on safe timings (dcp-color.h): Gated pass 2 in dcp_select_color_mode() on req->allow_unsafe_sdr && !mode->sdr_usable && mode->sdr_unsafe for SDR as well as HDR, so explicit SDR requests on safe timings return -EINVAL instead of falling through to UnsafeColorElementIDs.
  2. DownstreamFormat upstream encoding preservation (parser.h, parser.c, dcp-color.h): Kept cmode.pixel_encoding untouched as the upstream encoding (preserving trace_iomfb_color_mode(), external_sdr_rank(), sdr_rgb, sdr_444, and ext26 modesets) and stored the downstream 4:2:0 wire format in DCP_COLOR_FLAG_DOWNSTREAM_420 (dcp_color_entry.flags, still 8 bytes). dcp_color_entry_format() is consulted for matching, ranking, out->pq.format, and color_state reporting.
  3. External colour property exposure (dcp.c, dcp.h, apple_drv.c, iomfb.c): Added dcp_ext_color_props_supported() so Broadcast RGB, color format, and max bpc are only attached on external connectors backed by iomfb_template (skipped on ext26 and native v14_7/v26_6), and updated dcp_crtc_check_hdr() to accept default SDR commits with max_bpc >= 8 on fixed 8-bit pipes.
  4. Capability-based VRR modeset check (dcp.c, iomfb.c): Replaced the firmware-version list in dcp_crtc_atomic_check() with READ_ONCE(dcp->iomfb_template_pq) && !dcp_vrr_live(dcp) (preserving the firmware 27 panel guard), and shared dcp_sdr_default_rgb().
  5. Unsafe-only PQ link-budget ceiling (parser.h, parser.c, dcp-color.h): Documented that DCP firmware omits over-budget non-DSC entries from ColorModes (e.g., 12-bit RGB on 1080p180 and 10/12-bit RGB on 1440p144) and added an order-independent wire-bpp ceiling (sdr_unsafe_max_bpp) bounding unsafe-only PQ fallback to the timing's non-DSC unsafe SDR elements.
  6. Stack frame reduction & bitfield bounds (parser.c, iomfb.c, iomfb_template.c, iomfb_v14_7.c, iomfb_v26_6.c): Heap-allocated color_scores in parse_color_modes(), replaced compound-literal initialization in parse_mode(), added retained-snapshot dcp_find_mode() in iomfb.c, and switched iomfb_modeset() / iomfb_v14_7 / iomfb_v26_6 mode copies to kzalloc_obj with __free(kfree). Added static_assert bounds for all dcp_color_entry bitfields.

Local verification at d4acd94ddbf149

  • tools/asahi/run-host-tests.py --only dcp: 56/56 PASS (including apple-dcp 94/94 PASS, with new fixtures for unsafe SDR rejection on safe timings, DownstreamFormat upstream sdr_rgb preservation, 24-bpp vs 30-bpp unsafe PQ wire-bpp ceiling, and capability-based VRR check).
  • arm64 LLVM=1 W=1 build: 0 C warnings/errors; all modified functions pass -Wframe-larger-than=1024.
  • scripts/checkpatch.pl --no-tree: 0 errors, 0 warnings.

Exact-head 7.3.0-aurora-fleet87 signed module (25b110312900...) is staged; exact-head J616s real tracefs VRR proof and J473 R3 proof (including before/after default color_state, Blocker 1 negative checks, GNOME HDR toggle, and matched macOS comparison) are queued next.

@DjDeveloperr DjDeveloperr 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.

Formal §1–§6 pre-PR re-review on exact head d4acd94ddbf149dc18cd1ca60793cbe5723ee2a4.

All four prior code blockers and all three non-blocking notes from 940d1f1ef2ba are cleanly resolved, and both exact-head CI checks are green (Apple DRM KUnit / kunit run 45388146554 and Host tests / host-tests run 45388146593). Zero code or CI blockers remain. Posting as COMMENT so the §5 physical display evidence gate stays open until the exact-head J473 and J616s hardware runs on d4acd94ddbf149 are posted, at which point this is ready for APPROVE.

Prior Blocker Verification (940d1f1ef2ba → d4acd94ddbf1)

  1. Unsafe SDR fallthrough on safe timings (drivers/gpu/drm/apple/dcp-color.h) — Resolved
    • Pass 2 in dcp_select_color_mode() is now gated on req->allow_unsafe_sdr && !mode->sdr_usable && mode->sdr_unsafe for both SDR and HDR, so explicit SDR requests without a safe match on safe timings return -EINVAL instead of falling through to UnsafeColorElementIDs. Covered by the new 4K60 safe-timing fixture in display.py.
  2. DownstreamFormat upstream encoding preservation (drivers/gpu/drm/apple/parser.h, parser.c, dcp-color.h) — Resolved
    • cmode.pixel_encoding stays untouched as the upstream encoding (preserving trace_iomfb_color_mode(), external_sdr_rank(), sdr_rgb, sdr_444, and ext26 modesets), while downstream 4:2:0 is carried in DCP_COLOR_FLAG_DOWNSTREAM_420 (keeping struct dcp_color_entry at 8 bytes).
    • dcp_color_entry_format() is consistently used for matching, ranking, wire-bpp bounding, dcp_color_mode_from_entry(), dcp_default_sdr_color(), pq_mode_rank() / out->pq.format, and color_state reporting. Covered by updated ds420_blob and display.py fixtures.
  3. External colour property exposure (drivers/gpu/drm/apple/dcp.c, dcp.h, apple_drv.c, iomfb.c) — Resolved
    • dcp_ext_color_props_supported() restricts Broadcast RGB, color format, and max bpc attachment to external iomfb_template pipes (skipping ext26 and native v14_7/v26_6), and dcp_crtc_check_hdr() accepts default SDR commits with max_bpc >= 8 on fixed 8-bit pipes.
  4. §1 capability-based VRR modeset check (drivers/gpu/drm/apple/dcp.c, iomfb.c) — Resolved
    • dcp_crtc_atomic_check() replaces the firmware-version list with READ_ONCE(dcp->iomfb_template_pq) && !dcp_vrr_live(dcp) (preserving the firmware 27 panel guard, with external H17P VRR already rejected above), and dcp_sdr_default_rgb() is shared in iomfb.c.
  5. Non-blocking notes — Resolved
    • Unsafe-only PQ link budget: documented in parser.c and additionally bounded by sdr_unsafe_max_bpp in both parse_color_modes() and dcp_select_color_mode(), with 24-bpp vs 30-bpp fixtures in rate.py and display.py.
    • Stack frame usage: color_scores heap-allocated with clean out_free teardown on all error paths, compound-literal copy removed from parse_mode(), dcp_find_mode() reads from the retained dcp_modes_snapshot() catalog without copying, and modeset copies use kzalloc_obj with __free(kfree).
    • Bitfield bounds: static_assert checks added for all four dcp_color_entry bitfields in record_color_entry().

§1–§6 Checklist Summary

  • §1 No model gating: Pass.
  • §2 Production-ready, no hacks: Pass.
  • §3 Safety: Pass (unsafe SDR/PQ strictly gated to unsafe-only timings; unsafe PQ remains non-DSC and wire-bpp bounded).
  • §4 Clean-room & attribution: Pass — all 7 commits carry human author/committer (Ryan Murray <ryan@aurorasilicon.org>), human Signed-off-by:, and zero AI trailers.
  • §5 Evidence: Pending exact-head d4acd94ddbf149 hardware runs (default cmdline, Enforcing, 0 AVC denials, 0 failed units, 0 new kernel errors):
    • J473: before/after default-property color_state on HDMI and DP sinks, corrected YCbCr 4:4:4/4:2:2, 4K60 DownstreamFormat YCbCr 4:2:0, Blocker 1 negative safe-timing SDR checks, max-Hz PQ, live 0x15/0x14, DPMS restore, GNOME HDR toggle, and monitor HDR indicator / native macOS comparison.
    • J616s: panel takeover + EDR regression and active panel-cadence VRR measurement via tracefs (VRR_ENABLED=0 vs 1).
  • §6 Naming: Pass.

…er adopt

dcp_takeover_adopt() adopts the bootloader's live fixed panel mode on
desktop 26.6 with dcp->vrr_enabled = false and vrr_min_on = 0 to avoid
a 200 ms boot blank.  Because dcp_vrr_live() was true unconditionally,
subsequent VRR_ENABLED 0->1 commits bypassed iomfb_modeset() and
dcp_vrr_update() returned early on !dcp->vrr_enabled, leaving panel VRR
inactive until an unrelated mode change occurred.

Allow a single modeset in dcp_crtc_atomic_check() when enabling
VRR_ENABLED on a live-VRR panel whose adaptive sync is not yet armed
(and has not hit vrr_failed), keeping all subsequent VRR_ENABLED toggles
live and flicker-free.  Also populate dcp->active_color under hdr.lock
during dcp_takeover_adopt().

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide requested review from a team as code owners November 24, 2026 13:06
@RyanTheTide

Copy link
Copy Markdown
Author

R3 receipt at d4acd94ddbf149dc18cd1ca60793cbe5723ee2a4: Prior head. The current d199ac168c7ef includes a new VRR takeover fix and needs its own physical results.

Blockers: J616s VRR still lacks measured variable display cadence. The exact R3 run recorded 408 userspace flips, zero vblank intervals and zero DCP swap intervals. The CRTC property changed while the display state still reported VRR off.

Checked: The J473 exact R3 matrix matched 35 of 36 outcomes. The SDR 1080p120 YCbCr 4:4:4 case returned success to DRM_MODE_ATOMIC_TEST_ONLY; the harness captured no active signal. Its requested max_bpc=10 is a ceiling, and the selector can legally choose a lower depth. Please capture the selected format/depth from the available colour elements or a safe guarded row before calling this an unsafe mode or changing the expected result. Both connected J473 paths report VRR unavailable.

Evidence

The exact J473 checks toggled PQ/HDR kernel state on both outputs and restored the stock boot. The negative case has color_state: null because the harness reads it only after a real atomic commit. The selector filters out depths above the ceiling.

@RyanTheTide

Copy link
Copy Markdown
Author

Pushed Commit 8 (d199ac168c7ef277e6f8a33fe7b17b789d5e2eca) and collected the exact-head J616s tracefs VRR proof, J473 R3 colour/HDR results, and live macOS 27.2 (26B123) dual-display guest reference diff.

Commit 8 (d199ac168c7ef2) — Desktop 26.6 takeover-adopt VRR arming

During the J616s tracefs run on d4acd94ddbf149, we caught a real interaction between dcp_takeover_adopt() and dcp_vrr_live(): dcp_takeover_adopt() adopts the bootloader's fixed panel mode with dcp->vrr_enabled = false and vrr_min_on = 0 to avoid a 200 ms boot blank, so dcp_vrr_live() bypassed iomfb_modeset() on VRR_ENABLED 0->1 and dcp_vrr_update() returned early on !dcp->vrr_enabled.

  • Updated dcp_crtc_atomic_check() so enabling VRR_ENABLED on a live-VRR panel whose adaptive sync is not yet armed (and has not hit vrr_failed) triggers one modeset to arm adaptive sync, keeping all subsequent VRR_ENABLED toggles live and flicker-free.
  • Populated dcp->active_color under dcp->hdr.lock in dcp_takeover_adopt(), and added lifecycle.py test coverage.
  • Local verification: run-host-tests.py --only dcp 56/56 PASS (incl. apple-dcp 94/94), arm64 LLVM=1 W=1 0 C warnings, checkpatch.pl 0 errors / 0 warnings. CI: kunit PASS, pr-text PASS; host-tests had 502/503 pass with a single GitHub HTTPS timeout in unrelated g15-retention-tests and has been re-run via --failed.

Exact-head d199ac168c7ef2 J616s active-panel-cadence VRR proof (7.3.0-aurora-fleet87, default cmdline, Enforcing, AVC=0, 0 failed)

  • Kernel dyndbg confirms seamless boot takeover, one-time VRR arming, and live zero-modeset floor switching:
    • takeover: adopting the live mode (color:1 timing:2) "3456x2234": 120
    • UnifiedPipeline::mode_set_gated: 3456x2234@120 Hz DSC=NO VRR=YES link: 1
    • adaptive sync minimum 0x780000 (VRR_ENABLED 0) (120.0 Hz floor) -> adaptive sync minimum 0x180000 (VRR_ENABLED 1) (24.0 Hz floor)
  • Real kernel tracefs dcp:iomfb_swap_complete (n=34 hardware swap completions per run, fixed absolute deadlines, ProMotion 240 Hz 4.167 ms step vs fixed 120 Hz 8.333 ms grid):
Target Hz (ms) VRR_ENABLED=0 (0x780000) dcp:iomfb_swap_complete VRR_ENABLED=1 (0x180000) dcp:iomfb_swap_complete
90 Hz (11.111 ms, non-divisor) med=8.334 ms, p95=16.673 ms, err=3.674 ms, grid120=0.010 ms med=12.472 ms, p95=12.525 ms, err=1.920 ms, grid120=2.727 ms
72 Hz (13.889 ms, non-divisor) med=13.484 ms, p5=8.340 ms, p95=20.780 ms, err=3.290 ms med=12.506 ms, p5=12.489 ms, p95=16.670 ms, err=1.879 ms
60 Hz (16.667 ms, divisor) med=16.666 ms, err=0.006 ms med=16.667 ms, err=0.094 ms
40 Hz (25.000 ms, divisor) med=25.000 ms, err=0.007 ms med=25.000 ms, err=0.004 ms
  • color_state reports depth: 8, format: RGB (0), vrr_enabled: 1, output_edr: 1 (panel takeover + EDR regression PASS).

Live macOS 27.2 (26B123) dual-display guest reference diff (J473 Acer QG270 S3 HDMI + MSI MPG 325CQRXF USB-C)

From Apple DCPAV validateVideo and UnifiedPipeline::mode_set_gated logs across all 7 live HDR/refresh transitions:

  1. PixelEncoding enum: macOS logs encoding=3 [YCbCr 4:4:4] and encoding=2 [YCbCr 4:2:2] verbatim, confirming our parser.h enum fix.
  2. Acer 1920x1080@180 Hz HDR: macOS drives HDR at 1920x1080@180 Hz (10bpc YCbCr 4:4:4 BT.2020, 30 bpp = 12.42 Gbps, DSC=NO, VRR=NO, type=0x87 DRM InfoFrame enabled), confirming that >340 MHz unsafe-only timings must allow non-DSC PQ. Linux selects color:113 (10bpc RGB BT.2020 PQ, same 30 bpp / 12.42 Gbps budget, zero RGB->YCbCr conversion) by default, and explicit color format = YCbCr444 selects macOS's exact color:116.
  3. MSI 2560x1440 HDR: macOS selects 12bpc encoding=2 [YCbCr 4:2:2] range=1 [Limited] colorimetry=7 [BT.2020 (YCbCr)], DSC=NO, VRR=NO, InfoFrame(0x87) enabled — an exact 1:1 match with Linux color:105.
  4. VRR on these J473 DP-to-HDMI bridges: macOS reports AdaptiveSync enabled=NO, VRR=NO, SupportsVariableRefreshRate=No, QMSVRREnableConfig=0, and zero VRR modes on both Acer (MCDP29XX) and MSI (MCDP2900), matching Linux vrr_capable=0.

J473 R3 results (d4acd94ddbf149, exact-head d199ac168c7ef2 R4 queued behind current J473 holder)

  • Stock fleet87 BEFORE vs trial AFTER default SDR color_state byte-for-byte identical: Acer 1080p180 color:86 (10b RGB sRGB SDR Full), MSI 1440p144 color:80 (8b RGB sRGB SDR Full).
  • GNOME HDR ON/OFF @ max-Hz (1080p180 color:113 + 1440p144 color:105, hdr_infoframe=1 -> 0): PASS.
  • KMS colour matrix: RGB 8/10/12b Full/Limited, wide-gamut SDR BT2020_RGB (color:85), YCbCr444 (3) 8/10/12b, YCbCr422 (2) 12b, 4K60 DownstreamFormat YCbCr420 (1) SAFE (color:119), Blocker 1 safe-timing SDR rejection (neg_sdr_4k60_rgb_unsafe -> -EINVAL), live 0x15 metadata update (MaxCLL 418 -> 600/700), and DPMS restore all PASS. (The 1080p120 max_bpc=10 YCbCr444 test returned 0 because max_bpc is a ceiling and validly selected safe 8-bit YCbCr444; updated to neg_sdr_1080p120_bt2020_rgb_unsafe for exact-head d199ac168c7ef2 R4.)

@DjDeveloperr DjDeveloperr 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: FINISH at d199ac168c7e

Blockers:

  • Exact-head CI on d199ac168c7e not yet all green: kunit and pr-text are green, while the host-tests rerun (after the unrelated g15-retention-tests --mutations GitHub HTTPS timeout; apple-dcp passed) and readiness are still queued.
  • Exact-head d199ac168c7e J473 R4 hardware row still queued: exact-head J616s tracefs VRR cadence proof and the live macOS 27.2 dual-display comparison are posted, while J473 R3 was run on prior head d4acd94ddbf149 (and the PR body's Tested: / Not yet: lines still reference d4acd94ddbf149).

Checked:

  • Delta d4acd94ddbf1..d199ac168c7e (dcp.c, iomfb.c, lifecycle.py): Clean, zero new §1–§4/§6 issues. dcp_crtc_atomic_check() triggers one modeset to arm adaptive sync on dcp_vrr_live() panels when VRR_ENABLED transitions 0 -> 1 while !dcp->vrr_enabled and !vrr_failed, keeping subsequent toggles live via dcp_vrr_update(). dcp_takeover_adopt() populates dcp->mode, dcp->active_color, output_pq, output_hdr, and vrr_enabled atomically under dcp->hdr.lock. lifecycle.py covers both the armed-after-adopt and vrr_failed cases.
  • Non-blocking note (drivers/gpu/drm/apple/iomfb.c:3021-3032): If another commit is pushed, guard the d->trial_modeset_ok reuse branch in dcp_desktop_modeset() with (!crtc_state->vrr_enabled || READ_ONCE(dcp->vrr_enabled)) so a no-fbcon boot whose very first atomic modeset directly requests VRR_ENABLED=1 still arms adaptive sync instead of keeping the fixed adopted mode.
  • §1–§4, §6: No new model/SoC/board gating; no hacks or extra cmdline requirements; safety invariants preserved; all 8 commits carry human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and human Signed-off-by: with clean PR title/body; naming clean.
  • §5 J616s exact-head proof: Verified on d199ac168c7e (7.3.0-aurora-fleet87, default cmdline, Enforcing, AVC=0, 0 failed units) with real dcp:iomfb_swap_complete tracefs cadence showing 90 Hz / 72 Hz stepping off the fixed 120 Hz grid onto the 240 Hz ProMotion grid under VRR_ENABLED=1 (0x180000) plus panel takeover and EDR intact.
Evidence
  • Head verified: d199ac168c7ef277e6f8a33fe7b17b789d5e2eca (state: OPEN, 8 commits, MERGEABLE).
  • CI on d199ac168c7e:
    • pr-text / pr-text: success (run 45400124927)
    • Apple DRM KUnit / kunit: success (run 45400124131)
    • Host tests / host-tests: prior attempt 45400124639 passed 502/503 including apple-dcp and failed only on a github.com:443 connect timeout in g15-retention-tests --mutations; rerun job 138474295022 is currently queued.
    • readiness / readiness: job 138466181484 is currently queued.
  • Hardware evidence on d199ac168c7e:
    • J616s (issuecomment-7132694448): exact-head d199ac168c7e takeover adopt, one-time VRR arming, live 0x780000 <-> 0x180000 switching, dcp:iomfb_swap_complete tracefs table (90/72/60/40 Hz), color_state (depth: 8, RGB, vrr_enabled: 1, output_edr: 1), Enforcing, AVC=0, 0 failed units.
    • macOS 27.2 (26B123) dual-display reference (issuecomment-7132694448): confirms PixelEncoding 2/3, non-DSC PQ on 1080p180, 1:1 color:105 match on 1440p144, and SupportsVariableRefreshRate=No on both J473 bridges.
    • J473 R4 on exact head d199ac168c7e: pending (R3 was run at d4acd94ddbf149).

@github-actions github-actions Bot added the area:display Area from CODEOWNERS (bot) label Nov 24, 2026
@github-actions github-actions Bot added changes-requested A reviewer requested changes (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 24, 2026
@github-actions

Copy link
Copy Markdown

Merge readiness at d199ac16: not ready yet

Check Detail
CI at head running running: host-tests
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes no requested by DjDeveloperr
Hardware row at head ok comment at d199ac16
Conflicts ok none
PR text ok Risk: two-way · Apple Silicon Macs with external HDMI/USB-C/DP displays or ProMotion VRR panels (appledrm).

Areas: area:display

Updated by pr-readiness on every push, edit and review, and every 30 minutes. Rules: merge policy · labels.

@RyanTheTide

Copy link
Copy Markdown
Author

Exact-head d199ac168c7ef2 J473 (M2 mini) R4 hardware row complete on 7.3.0-aurora-fleet87 (default cmdline, signed module SHA256 1b80888521c8, Enforcing, AVC=0, restored verified stock fleet87, ORACLE receipt j473-20261125T002648.3FtoQ2):

  • Default SDR stock BEFORE == trial AFTER (byte-for-byte identical):
    • HDMI-A-1 (1920x1080@180): color:86 (10b RGB (0) sRGB (10) SDR (0) Full (0))
    • DP-2 (2560x1440@144): color:80 (8b RGB (0) sRGB (10) SDR (0) Full (0))
  • GNOME 51.1 HDR ON/OFF @ max refresh: HDMI-A-1 1080p180 -> color:113 (10b RGB BT2020_RGB PQ Full, hdr_infoframe=1 -> 0) and DP-2 1440p144 -> color:105 (12b YCbCr422 (2) BT2020_YCC PQ Limited, hdr_infoframe=1 -> 0) — PASS.
  • Atomic KMS colour/HDR/DPMS matrix: 36/36 PASS (rc=0) (HDMI-A-1 23/23, DP-2 13/13):
    • RGB 8/10/12b Full/Limited, wide-gamut BT2020_RGB (color:85), YCbCr444 (3) 8/10/12b (color:84/90/83/116/120), YCbCr422 (2) 12b (color:108/105), 4K60 DownstreamFormat YCbCr420 (1) SAFE (color:119).
    • 5/5 negative -EINVAL checks PASS: neg_pq_rgb_1080p120_unsafe, neg_sdr_1080p120_bt2020_rgb_unsafe (replaced the earlier max_bpc=10 ceiling case that validly selected safe 8-bit YCbCr444), neg_ycbcr420_1080p60, neg_pq_rgb_1440p60_unsafe, neg_sdr_4k60_rgb_unsafe.
    • Live DCPAV 0x15 static metadata updates without modeset (MaxCLL 418 -> 600 on Acer, 418 -> 700 on MSI; 20 total 0x15 sends, 5 0x14 stops) + DPMS off/on InfoFrame restore — PASS.

All exact-head d199ac168c7ef2 hardware rows (J616s active ProMotion tracefs VRR + J473 R4 36/36 + live macOS 27.2 dual-display guest parity) and local checks are now complete.

@DjDeveloperr DjDeveloperr 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 d199ac16

Blockers: none

Checked: Verified host-tests, kunit, and pr-text passing on d199ac168c7e, zero AI attribution across all 8 commits and PR text, prior code review of Commit 8 (dcp_takeover_adopt VRR arming + lifecycle.py) clean, and exact-head d199ac168c7e J616s tracefs VRR + J473 R4 36/36 KMS/HDR/DPMS + live macOS 27.2 dual-display parity rows complete.

Evidence
  • Exact head: d199ac168c7ef277e6f8a33fe7b17b789d5e2eca (8 commits, human Signed-off-by: only, zero AI attribution).
  • CI on exact head: host-tests PASS, kunit PASS, pr-text PASS.
  • Hardware evidence at d199ac168c7e:
    • J616s active-panel-cadence tracefs VRR proof (dcp:iomfb_swap_complete, 90/72/60/40 Hz, Enforcing, AVC=0, 0 failed units).
    • J473 R4 (7.3.0-aurora-fleet87, default cmdline, Enforcing, AVC=0, ORACLE receipt j473-20261125T002648.3FtoQ2): default SDR byte-for-byte identical, GNOME 51.1 HDR ON/OFF @ max Hz PASS, 36/36 atomic KMS colour/HDR/DPMS matrix PASS (including 5/5 -EINVAL negative checks, live 0x15 static metadata updates, DPMS restore).
    • Live macOS 27.2 dual-display guest reference diff matching PixelEncoding enum, HDR modes, and bridge VRR capability.

@RyanTheTide
RyanTheTide merged commit 35cfd76 into main Nov 24, 2026
5 of 9 checks passed
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) changes-requested A reviewer requested changes (bot) door:two-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.

2 participants