Skip to content

drm/apple: enable adaptive sync on firmware 27 internal panels - #3399

Closed
erikwb wants to merge 7 commits into
mainfrom
feat/dcp-v27-panel-vrr
Closed

erikwb wants to merge 7 commits into
mainfrom
feat/dcp-v27-panel-vrr

Conversation

@erikwb

@erikwb erikwb commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What: Enable 24–120 Hz ProMotion adaptive sync on firmware-27 internal panels by allowing zero VRR range placeholders on DCP_FIRMWARE_V_27_0 eDP timings, allowing VRR_ENABLED atomic property transitions on VRR-capable (or currently VRR-armed) firmware-27 pipes to program parameter 15, keeping active VRR state when parameter 15 is refused while armed (falling back to fixed refresh on an initial enable refusal), preserving valid scanout timing across refused property-only VRR changes while atomically capturing prior validity under dcp->mode_state.lock, keeping the renumbered firmware wake readiness waits ahead of parameter-15 reprogramming, and adding vrr_capable to the rate.py host test mock struct apple_dcp.
Tested: At 9a9aa2466f43 (drivers/ byte-identical to 7bd9598400bf): checkpatch --strict, apple-dcp rate (5/5), vrr-rejection, vrr-refusal, vrr-wake-readiness, and display-sleep-merge-tests.py (17/17) pass locally (9a9aa2466f43 rate.py mock fix still needs hosted CI); at 7bd9598400bf: arm64 QEMU KUnit display.kunitconfig (167/167 non-skipped) and *iomfb-mode-state* (9/9) pass. Live J716c (16-inch M5 Max, T6050) in batched integration row 3545ebecb76f (merges 9a9aa2466f43 with #3289's iomfb_v27_idle_cache_invalidate() in iomfb.c): eDP-1/vrr_range Min: 24 / Max: 120, VRR stayed on across 2x pm_test=platform cycles with an off/on transition after each, 3x DPMS off/on clean in the separate DPMS pass (three IOAVVideoInterface open failed firmware notices in kernel log), initial boot smoke snapshot clean (1 failed system unit aurora-peripherals.service, same as baseline warm reboots; later checks recorded additional messages); no real s2idle / rtcwake ran on J716c. Prior runtime-identical 7bd9598400bf rows (J716c VRR toggles + pm_test=devices; J713 non-VRR 60 Hz + 3x s2idle) pass in Evidence.
Risk: two-way door · firmware-27 internal ProMotion panels (T6050 J716c, J714s/c, K114/K116); fixed 60 Hz panels (e.g. J815) and external displays stay fixed
Revert: git revert the merge commit on main and rebuild/boot the kernel; no persistent disk, firmware, DT, or Stage 2 state is modified.
Not yet: J716c VRR modeset after a real s2idle / rtcwake deep-sleep wake (only pm_test=devices and pm_test=platform suspends ran on J716c, because the RTC alarm cannot wake J716c unattended; J713's wake rows are non-VRR), J716c refusal + continued scanout / plane-only flips after a refused parameter-15 VRR change (no refusal can be provoked cleanly on the VRR-capable J716c panel; covered by vrr-refusal host scenarios), fixed 60 Hz firmware-27 panel (J815), non-J716c ProMotion boards (J714s/c, K114/K116; covered by parser_vrr_empty_range KUnit cases for FW 27 eDP 120 Hz, eDP 60 Hz, and external DisplayPort), and hosted CI (plus review) on 9a9aa2466f43.

Details

Five commits targeting main:

  1. cf76f48cfd36 (drm/apple: enable adaptive sync on firmware 27 internal panels):
    • Enables zero_vrr_range_fallback for DCP_FIRMWARE_V_26_6_DESKTOP || DCP_FIRMWARE_V_27_0 (eDP >= 119.88 Hz timings only) and removes the dcp_crtc_atomic_check() exclusion that prevented property-only VRR_ENABLED toggles from triggering iomfb_modeset() on firmware-27 panels.
    • Tracks dcp->vrr_capable across the mode catalog lifecycle (dcp_modes_replace, dcp_modes_adopt, dcp_modes_begin_attachment, dcp_modes_end_typec, dcp_modes_release) so fixed panels never trigger a needless modeset on VRR_ENABLED property commits.
    • Propagates -EOPNOTSUPP on parameter-15 refusal for unpaired external displays and suppresses keep_mode when waking with VRR enabled so parameter 15 is reprogrammed after sleep.
  2. c2e745b2b2e1 (drm/apple: keep active VRR state when parameter 15 is refused):
    • Tracks vrr_enable and vrr_was_enabled on dcp_wait_cookie in dcp_set_adaptive_sync() and vrr_sent locally in iomfb_modeset().
    • When !wait->vrr_was_enabled on an internal panel, a parameter-15 refusal warns once, proceeds with dcp_set_digital_out_mode() at fixed refresh so the panel stays lit, and keeps dcp->vrr_enabled = false.
    • When wait->vrr_was_enabled is true (including disabling adaptive sync with min_vrr = 0 or re-arming while active), a parameter-15 refusal logs a warning, returns -EOPNOTSUPP without calling dcp_set_digital_out_mode(), and keeps dcp->vrr_enabled = true until a subsequent modeset confirms parameter 15 succeeded.
    • Updates tools/testing/selftests/drivers/gpu/apple-dcp/ (transaction.py for dcp->vrr_capable, lifecycle.py vrr-rejection for firmware-27 vrr_capable/vrr_enabled transitions, and adds vrr-refusal covering parameter-15 refusals starting with VRR enabled) and avoids touching cookie inside the tools/asahi/display-sleep-merge-tests.py slice.
  3. c29c1ac2f24c (drm/apple: keep valid timing on refused property-only VRR change):
    • Detects property-only VRR_ENABLED changes in dcp_crtc_atomic_modeset() (drivers/gpu/drm/apple/iomfb.c) when dcp->mode_state.valid is already true and active state, connectors, timing (drm_mode_equal()), and color requests (dcp_color_request_equal(), pq_requested, output_edr) are unchanged.
    • Defers HDR infoframe stop / metadata forget until !ret on property-only VRR changes and passes !ret || preserve_valid to dcp_mode_finish() when iomfb_modeset_v27() returns -EOPNOTSUPP without tearing down a paired display, keeping dcp->mode_state.valid valid (unless invalidated concurrently) so subsequent plane-only flips continue to submit in iomfb_atomic_start() with the confirmed dcp->vrr_enabled state.
    • Extends vrr-refusal in tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py to execute dcp_crtc_atomic_modeset() and iomfb_atomic_start() across subsequent plane-only flips, concurrent invalidation, timing changes, and external displays.
  4. 7bd9598400bf (drm/apple: close mode-state begin race and keep wake readiness on VRR):
    • Changes dcp_mode_begin() (drivers/gpu/drm/apple/iomfb-state.h) to capture and return the prior state->valid under state->lock before clearing invalidated, and moves dcp_crtc_prepare_hdr() in dcp_crtc_atomic_modeset() (drivers/gpu/drm/apple/iomfb.c) after dcp_mode_begin() so an invalidation before dcp_mode_begin() cannot be masked by a stale unlocked was_valid read or restored by a refused property-only VRR change.
    • Separates wake_ready from keep_mode in iomfb_modeset() (drivers/gpu/drm/apple/iomfb_template.c) so a renumbered-firmware (27.2) wake still waits for v27_wake_video, and then for v27_wake_hotplug only once the panel's video interface has opened (drivers/gpu/drm/apple/iomfb_template.c:4417), before programming parameter 15 when waking with VRR enabled; a video-open timeout only warns and parameter 15 still proceeds.
    • Extends iomfb-state-test.c (dcp_mode_invalidation_order_test) and vrr-refusal (9 scenarios, adding invalidation before dcp_mode_begin()), and adds vrr-wake-readiness (7 scenarios) to tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py and run.py.
  5. 9a9aa2466f43 (selftests: apple-dcp: add vrr_capable to rate mock apple_dcp):
    • Adds bool vrr_capable to the mock struct apple_dcp in tools/testing/selftests/drivers/gpu/apple-dcp/rate.py so publication-hpd and panel-dimensions compile against the dcp_modes_* helpers extracted from drivers/gpu/drm/apple/iomfb.c.
Evidence
  • Batched integration row, 2026-11-28 (3545ebecb76f): J716c (16-inch M5 Max, T6050, firmware 27.2, AC, default command line) in a one-shot batched trial kernel (origin/main b897ccb4e71c plus 18 open PR heads, commit 3545ebecb76f): kernel image SHA-256 d56efde4c7232208bd29d5c4e5890319e0050595dd4f4b1c3844df6656a08312, one-shot Stage 2 SHA-256 b7d99286395ddd7dadccc6d9593f4bd55391d9e787af97c18b45f58688d9885d (default Stage 2 21edee972e1ff1718c6f41c32b91ee151afdc58cbb69f16f2f6a4d8d4c722170 and default kernel untouched). Parity of #3399's 11 files in that tree: 3 blob-identical, 7 hunk-identical, 1 (drivers/gpu/drm/apple/iomfb.c) merged by hand with #3289 (#3399's dcp_crtc_prepare_hdr() / VRR-only path kept, #3289's iomfb_v27_idle_cache_invalidate() added before dcp_mode_begin()).
    • eDP-1/vrr_range: Min: 24, Max: 120.
    • Platform suspend pass (pm_test=platform freeze): VRR was enabled before the two pm_test=platform cycles (VRR=1 -> vrr: true), remained on after both (VRR after: vrr: true after cycle 1 rc=0 success=5 fail=0 and cycle 2 rc=0 success=6 fail=0), and passed an off/on transition after each (VRR=0 -> vrr: false, VRR=1 -> vrr: true after cycle 1 and again after cycle 2, followed by VRR=0 -> vrr: false).
    • Modeset logging: vrr:1 in set_digital_out_mode() (drivers/gpu/drm/apple/iomfb_template.c:4391) reports mode VRR capability (mode->vrr); adaptive-sync enable/disable requests are logged by IOMFBParameter_adaptive_sync Req minRR = 0x180000 vs 0x0.
    • Separate DPMS log pass: 3x DPMS off (dpmsStatus: 0 drm_enabled=disabled, all four dcpext fControllerPowerState 0) and on (dpmsStatus: 1 drm_enabled=enabled), 0 new kernel warn/err lines during the DPMS helper window, while the full kernel log recorded three DCP firmware syslog notices (IOAVVideoInterface open failed, one per DPMS off->on cycle, followed by IOAVVideoInterface published and panel re-enable). No real s2idle / rtcwake wake with VRR active ran on J716c (the RTC alarm cannot wake J716c unattended).
    • 5-item smoke: display eDP-1 3456x2234@120 enabled; input Apple MTP keyboard, trackpad and SMC lid devices enumerated (not exercised remotely); networking wlan0 connected, 0% loss over 3 pings; permitted audio sink AppleJ716 + AppleJ716HPAI present with speakerguardd v2 active (no playback outside the linux#3085 row); GPU Borealis Apple M5 Max (G17C B1), renderD128, vkcube --c 180 --wsi wayland clean. 1 failed system unit (aurora-peripherals.service, same as baseline warm reboots; 0 new failed units), 0 failed user units, 0 LSM denials (no SELinux/AppArmor loaded), 0 Oops/BUG/fault lines; initial boot smoke snapshot err+ 40 lines against 55 on the default boot, none that the default boot lacks (apple-dcp ... unable to match service ..., systemd-gpt-auto-generator; later checks in the session recorded additional messages including the DPMS firmware notices, pm_test notices, and a boot-time deprecated-workqueue warning). Redacted dmesg excerpt: [ 1.250760] sn201202x 1-08: port controller ready; [ 2.677310] apple-ave 2283100000.video-encoder: firmware build 26B123 (TEXT 0x158000 CRC d33ed3b4, DATA 0x134000); [ 5.907044] apple-dcp 392e00000.dcp: RTKit: syslog message: ... fControllerPowerState 0 ...; [ 135.265810] PM: suspend entry (s2idle) / [ 140.691796] PM: suspend exit (pm_test=devices).
  • Local checks at 9a9aa2466f43 (git diff --quiet 7bd9598400bf..9a9aa2466f43 -- drivers/ clean; built driver code byte-identical to 7bd9598400bf; hosted CI still needed at 9a9aa2466f43):
    • git diff --check fcb124279183..HEAD: clean
    • ./scripts/checkpatch.pl --strict --git fcb124279183..HEAD: 0 errors / 0 warnings / 0 checks across all 5 commits
    • python3 -E -s -B tools/testing/selftests/drivers/gpu/apple-dcp/run.py --group rate: 5/5 passed (parser-policy, publication-hpd, panel-dimensions, metadata-decoder, bounded-retry)
    • tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py: vrr-rejection, vrr-refusal, and vrr-wake-readiness passed
    • python3 tools/asahi/display-sleep-merge-tests.py: 17/17 passed
  • Local KUnit checks at 7bd9598400bf (runtime-identical drivers/ in 9a9aa2466f43):
    • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig: 168 run, 167 passed, 1 skipped (apple_g17_rx_util_min_test requires CONFIG_UCLAMP_TASK), apple-display-parser 47/47 passed
    • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig --kconfig_add CONFIG_DRM_APPLE_KUNIT_TEST=y '*iomfb-mode-state*': 9/9 passed
  • Prior live J716c (16-inch M5 Max, T6050, FW 27.2) at 7bd9598400bf (byte-identical drivers/ at 9a9aa2466f43) in batched candidate c3da8eed6f72 (over main 9af21b007425, default cmdline, default Stage 2, Linux 7.3.0, AC 100%):
    • eDP-1/vrr_range: Min: 24, Max: 120
    • 5 live VRR toggles (0, 1, 0, 1, 0), ~118 ms each; minRR 0x180000 with VRR on, 0x0 with VRR off
    • UnifiedPipeline::mode_set_gated logged VRR=YES and VRR=NO alternately, 0 errors; VRR toggled cleanly again after a pm_test=devices resume
  • Prior live J713 (M4 Air, T8132) regression at 7bd9598400bf (byte-identical drivers/ at 9a9aa2466f43) in batched candidate b3dbf237542b (over main 9e38a276dcb4, default cmdline, default Stage 2, Linux 7.3.0): eDP-1/vrr_range Min: 0 / Max: 0, hyprctl monitors vrr: false, set_digital_out_mode logged vrr:0 cleanly across modesets, 3x DPMS off/on and 3x s2idle (rtcwake -d /dev/rtc1 -m freeze -s 5) wake readiness, dpmsStatus=1 on all 3 wakes.
  • Earlier-head J716c run at cf76f48cfd36:
    • /sys/kernel/debug/dri/display-subsystem/eDP-1/vrr_range: Min: 24, Max: 120
    • UnifiedPipeline::mode_set_gated: 3456x2234@120 Hz DSC=NO VRR=YES link: 1 <-> VRR=NO link: 1 (~114 ms)
    • Unplugged lit idle bl=150: 4,611 -> 4,552 mW (heatpipe 1,027 -> 987–991 mW); bl=1: 2,500 -> 2,425 mW (41.1 h)

Firmware 27 internal panels publish MinimumVariableRefreshRate and
MaximumVariableRefreshRate as zero placeholders in their timing catalog,
just like desktop 26.6 firmware. Enable zero_vrr_range_fallback for
DCP_FIRMWARE_V_27_0 so eDP panels with ProMotion timings advertise their
24-120 Hz VRR range, and allow VRR_ENABLED transitions on firmware 27
panels to trigger iomfb_modeset() so parameter 15 is programmed.

If a firmware 27 panel refuses parameter 15, record the refusal on the
modeset wait cookie, warn once, and still issue set_digital_out_mode()
so the panel keeps fixed refresh instead of blanking. Mark the boot-mode
inheritance path as refusing VRR so dcp->vrr_enabled never claims
adaptive sync is active when parameter 15 was skipped.

Extend parser_vrr_empty_range in parser-test.c to verify
DCP_FIRMWARE_V_27_0 enables the fallback on eDP and leaves external
DisplayPort timings fixed.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb
erikwb requested review from a team as code owners November 27, 2026 14:40
@erikwb
erikwb requested review from Acelogic and malik-na November 27, 2026 14:40

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

The internal-panel refusal path does not distinguish a rejected enable from a rejected disable. It proceeds with the ordinary mode set and records vrr_enabled=false in both cases. If parameter 15 is refused while previously armed, the reply does not prove the panel actually left adaptive sync. Please handle rejected disable without claiming fixed refresh until it is confirmed, or document and demonstrate that the following mode-set call clears it. Add a transition test starting with VRR enabled, and retain the fixed-60-Hz and affected ProMotion peer rows.

@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (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 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Merge readiness at 3c86dfd2: not ready yet

Check Detail
CI at head no failing: host-tests
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at 3c86dfd2
Conflicts ok none
PR text ok Risk: two-way · firmware-27 internal ProMotion panels (T6050 J716c, J714s/c, K114/K116); fixed 60 Hz panels (e.g. J815) and external displays stay fixed Revert: git revert the merge commit on main and rebuild/boot the kernel; no persistent disk, firmware, DT, or Stage 2 state is modified.

Areas: area:display

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

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Nov 27, 2026
Distinguish a rejected adaptive-sync enable on a fixed internal panel
from a refusal while adaptive sync is already armed. When
dcp->vrr_enabled was false, firmware 27 panels still fall back to
set_digital_out_mode() at fixed refresh so the display stays lit. When
dcp->vrr_enabled was already true (including disabling adaptive sync),
a parameter-15 refusal fails the modeset with -EOPNOTSUPP instead of
proceeding and claiming fixed refresh without confirmation.

Avoid touching cookie fields inside the display-sleep-merge host test
slice by tracking whether adaptive sync was sent in iomfb_modeset(), and
update the apple-dcp host selftests for dcp->vrr_capable and the
VRR-armed refusal/disarm transition.

Signed-off-by: Erik Bourget <erik@ebourget.net>
When a property-only VRR_ENABLED change on firmware 27 refuses
parameter 15 without calling set_digital_out_mode(), the active pipe
timing and confirmed VRR state remain intact in firmware. Do not clear
dcp->mode_state.valid in dcp_crtc_atomic_modeset() on that refusal, so
subsequent plane-only flips continue to submit instead of being dropped
in iomfb_atomic_start().

Extend the apple-dcp vrr-refusal host test to execute
dcp_crtc_atomic_modeset() and iomfb_atomic_start() through subsequent
plane-only flips, concurrent invalidation, timing changes, and external
displays.

Signed-off-by: Erik Bourget <erik@ebourget.net>
Have dcp_mode_begin() capture and return prior validity under
state->lock before clearing invalidated, so dcp_crtc_atomic_modeset()
never relies on an unlocked read that misses an invalidation between
admission and begin and mistakenly restores stale timing on a refused
VRR change. Update iomfb-state-test and the apple-dcp vrr-refusal
selftest to cover invalidation before dcp_mode_begin().

Separate V27 wake readiness from keep_mode in iomfb_modeset() so
renumbered firmware still waits for v27_wake_video and v27_wake_hotplug
before programming parameter 15 when VRR is enabled after wake, and add
the vrr-wake-readiness host selftest.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb

erikwb commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in c2e745b2b2e1, c29c1ac2f24c, and 7bd9598400bf (drivers/gpu/drm/apple/{iomfb-state.h,iomfb-state-test.c,iomfb.c,iomfb_template.c}, tools/testing/selftests/drivers/gpu/apple-dcp/{lifecycle.py,run.py,transaction.py}).

  • Internal-panel refusal while VRR is armed (c2e745b2b2e1, drivers/gpu/drm/apple/iomfb_template.c): dcp_set_adaptive_sync() records wait->vrr_enable (min_vrr != 0) and wait->vrr_was_enabled (READ_ONCE(dcp->vrr_enabled)) on struct dcp_wait_cookie, and iomfb_modeset() tracks vrr_sent locally. When !wait->vrr_was_enabled on an internal panel, a parameter-15 refusal warns once, proceeds with dcp_set_digital_out_mode() at fixed refresh so the panel stays lit, and keeps dcp->vrr_enabled = false. When wait->vrr_was_enabled is true (including disabling adaptive sync with min_vrr = 0 or re-arming while active), dcp_on_set_adaptive_sync() warns (adaptive sync disable/update refused (%#x); keeping active state), sets wait->status = -EOPNOTSUPP, and completes without calling dcp_set_digital_out_mode(), so iomfb_modeset() returns -EOPNOTSUPP without clearing dcp->vrr_enabled.
  • Preserving valid scanout timing on refused property-only VRR changes (c29c1ac2f24c, drivers/gpu/drm/apple/iomfb.c): dcp_crtc_atomic_modeset() detects property-only VRR_ENABLED commits (when dcp->mode_state.valid was true and active state, connectors, timing, and color requests are unchanged), defers HDR infoframe stop / metadata forget until !ret, and passes !ret || preserve_valid to dcp_mode_finish() when iomfb_modeset_v27() returns -EOPNOTSUPP without tearing down a paired display. Unless invalidated concurrently, dcp->mode_state.valid stays true so subsequent plane-only flips continue to submit in iomfb_atomic_start() with the confirmed dcp->vrr_enabled state.
  • Atomic was_valid capture under mode_state.lock (7bd9598400bf, drivers/gpu/drm/apple/iomfb-state.h, drivers/gpu/drm/apple/iomfb.c): dcp_mode_begin() now captures and returns the prior state->valid under state->lock before clearing invalidated, and dcp_crtc_atomic_modeset() evaluates vrr_only && was_valid and runs dcp_crtc_prepare_hdr() after dcp_mode_begin(). Any invalidation between admission and dcp_mode_begin() yields !was_valid, preventing a subsequent VRR refusal from restoring stale timing as valid.
  • Wake readiness on renumbered firmware with VRR enabled (7bd9598400bf, drivers/gpu/drm/apple/iomfb_template.c): iomfb_modeset() separates wake_ready (dcp->v27_j714s && xchg(&dcp->v27_keep_mode, false)) from keep_mode, so on a renumbered-firmware (27.2) wake (wake_ready), iomfb_modeset() waits for v27_wake_video first and waits for v27_wake_hotplug only after the video-open wait completes (drivers/gpu/drm/apple/iomfb_template.c:4417); a video-open timeout only warns, skips the hotplug wait, and parameter 15 is still reprogrammed (keep_mode is cleared in both cases).
  • Host and KUnit coverage:
    • Kept cookie->vrr_refused untouched in the keep_mode and boot-mode inheritance branches (relying on vrr_sent instead), preserving tools/asahi/display-sleep-merge-tests.py (17/17 passing).
    • Added vrr_capable to struct apple_dcp in tools/testing/selftests/drivers/gpu/apple-dcp/transaction.py and lifecycle.py, and updated vrr-rejection (296 cases) for firmware-27 vrr_capable/vrr_enabled transitions.
    • Extended iomfb-state-test.c (dcp_mode_invalidation_order_test) and vrr-refusal (lifecycle.py, 9 scenarios) to cover invalidation both before dcp_mode_begin() and in flight during the firmware call, plus subsequent plane-only flips, timing switches, and external displays.
    • Added vrr-wake-readiness in tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py (registered in run.py, 7 scenarios) covering the v27_wake_video and v27_wake_hotplug wait ordering ahead of parameter 15 on a renumbered-firmware wake with VRR enabled.
  • Scoped the PR evidence strictly to the passing checks below and listed the unrun items (refused-VRR plane-only flips and a real-sleep VRR wake on J716c, fixed-60-Hz J815, and non-J716c ProMotion peer boards) in **Not yet:**.

Verified at 7bd9598400bf:

  • ./scripts/checkpatch.pl --strict --git cf76f48cfd36..HEAD: 0 errors, 0 warnings, 0 checks across all three follow-up commits.
  • make ARCH=arm64 LLVM=1 O=_build W=1 KCFLAGS="-Werror" across dcp.o, iomfb.o, iomfb_v12_3.o, iomfb_v13_3.o, iomfb_v14_7_tpl.o, iomfb_v26_6_desktop.o, iomfb_v27.o, iomfb_v14_7.o, iomfb_h17p.o, and iomfb-state-test.o (CONFIG_RUST=n, CONFIG_DRM_APPLE_KUNIT_TEST=y): clean.
  • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig: 168 run, 167 passed, 1 skipped (CONFIG_UCLAMP_TASK), apple-display-parser 47/47 passed.
  • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig --kconfig_add CONFIG_DRM_APPLE_KUNIT_TEST=y '*iomfb-mode-state*': 9/9 passed.
  • python3 tools/asahi/display-sleep-merge-tests.py (17/17 passed), vrr-rejection (296 cases passed), vrr-refusal (9 scenarios passed), vrr-wake-readiness (7 scenarios passed), and mux-release-stages (4/4 passed with -Wno-unused-but-set-global on clang 23).

Hardware at 7bd9598400bf (default command line): J716c (batched candidate c3da8eed6f72) advertised eDP-1/vrr_range Min: 24 / Max: 120, toggled VRR 5 times (0, 1, 0, 1, 0, ~118 ms each, minRR 0x180000 on / 0x0 off, mode_set_gated alternating VRR=YES/VRR=NO, 0 errors) and toggled cleanly after a pm_test=devices resume; J713 (batched candidate b3dbf237542b, non-VRR 60 Hz panel) stayed at vrr_range Min: 0 / Max: 0 with vrr:0 modesets across 3x DPMS off/on and 3x s2idle wakes. A provoked parameter-15 refusal and a VRR modeset after a real s2idle / deep-sleep wake on J716c were not run.

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

The refusal branch now keeps the confirmed active VRR state and skips the timing change. Mode validity is captured under the lock and the tests cover invalidation and later plane-only flips. Code approved. J716c real wake and refusal/continued-scanout validation, a ProMotion peer, and hosted checks remain landing evidence.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) labels Nov 27, 2026
dcp_modes_begin_attachment(), dcp_modes_end_typec(), dcp_modes_adopt(),
dcp_modes_replace(), and dcp_modes_release() in iomfb.c now update
dcp->vrr_capable. Add bool vrr_capable to struct apple_dcp in rate.py
so publication-hpd and panel-dimensions compile.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb

erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the failing host-tests CI check in 9a9aa2466f43 (tools/testing/selftests/drivers/gpu/apple-dcp/rate.py). Hosted CI is still needed on 9a9aa2466f43.

dcp_modes_begin_attachment(), dcp_modes_end_typec(), dcp_modes_adopt(), dcp_modes_replace(), and dcp_modes_release() in drivers/gpu/drm/apple/iomfb.c now write dcp->vrr_capable, which broke compilation of publication-hpd and panel-dimensions because rate.py's mock struct apple_dcp did not declare vrr_capable.

Verified after 9a9aa2466f43:

  • git diff --quiet 7bd9598400bf..9a9aa2466f43 -- drivers/: built kernel/driver files are byte-identical to 7bd9598400bf.
  • ./scripts/checkpatch.pl --strict --git fcb124279183..HEAD: 0 errors, 0 warnings, 0 checks across all 5 commits.
  • python3 -E -s -B tools/testing/selftests/drivers/gpu/apple-dcp/run.py --group rate: 5/5 passed (parser-policy, publication-hpd, panel-dimensions, metadata-decoder, bounded-retry).
  • tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py: vrr-rejection, vrr-refusal, and vrr-wake-readiness passed.
  • python3 tools/asahi/display-sleep-merge-tests.py: 17/17 passed.
  • Batched integration row on J716c (3545ebecb76f, merging 9a9aa2466f43 with #3289's iomfb_v27_idle_cache_invalidate() added in drivers/gpu/drm/apple/iomfb.c before dcp_mode_begin(), kernel SHA-256 d56efde4c7232208bd29d5c4e5890319e0050595dd4f4b1c3844df6656a08312): eDP-1/vrr_range Min: 24 / Max: 120; VRR was on before both pm_test=platform freeze cycles (VRR=1 -> vrr: true), remained on after both (vrr: true), and passed an off/on transition (vrr: false -> vrr: true) after each (set_digital_out_mode() vrr:1 in modeset logs reports mode capability per drivers/gpu/drm/apple/iomfb_template.c:4391); in the separate DPMS log pass, 3x DPMS off/on cycles (dpmsStatus: 0 / drm_enabled=disabled -> dpmsStatus: 1 / drm_enabled=enabled) ran with 0 new warn/err lines during the DPMS helper window and three IOAVVideoInterface open failed firmware notices in the full kernel log; initial boot smoke snapshot clean (1 failed system unit aurora-peripherals.service, same as baseline warm reboots; later checks recorded additional messages). The older runtime-identical 7bd9598400bf J716c and J713 rows are retained in the PR body; real J716c s2idle/rtcwake, refusal + continued scanout, and requested ProMotion peer rows remain under **Not yet:**.

@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 9a9aa2466f43

Blockers: Existing live J716c wake, refused-change continued scanout, peer and hosted validation remain due.

Checked: The only delta adds the field read by production code to the rate mock. Production behavior is byte-identical to the reviewed parent. The author reports five rate cases passed.

Evidence

Compared the current head, prior review and current PR receipts.

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Nov 29, 2026
Signed-off-by: Erik Bourget <erik@ebourget.net>
… refusal mock

The vrr-refusal host test extracts struct dcp_mode_state from
iomfb-state.h and dcp_crtc_atomic_modeset() from iomfb.c.  On current
main the state header carries dcp_provider_clock_limits(), which uses
u64, and the M4 branch of dcp_crtc_atomic_modeset() calls
dcp_notch_mode_known(), so the generated unit no longer compiles.
Declare u64 and add an asserting dcp_notch_mode_known() stub next to the
existing iomfb_m4_get_mode() one; the test never takes the M4 branch.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb

erikwb commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

Merged current main (c3fbd2361475) into the branch and fixed the host-tests failure. New head: 3c86dfd264a5.

  • The failure came from main, not from this PR. CI tested the merge with main b48f89158d7c. In that tree, vrr-refusal (apple-dcp) stopped compiling: iomfb-state.h now has dcp_provider_clock_limits(), which uses u64, and the M4 branch of dcp_crtc_atomic_modeset() now calls dcp_notch_mode_known(). The test's mock defined neither. 9a9aa2466f43 on its own still passes.
  • Merge b86567e702ac: the only conflict was the stub block in tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py. I kept main's dcp_notch_mode_known() stub and this PR's __attribute__((unused)) on dcp_has_panel(). The driver files merged without conflicts. vrr_capable is still set wherever the mode catalog is published, next to main's new nr_notch_twins bookkeeping.
  • Fix 3c86dfd264a5 (lifecycle.py, tests only): declares u64 in the vrr-refusal mock and adds an asserting dcp_notch_mode_known() stub. The test never takes the M4 branch. No driver change.

Verified at 3c86dfd264a5:

  • tools/asahi/run-host-tests.py with the CI toolchains (clang 18, gcc 13, rustc 1.96.0, Python 3.14): apple-dcp passes, including vrr-refusal, vrr-rejection and vrr-wake-readiness. Every other job also passes except g17-compute-owed-stamp-tests. That test fails on main itself (host-tests run on 8ebb0f75ae2d), and tools/asahi: g17: take the published sequence in the owed-stamp test's note_retired stub #3594 fixes it.
  • arm64 LLVM=1 defconfig + asahi.config, drivers/gpu/drm/apple/ compiled: clean, no warnings.
  • arm64 QEMU KUnit drivers/gpu/drm/apple/tests/display.kunitconfig: 168 passed, 1 skipped.
  • checkpatch --strict on the fix commit: 0 errors, 0 warnings, 0 checks.

Still open (unchanged by this push): a J716c row at the new head, a VRR mode set after a real s2idle/rtcwake wake on J716c, continued scanout after a refused change on hardware, and the fixed 60 Hz and other ProMotion board rows.

@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 3c86dfd

Checked: The forward merge keeps the VRR refusal fixture. The two declarations added by the follow-up match the newly included header and keep the test's unexpected notch path asserting. The intended VRR refusal behavior remains.

Remaining validation: Carry the open J716c wake, refused-change scanout and peer evidence, plus exact-head CI.

@github-actions github-actions Bot removed ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Nov 29, 2026
@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Nov 29, 2026
@erikwb

erikwb commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #3616 (merged). #3616 reports firmware-27 ProMotion panels as vrr_capable with a 24-120 Hz range while keeping the mode fixed: the panel already paces refresh to the swaps, so no minimum refresh rate is sent to the firmware. This PR treats the zero firmware-27 range as 24-120 and sends minRR on mode sets, which is the path #3369 was closed for (a mode set with minRR 24 Hz crashed the internal DCP on the K114s). On top of main it would bring that path back and bypass #3616's swap-paced handling. The J716c gets vrr_capable from #3616.

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: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.

1 participant