Skip to content

drm/apple: enable static-frame idle caching on firmware 27 panels - #3289

Open
erikwb wants to merge 17 commits into
mainfrom
feat/dcp-v27-idle-cache
Open

erikwb wants to merge 17 commits into
mainfrom
feat/dcp-v27-idle-cache

Conversation

@erikwb

@erikwb erikwb commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What: Enable static-frame idle caching ("replay") on verified firmware 27 internal-panel hardware profiles (apple_dcp_hw_t8132_v27 via hw.v27_idle_cache = true) so DCP serves static desktop frames from a reusable cache surface after 1 second of idle output (historical earlier-head J713 coulomb-counter A/B measured ~88–89 mW idle battery savings; not yet refreshed at head), keeping unverified profiles (and apple_dcp_hw_t6050, where firmware stops at setup with zero replays) off by default, including dcp_v27_idle_cache_supported() in dcp_caches_scanout() so replay-capable firmware 27 scanout gets drm_gem_fb_create_with_dirty() (DIRTYFB and shadowed fbdev updates trigger atomic commits to refresh scanout and exit replay instead of returning -ENOSYS) while non-caching interfaces keep headless client framebuffers on apple_drm_client_fb_funcs, initializing channels_idle_wq inside iomfb_queue_init() so IOMFB KUnit fixtures never dereference an uninitialized wait queue after the main merge, and adding KUnit coverage for failed swap_submit unwind, session-retention rollback, default-off unverified profiles, unshadowed fbdev exclusion on non-caching interfaces, and DIRTYFB dirty-commit routing.
Tested: Hosted CI green at 0388c9334b8d (Apple build and KUnit, Host tests, pr-text, pr-readiness), composite hardware checks at 0388c9334b8d on J313 (M1 Air, T8103) and partial checks on J716c (M5 Max, T6050) (J713 currently off-network; 25e08d2ee142 composite built cleanly for J713), plus prior 4a6030e3598b host/KUnit suites and df01a6cd9b2e / 31e21a4ae8f4 / c85087653bd4 / f7e6fb162951 / c05e2a268684 live hardware rows in Evidence:

  • Hosted CI (0388c9334b8d, merged over main 351190d9b140): Apple build and KUnit (apple-build, KUnit plan, KUnit dcp-fabric dcp-topology dcp-display) SUCCESS, Host tests SUCCESS, pr-text SUCCESS, pr-readiness SUCCESS; checkpatch.pl --strict (351190d9b140..0388c9334b8d) 0 errors, 0 warnings (1 false-positive CamelCase check on DRM_MODE_CONNECTOR_eDP); git diff --check 351190d9b140..0388c9334b8d clean.
  • J313 (0388c9334b8d, M1 Air, T8103, fw 27.2): PASS in composite 807c3bbf2263 (origin/main d3de772ac0c1 + #3507, #3332, #3850, #3359, #3334 + #3410, #3300, #3289): clean boot (0 Oops/BUG/WARN/SError/Call trace; err+ lines subset of default kernel; speakerguardd-v2-switchtest.service failed identically on a separate build without #3359, not attributed to #3289), 0 idle-cache/replay lines in dmesg before and after DPMS (default-off confirmed), >= 7 internal eDP-1 DPMS off/on cycles (backlight 0 -> 130), and 3/3 docked deep S2R PASS (rtcwake -d /dev/rtc1 -m mem -s 20, suspend_stats fail 0, 16 MB RAM integrity PASS, pre/post-sleep GPU compute/render PASS; software-undocked s2idle hung and is tracked under #3334).
  • J716c (0388c9334b8d, M5 Max, T6050, fw 27.2): partial PASS in composite 8d250d354c97 (origin/main d3de772ac0c1 + #3717, #3398 + #3410, #3409, #3273, #3289, #3359): clean desktop boot (0 Oops/WARN/BUG/Call trace), 0 idle cache/replay lines in dmesg (default-off confirmed), and 3x eDP-1 DPMS off/on (3456x2234 restored, 0 Oops/WARN); pass stopped on s2idle (rtcwake -m freeze non-wake matching known main RTC-wake behaviour), leaving deep suspend and post-sleep checks unrun.
  • J713 (0388c9334b8d, M4 Air, T8132, fw 27.2): composite 25e08d2ee142 (origin/main d3de772ac0c1 + #3717, #3273, #3289, #3300, #3359, #3409) built cleanly (kb run -p linux-j713, 352 s, exit 0); hardware pass unrun while J713 is off-network (moved to Not yet; prior df01a6cd9b2e row in Evidence).
  • Prior host checks (4a6030e3598b, after merging main 19ee1b5bc9d5, before 351190d9b140 main merge): apple-dcp-v27 KUnit 12/12, topology.kunitconfig 221/222 (1 skipped, 0 failed), display.kunitconfig 188/189 (1 skipped, 0 failed), tests/.kunitconfig 117/117, dcpext26-{queue,startup}-tests.py pass, run-host-tests.py --only apple-dcp 87/101 (14 pre-existing host-compiler failures unrelated to #3289; ok 72 - stale-crtc-poweroff and ok 73 - dropped-swap-teardown pass), LLVM=1 ARCH=arm64 W=1 build of drivers/gpu/drm/apple/ 0 warnings.
    Risk: two-way door · T8132 firmware-27 internal panels (apple_dcp_hw_t8132_v27); iomfb_queue_init() wait-queue initialization across DCP interfaces; unverified profiles and T6050 remain off by default
    Revert: git revert restores default-off behavior across all profiles, dcp_caches_scanout() M4-only scope, and channels_idle_wq initialization in dcp_platform_probe_pipe() with no persistent on-disk, DT, or firmware state (apple-dcp live unbind after replay registration retains DMA until reboot, as with any adopted live DCP session).
    Not yet:
  • Refreshed hardware pass at 0388c9334b8d on J713 (M4 Air, T8132, firmware 27.2, currently off-network; composite 25e08d2ee142 built cleanly): cache entry/exit (v27 idle cache active, DPMS off/on, s2idle), fbcon chvt 3 check leaving tty3 visible through idle and writing new text to verify screen redraw, separate DRM-master DRM_IOCTL_MODE_DIRTYFB check from state 4, live apple-dcp unbind from state 4, boot smoke, and refreshed unplugged coulomb-counter A/B.
  • Unrun J716c (M5 Max, T6050, firmware 27.2) deep suspend/resume and post-sleep checks at 0388c9334b8d (pass stopped on s2idle rtcwake -m freeze non-wake).
  • On-site physical visual observation of fbcon live-console redraw on J713 (T8132, firmware 27.2) (unless verified during the pass).
  • Active replay on firmware-27 internal panels not present in this lab (T6041, T8122, T8142 / J813 / J815), which stay disabled by default (hw.v27_idle_cache = false) until verified.
Details
  • dcp_v27_idle_cache_supported() checks fw_compat == DCP_FIRMWARE_V_27_0 && dcp->hw.v27_idle_cache && dcp->main_display && dcp_has_panel(dcp). Unverified firmware-27 internal-panel profiles keep hw.v27_idle_cache = false by default, and .v27_idle_cache = true is enabled on the shared apple_dcp_hw_t8132_v27 profile where active state-4 replay and display power savings are verified.
  • Why hw.v27_idle_cache is gated on verified profiles (including keeping apple_dcp_hw_t6050 off): J716c runs at ed0e9648f90c and f7e6fb162951 showed T6050 firmware accepts applyProperty(138, 2) (status=0) and swap_intent = 8 (ret=0), enters setup state 2 with periodic 2 -> 6 -> 2 refreshes, and never transitions to active state 4 (replays=0). No static DT/ADT property or pre-submit firmware query distinguishes setup-only firmware from J713's state-4 firmware beforehand, and submitting swap_intent = 8 once already allocates the DMA cache surface and commits dcp_retain_live_session_commit() (retain_dma = true); conversely, a runtime setup-count latch cannot distinguish setup attempts interrupted by normal display activity on a capable panel from setup-only firmware. Defaulting unverified profiles to off prevents pinning DMA and live-session retention without obtaining replay.
  • In dcp.c and apple_drv.c, dcp_caches_scanout() returns true for iomfb_is_m4(dcp) || dcp_v27_idle_cache_supported(dcp). On replay-capable firmware 27 panels (apple_dcp_hw_t8132_v27), apple_fb_create() returns drm_gem_fb_create_with_dirty(), giving userspace DIRTYFB callers and shadowed fbdev clients drm_atomic_helper_dirtyfb() so front-buffer drawing triggers an atomic commit and refreshes/exits replay instead of returning -ENOSYS. On non-caching interfaces (including apple_dcp_hw_t6050 and unverified firmware 27 profiles), headless in-kernel DRM client opens (!file || !file->filp, such as fbdev/fbcon) without a dirty callback are tagged with immutable apple_drm_client_fb_funcs, while userspace KMS opens (file->filp != NULL) keep drm_gem_fb_create(). In iomfb_flush(), iomfb_v27_idle_cache_fb_eligible() checks fb->funcs (fb->funcs->dirty eligible; fb->funcs == &apple_drm_client_fb_funcs ineligible) without ever reading or dereferencing fb->dev->fb_helper, avoiding any teardown race with drm_fb_helper_fini() during DRM unplug.
  • After an eligible primary-plane KMS swap completes as displayed (shown == true and retire == true) and remains static past a 1-second deadline tracked under v27_idle_lock, a delayed worker runs two-phase setup:
    1. Negotiate first (applyProperty(138, 2) on A352): runs as a negotiate-only transaction before any GEM allocation or live-session retention. If firmware refuses, the driver latches v27_idle_unavailable and leaves the panel fully rebindable.
    2. Allocate & register replay swap (swap_intent = 8 at offset 0x17c, surf_ids[0] = 2): validates full surface/plane/compression span (iomfb_v27_idle_surface_span()), allocates/reuses a DMA GEM cache surface (reallocating only once firmware releases the prior buffer via D581), pre-acquires live-session retention references in process context (dcp_retain_live_session_prepare()), and commits permanent retention under v27_idle_lock only after swap_submit publishes cleanly over the mailbox (dcp_send_message_checked()).
  • Handles firmware idle-cache callbacks (D116 state transitions, D579/D580 fence lifecycle, D581 surface release), filters replay swap completions and aborts (D594/D597) without disturbing KMS retirement, invalidates queued replay and restarts the 1 s idle interval on non-plane-0 flushes and standalone brightness/EDR presents, closes admission with an iomfb.lock barrier on DPMS off / suspend / unbind, unwinds unsent idle-cache command entries on transient mailbox errors without affecting existing dcp_push() callers, and resets replay state in dcp_v27_warm_restart() before mailbox RX re-enables.
  • Commits 125129d93ae9, f7e6fb162951, c85087653bd4, 31e21a4ae8f4, and df01a6cd9b2e add CONFIG_DRM_APPLE_KUNIT_TEST-scoped hooks and five idle-cache KUnit tests in drivers/gpu/drm/apple/iomfb_v27_test.c covering injected -EAGAIN swap_submit unwind, outer callback and prior DMA pin preservation, default-off unverified profiles, headless fbdev exclusion, and DIRTYFB atomic-commit routing on replay-capable framebuffers.
  • Commit 962249cdc60f moves init_waitqueue_head(&dcp->channels_idle_wq) from dcp_platform_probe_pipe() into iomfb_queue_init(), which runs earlier in probe and is shared by KUnit fixtures that call iomfb_recv_msg(), preventing iomfb_channels_idle_wake() from dereferencing a zeroed wait_queue_head_t after a4d28a5a merged f085a8dda674 from main.
  • Commit df01a6cd9b2e includes dcp_v27_idle_cache_supported(dcp) in dcp_caches_scanout() so replay-capable firmware 27 panels use drm_gem_fb_create_with_dirty() and route DIRTYFB front-buffer updates through the atomic commit path instead of returning -ENOSYS.
  • Commit 0388c9334b8d merges main (351190d9b140) cleanly: dcp_comp_unbind() calls iomfb_v27_idle_cache_release_obj(dcp) before the PIODMA shutdown guard, dcp_platform_probe_pipe() keeps init_waitqueue_head(&dcp->typec_fw_wq) while channels_idle_wq stays in iomfb_queue_init(), and iomfb_v27_test.c preserves all 13 v27_cases[] entries (v27_rt_bw_doorbell_reply_test alongside the 5 v27_idle_* tests).
Evidence

Hosted CI & style checks at 0388c9334b8d

  • Apple build and KUnit: apple-build (SUCCESS, https://github.com/aurora-silicon/linux/actions/runs/46799214179/job/143181038663), KUnit plan (SUCCESS, https://github.com/aurora-silicon/linux/actions/runs/46799214179/job/143181038922), KUnit dcp-fabric dcp-topology dcp-display (SUCCESS, https://github.com/aurora-silicon/linux/actions/runs/46799214179/job/143190332365).
  • Host tests: host-tests (SUCCESS, https://github.com/aurora-silicon/linux/actions/runs/46799213605/job/143181033005).
  • pr-text: pr-text / pr-text (SUCCESS, https://github.com/aurora-silicon/linux/actions/runs/46799213971/job/143181030751).
  • pr-readiness: readiness / readiness (SUCCESS, https://github.com/aurora-silicon/linux/actions/runs/46799212551/job/143181025879).
  • git diff --check 351190d9b140..0388c9334b8d --: clean.
  • git diff 351190d9b140..0388c9334b8d -- | scripts/checkpatch.pl --strict -: 0 errors, 0 warnings, 1 CamelCase check on upstream DRM_MODE_CONNECTOR_eDP (2488 lines checked).

Live hardware at 0388c9334b8d

  • J313 (M1 Air, T8103, G13G, firmware 27.2, default cmdline, one-shot Stage 2 + GRUB): composite 807c3bbf2263 (origin/main d3de772ac0c1 + #3507, #3332, #3850, #3359, #3334 + #3410, #3300, #3289 0388c9334b8d):
    • Boot clean (0 Oops/BUG/WARNING/SError/Call trace; err+ lines subset of default kernel; speakerguardd-v2-switchtest.service failed identically on a separate #3321 build without #3359, not attributed to #3289; DCPDP2XService admission failed: -19 seen on the default kernel was absent).
    • Default-off confirmed: 0 idle-cache / replay lines in dmesg, checked before and after DPMS cycles.
    • Internal eDP-1 DPMS off/on PASS (>= 7 cycles over 3 boots, backlight 0 -> 130 each time; plus DP-2 DPMS when docked).
    • Deep S2R PASS: 3/3 docked deep S2R (rtcwake -d /dev/rtc1 -m mem -s 20, suspend_stats success 0->1, fail 0, 16 MB RAM integrity PASS, 0 Oops/WARN/SError; pre/post-sleep compute-check and render-check PASS). Software-undocked s2idle hung and is tracked separately under #3334.
  • J716c (M5 Max, T6050, firmware 27.2, default cmdline + watchdog.open_timeout=120, chained trial Stage 2): partial PASS in composite 8d250d354c97 (origin/main d3de772ac0c1 + #3717, #3398 + #3410, #3409, #3273, #3289 0388c9334b8d, #3359; dcp-internal.h and iomfb.c reconciled with #3398 keeping both field sets, dcp_push_try() passing unwind_on_err = false, and preserving iomfb_test_push_context()):
    • Clean desktop boot (0 Oops/WARN/BUG/Call trace; err+ lines: avd probe -2, M5 bare-metal bootstrap EPROBE_DEFER, systemd-gpt-auto-generator pair, boot-time apple-dcp ... AFK ... unable to match service; failed units: aurora-peripherals.service also on default, plus speakerguardd-v2-switchtest.service).
    • Default-off confirmed: 0 idle cache / replay lines in dmesg.
    • 3x eDP-1 DPMS off/on through Hyprland (hl.dsp.dpms): dpms Off/On follows, 3456x2234 restored, enabled, 0 Oops/WARN (open_ioav_gated(): IOAVVideoInterface open failed firmware syslog line on each DPMS-on, not compared against stock).
    • Pass stopped on s2idle (rtcwake -d /dev/rtc1 -m freeze -s 10, did not wake — matches known main RTC-wake behaviour); deep suspend/resume and post-sleep smoke were not run.
  • J713 (M4 Air, T8132, firmware 27.2): composite 25e08d2ee142 (origin/main d3de772ac0c1 + #3717, #3273, #3289 0388c9334b8d, #3300, #3359, #3409) built cleanly (kb run -p linux-j713, 352 s, exit 0); hardware pass not run while J713 is off-network.

Build, style, KUnit, and host tests at 4a6030e3598b

  • Merged origin/main (19ee1b5bc9d5) at 4a6030e3598b (resolving the v27_cases[] conflict in drivers/gpu/drm/apple/iomfb_v27_test.c to keep both v27_rt_bw_* and v27_idle_* tests).
  • ./scripts/checkpatch.pl --strict --git a4d28a5a72b7..df01a6cd9b2e: 0 errors, 0 warnings, 0 checks (14 lines checked in 962249cdc60f; 451 lines checked in df01a6cd9b2e); git diff --check origin/main...4a6030e3598b clean.
  • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --build_dir=_kunit_topo --kunitconfig=drivers/gpu/drm/apple/tests/topology.kunitconfig (apple-dcp-v27 subset 12/12 passed): 221 passed, 1 skipped (apple_g17_rx_util_min_test, needs CONFIG_UCLAMP_TASK), 0 failed (222 total).
  • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --build_dir=_kunit_disp --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig: 188 passed, 1 skipped (apple_g17_rx_util_min_test), 0 failed (189 total).
  • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --build_dir=_kunit_tests --kunitconfig=drivers/gpu/drm/apple/tests/.kunitconfig: 117 passed, 0 failed (117 total).
  • make O=_build_w1 LLVM=1 ARCH=arm64 W=1 drivers/gpu/drm/apple/ (defconfig + asahi.config, CONFIG_RUST=n, CONFIG_DRM_FBDEV_EMULATION=y): 0 errors, 0 warnings.
  • python3 -I tools/asahi/dcpext26-queue-tests.py and python3 -I tools/asahi/dcpext26-startup-tests.py: both pass.
  • HOSTCC="clang -Wno-unused-but-set-global" python3 -I tools/asahi/run-host-tests.py --only apple-dcp: 87/101 passed (14 pre-existing Clang 23 -Wunused-but-set-global failures unrelated to #3289; ok 72 - stale-crtc-poweroff, ok 73 - dropped-swap-teardown pass).
  • Prior kb run -p linux-j713 at df01a6cd9b2e (before the 4a6030e3598b main merge): full J713 kernel build passed.

Prior-head live hardware at df01a6cd9b2e (before 4a6030e3598b and 0388c9334b8d main merges)

  • J713 (M4 MacBook Air, T8132, firmware 27.2, on battery, default cmdline, one-shot Stage 2 with t8132-j713.dtb): standalone main + df01a6cd9b2e build (external display processors unprobed on main, +2 err):
    • Boot: apple-dcp 30ae00000.dcp: v27 idle cache active (mem=49151616 host=1) 8.3 s after boot.
    • DPMS off/on ×4 (hl.dsp.dpms, dynamic debug on iomfb_v27.c): every off 4 -> 0, every on 0 -> 1 -> 2 -> 4, replays 1 -> 5.
    • s2idle (rtcwake -m freeze -s 20): 4 -> 0 at suspend entry, 0 -> 1 -> 2 -> 4 after resume (replays 9 -> 10), suspend_stats fail 0.
    • fbcon (/proc/fb appledrmfb): chvt 3 took the cache 4 -> 0; it stayed at 0 for the 12 s on tty3 (also with three writes to /dev/tty3: no 0 -> 1); chvt 1 re-armed it (0 -> 1 -> 2 -> 4, replays 8 -> 9). A re-arm while on the text console was not seen; visual redraw of the console was not observed remotely.
    • DIRTYFB from state 4: not exercised (DRM_IOCTL_MODE_DIRTYFB returned EACCES (13) from a second client even as root, because the compositor holds DRM master, and the console never arms the cache, so there is no state-4 front buffer to dirty from the text console).
    • Live apple-dcp unbind from state 4 (echo 30ae00000.dcp > .../apple-dcp/unbind): returned 0, 4 -> 0, G16: fail-stop (ENODEV) for the GPU, retaining live DCP DMA resources after unbind; reboot required, 0 Oops/WARN/BUG/refcount/hung-task/call-trace lines; the reboot afterwards was clean.
    • Smoke: 0 failed units, 0 AppArmor denials, 0 oops/WARN, eDP-1 enabled; err lines = baseline 3 (AFK[ep:20], unsupported DFB layout 2560x1664, apple_sep) + 2 external display processor lines (286e00000.dcp / 48ae00000.dcp: -ENODEV, "no IOMMU domain").
  • J716c (16-inch M5 Max, T6050, firmware 27.2, AC 100%, default cmdline, default Stage 2 b0a2f222b5a9): one-shot composite trial kernel (Linux 7.3.0, main 429e7e15f122 + #3409, #3560, #3651, #3717, #3359, and #3289 df01a6cd9b2e merged cleanly with zero conflicts):
    • Default-off confirmed: 0 idle cache / replay / v27 idle-cache lines in dmesg (apple_dcp_hw_t6050 has no hw.v27_idle_cache), 0 DCP swap/commit/poweroff error lines.
    • 4x eDP-1 DPMS off/on (hl.dsp.dpms, hyprctl monitors dpmsStatus False then True): each restored 3456x2234@120, connector connected/enabled, 0 new dmesg err/warn lines.
    • Smoke: Apple MTP keyboard/trackpad and lid devices enumerated, wlan0 0% loss over 3 pings, AppleJ716 PCMs present, Borealis Apple M5 Max (G17C B1) vkcube --c 240 --wsi wayland clean, 0 LSM denials (capability, landlock, yama), 1 baseline failed system unit (aurora-peripherals.service, also on default), 0 failed user units, 0 GPU/MMU faults / Oops / BUG / WARN / SError lines (4 kernel err+ lines from base: systemd-gpt-auto-generator pair, aurora ... gpu: M5 bare-metal bootstrap failed at session: EPROBE_DEFER, avd missing-firmware probe -2). fbcon chvt / DIRTYFB replay paths not run (no replay on T6050).

Prior-head live hardware at 31e21a4ae8f4 (2026-11-28, before e50de028/a4d28a5a merges and 962249cdc60f)

  • J713 (M4 MacBook Air, T8132, firmware 27.2): batched kernel 76649338a1bc (J713 default kernel source 8dbfa2895b93 + PRs; default cmdline + panic=10), kernel image SHA-256 e8e9fd2813dd6347176d0e4a55a70d1c694bdab75817c3ab83c441c203140491, one-shot Stage 2 SHA-256 f7d4e2f7ebbfb423bd71f233f1aef7af0a39091b288a749d25f9250eb80adbfa, DTB ceacf1d413c651396f4c1dfd9fa27b15c710dd849e46c2753fcff0a23a6681c6. Parity: 31e21a4ae8f4 is an ancestor; 3/12 files blob-identical (2/10 runtime), 8 drivers/gpu/drm/apple/* files + dcp-internal.h carry all added lines with no removed line remaining (iomfb.c reconciled with daily dcp_push_try(), keeping both blocks).
    • apple-dcp 30ae00000.dcp: v27 idle cache active (mem=51117696 host=1) 22 s after boot (dynamic debug on iomfb_v27.c).
    • DPMS off/on ×4: every off logged state 4 -> 0, every on re-armed 0 -> 1 -> 2 -> 4 (replays 9 -> 16). s2idle: 4 -> 0, then 0 -> 1 -> 2 -> 4 after resume.
    • fbcon exclusion (addresses the J313 console-only fbcon freeze report): chvt 3 for 12 s dropped the cache 4 -> 0 at 199.99 s with no re-arm until chvt 1 at ~213 s (0 -> 1 -> 2 -> 4, replays 14 -> 15); vtcon1 bound, /proc/fb appledrmfb. Visual redraw not observed remotely.
    • Live apple-dcp unbind (echo 30ae00000.dcp > .../apple-dcp/unbind, last step of boot) returned 0 from state 4 (4 -> 0, retaining live DCP DMA resources after unbind; reboot required for 30ae00000/48ae00000/286e00000; GPU fail-stop G16: fail-stop (ENODEV) as expected) with 0 Oops/WARN/BUG/refcount/hung-task/call-trace lines; rebooted afterwards.
    • Smoke: eDP-1 2560x1664@60 enabled, MTP input enumerated, wlan0 0% loss, speakerguardd-v2 protected tone rc 0, Borealis glmark2 5,099, 0 failed units, 0 AppArmor denials; 4 err+ lines: 3 baseline (AFK[ep:20], unsupported DFB layout 2560x1664, apple_sep notice) plus 1 brcmfmac ring line also observed on the default kernel boot.
  • J716c (16-inch M5 Max, T6050, firmware 27.2): batched kernel 3545ebecb76f (origin/main b897ccb4e71c + 18 PRs, CONFIG_ARM_APPLE_SOC_CPUFREQ=m, AC power, default cmdline), Image.gz SHA-256 d56efde4c7232208bd29d5c4e5890319e0050595dd4f4b1c3844df6656a08312, t6050-j716c.dtb d2f0db7a5026ae9cc4e1cff61dca38b4d1b363d47e5bad696ef65c7d715517e0, modules 9d5782bcf02ea60a225278c9319431f902b495f6beb485d79d127c0fb2fccc92, one-shot Stage 2 b7d99286395ddd7dadccc6d9593f4bd55391d9e787af97c18b45f58688d9885d. Parity: 31e21a4ae8f4 is an ancestor; 4/12 files blob-identical, 8/12 hunks-present (dcp-internal.h reconciled with #3410 keeping both field blocks; iomfb.c reconciled with #3410 keeping iomfb_test_push_context and adapting dcp_push_try() to dcp_push_context(..., unwind_on_err = false), and with #3399 keeping dcp_crtc_prepare_hdr()/vrr_only alongside iomfb_v27_idle_cache_invalidate() before dcp_mode_begin()).
    • Default-off confirmed: 0 v27 idle-cache lines in dmesg for the whole boot; eDP-1 3456x2234@120 enabled, 3× DPMS off/on (eDP-1 restored cleanly each cycle with 0 kernel DCP warnings/errors and 3 transient DPMS-on firmware syslog notices), 2× freeze + 2× mem pm_test=devices and 2× pm_test=platform clean, 0 DCP warnings/errors; 6-item smoke pass (0 failed user units, 0 LSM denials, aurora-peripherals.service warm-reboot baseline failure also on default/control; 40 err+ lines all pre-existing vs 55-line default boot except PM: suspend debug and the 3 DPMS-on firmware syslog notices).
  • J313 (M1 MacBook Air, T8103): batched Group A (main + 9 PRs, undocked on battery, all PR changed files parity-identical against main), kernel SHA-256 888c041944da96032a9252504c4d5543b906fd98717234eca5e091150af85798, one-shot Stage 2 SHA-256 949dc089ed390b7535dd5ef2a6e99975c3026658e58dbd9d17e9b20d2bbb7d71:
    • Boot smoke pass (eDP-1 enabled, keyboard/trackpad, wlan0, audio enumerated, Borealis Apple M1 (G13G B1) compute/render OK), 0 AVC denials, 1 baseline failed unit (speakerguardd-v2-switchtest.service also on baseline main ee36fbdcd1c8 SHA-256 f750b04aebd30c439edbd3b995c17b3fd9ad805a4561dadc7ecbf78040c89289), 3× DPMS off/on pass, 2× deep S2R (rtcwake -d rtc1 -m mem -s 30) pass (0 Oops/BUG/WARN; post-S2R ISP capture failed after the 1st deep resume in Group A with apple-isp firmware boot -19 / DART translation fault vs passed after the 1st deep resume on baseline main, unisolated, tracked under #3329).

Earlier-head live hardware at c85087653bd4 (default command line)

  • J713 (M4 MacBook Air, T8132, firmware 27.2):
    • v27 idle cache activated: v27 idle cache active (mem=51117696 host=1).
    • 3× DPMS off/on cycles: every off transitioned 4 -> 0, every on transitioned 0 -> 1 -> 2 -> 4, replays advanced 2 -> 3 -> 4 -> 5.
    • 3× s2idle cycles: every suspend transitioned 4 -> 0, every resume transitioned 0 -> 1 -> 2 -> 4, replays advanced 6 -> 9, 0 DCP errors.
    • fbcon (appledrmfb) exclusion: after stopping the compositor and switching to tty3, cache dropped 4 -> 0 with 0 0 -> 1 re-arms over ~10 s (replays held at 12); re-armed after compositor restart (replays 13). Visual redraw was not observed remotely.
    • Live apple-dcp unbind in state 4 returned 0 (4 -> 0, DCP firmware powered off, retaining live DCP DMA resources after unbind; reboot required) with 0 Oops/WARN/BUG/refcount/hung-task/call-trace lines (as logged, live unbind tears down /dev/dri and requires a hard reset on reboot).
  • J716c (M5 Max 16" MacBook Pro, T6050):
    • Idle cache disabled: 0 v27 idle-cache admission/negotiation messages.
    • eDP-1 3456x2234@120 connected; 2× appledrmfb DPMS blank/unblank cycles (Off -> On, 3456x2234 restored) and 2× pm_test=devices cycles clean; 0 DCP/DRM warnings or errors.
  • J313 (M1 MacBook Air, T8103):
    • eDP-1 2560x1600@60 connected (appledrmfb fb1), 4× DPMS off/on cycles clean, survived 5× s2idle + 5× deep sleeps with dpms=On, 0 kernel WARN/Oops/DRM errors.

Earlier-head live hardware at f7e6fb162951 (batched candidates, default command line)

  • J713 (M4 MacBook Air, T8132, firmware 27.2), candidate b3dbf237542b over main 9e38a276dcb4, Linux 7.3.0, default Stage 2: clean boot, 0 failed systemd units, 0 panics/Oops/BUG/SErrors/DART faults/LSM denials; eDP-1 2560x1664@60; Borealis Apple M4 (G16G B0). 30ae00000.dcp: v27 idle cache active (mem=51117696 host=1). With eDP-1 active the cache transitioned 0 -> 1 -> 2 -> 4 across 3x real DPMS off/on cycles (dpmsStatus 0 -> 1 x3; 4 -> 0 on DPMS off, re-entering 0 -> 1 -> 2 -> 4 on DPMS on, replays=12..18), reaching replays=21..24 through 3x s2idle (rtcwake -d /dev/rtc1 -m freeze -s 5, 3/3 PASS, dpmsStatus=1 on every wake). 0 DCP/IOMFB errors.
  • J716c (16-inch M5 Max, T6050), candidate c3da8eed6f72 over main 9af21b007425, Linux 7.3.0, default Stage 2, AC 100%: single boot ID, 0 panics/Oops/BUG/SErrors/DART faults/GPU faults/LSM denials, eDP-1 3456x2234@120. 48ae00000 negotiated and went 0 -> 1 -> 2 (observed with dynamic debug dev_dbg), returned to 0 on DPMS off and re-entered 1 -> 2 on DPMS on with 0 v27 idle-cache ... failed/refused warnings, replays=0, and state 4 never reached (now disabled via default-off hw.v27_idle_cache).

Historical earlier-head unplugged hardware coulomb-counter A/B on J713 (macsmc-battery/charge_counter, BAAC, 1 mC/count)

Measured back-to-back on J713 M4 MacBook Air (macsmc-ac/online=0, discharging, 60 s settled after 20 s post-boot settle + 10 s per-step settle, kbd=0, wifi_ps=off, P_coulomb = |dCC| * V_avg / dt; voltage sampled every 10 s; historical measurement on earlier test build c05e2a268684, which differed from ba76eb6e18f7 in mailbox error handling and DMA-retention timing, and predates the subsequent main merges — not yet refreshed at 0388c9334b8d):

Condition Baseline (859e8a29796c) With idle cache (v27 state 4 active) Delta
Display ON, bl=5 1,913.2 mW (-8,757 mC, 13.1089 V) 1,823.9 mW (-8,323 mC, 13.1483 V; repeat 1,827.0 mW) -89.3 mW (-4.7%)
Display ON, bl=150 3,663.9 mW (-16,808 mC, 13.0791 V) 3,576.3 mW (-16,358 mC, 13.1177 V; repeat 3,578.7 mW) -87.6 mW (-2.4%)
DPMS OFF (control) 748.3 mW (-3,420 mC, 13.1279 V) 752.6 mW (-3,424 mC, 13.1876 V) +4.3 mW (noise)

Earlier-head kernel log excerpt (J713 firmware 27.2, default cmdline, ba76eb6e18f7)

[    3.644492] apple-dcp 30ae00000.dcp: v27 idle cache active (mem=51117696 host=1)
[   21.985163] apple-dcp 30ae00000.dcp: v27 idle cache state 0 -> 1 (mem=51117696 host=1 replays=2)
[   21.985317] apple-dcp 30ae00000.dcp: v27 idle cache state 1 -> 2 (mem=51117696 host=1 replays=2)
[   22.013682] apple-dcp 30ae00000.dcp: v27 idle cache state 2 -> 4 (mem=51117696 host=1 replays=3)

Wire up static-frame idle caching for firmware 27 internal panels. After a
normal KMS swap completes as displayed and remains static for 1 second,
allocate a reusable DMA cache surface sized for the active scanout layout,
negotiate replay via applyProperty(138, 2) on A352 (latching unavailable
if firmware refuses), and submit a replay swap (swap_intent = 8) so the
display controller services scanout from local cache while idle.

Handle firmware idle-cache callbacks (D116 state transitions, D579/D580
fence lifecycle, D581 surface release), validate surface layout and buffer
size on every registration (reallocating only after release), guard
against stale templates with a monotonic generation checked under IOMFB
serialization, close replay admission before draining work while keeping
outstanding replay swap IDs filtered until consumed or reset, and preserve
the cache DMA allocation across retained-DMA shutdown/unbind paths.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb
erikwb requested review from a team as code owners November 26, 2026 18:07
@erikwb
erikwb requested review from LiamRay11 and maralcbr November 26, 2026 18:07
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (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 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Merge readiness at fb84ed71: not ready yet

Check Detail
CI at head ok 9 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA fb84ed71, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · T8132 firmware-27 internal panels (appledcphwt8132v27); iomfbqueueinit() wait-queue initialization across DCP interfaces; unverified profiles and T6050 remain off by default Revert: git revert restores default-off behavior across all profiles, dcp_caches_scanout() M4-only scope, and channels_idle_wq initialization in dcp_platform_probe_pipe() with no persistent on-disk, DT, or firmware state (apple-dcp live unbind after replay registration retains DMA until reboot, as with any adopted live DCP session).

Areas: area:display, area:gpu

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

dcp_push_context() now calls dcp_send_message_checked() so idle-cache
callers can unwind unsent mailbox commands on send error. Provide the
matching stub in the dcpext26-startup-tests transport fixture.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb
erikwb requested a review from DjDeveloperr as a code owner November 26, 2026 19:15
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) needs-hw-row No hardware row at the PR head (bot) labels Nov 26, 2026
@erikwb

erikwb commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Hardware check on J716c (16" M5 Max, T6050) at ed0e9648f90c (tested unchanged in batched trial kernel with #3288 + #3289, default command line): PASS (with one state-reporting note below).

  • Clean boot (eDP-1 3456x2234@120 + paired DP-1 3840x2160@240 + paired DP-4 3840x2160@240, 0 new kernel errors, 0 blanking or corruption).
  • 48ae00000.dcp negotiates applyProperty(138, 2) (status=0), registers the replay swap (mem=92648064, host=1), and transitions v27 idle cache state 0 -> 1 -> 2 after 1 s of static output, with periodic 2 -> 6 -> 2 cache refreshes granting D579 fences.
  • Survived 3× full DPMS OFF/ON cycles across internal + paired external displays, cleanly dropping 2 -> 0 and re-entering 0 -> 1 -> 2 after each wake.
  • Note for H17G / J716c: Firmware settles in state 2 (never transitioning to state 4), so v27_idle_replays stays 0 and the one-shot dev_info("v27 idle cache active ...") (gated on state == DCP_V27_IDLE_STATE_ACTIVE == 4) never logs at info level — state transitions were verified via dynamic_debug (iomfb_v27.c).

@github-actions github-actions Bot added merge-conflict Conflicts with the base branch (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Nov 26, 2026
@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) merge-conflict Conflicts with the base branch (bot) and removed merge-conflict Conflicts with the base branch (bot) labels Nov 27, 2026

@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: Changes requested at 021728a98ebd.

The M5 Max row reaches setup state 2 but never reaches active replay, and records zero replays. That demonstrates setup and DPMS recovery on the earlier integration, but leaves the behavior advertised for M5 unverified. Please attach a current-head M5 row with a real replay and teardown, or gate admission on a demonstrated replay capability. Also include an injected failed submit after IOVA preparation to show the new channel unwind and session release preserve callback and DMA ownership. Hosted CI is green.

Add KUnit test coverage in apple-dcp-v27 for an injected mailbox send
failure on swap_submit after the idle-cache DMA surface (IOVA) and
live-session retention references have been prepared.

Verify that dcp_push_context() unwinds the failed command slot, leaves
outer channel callbacks and cookies intact, preserves subsequent command
callback delivery, clears pending idle-cache swap state without filtering
a normal swap ID, aborts the uncommitted session retention references, and
preserves a prior DMA pin while allowing unpinned DMA surface release on
unbind.

Signed-off-by: Erik Bourget <erik@ebourget.net>
Avoid scheduling an asynchronous ack work item for the manual-ack
sentinel command in v27_idle_failed_submit_unwind_test() so the
pending depth check and explicit iomfb_recv_msg() ack do not race.

Release iomfb.lock and clear iomfb.owner before evaluating the fatal
KUNIT_ASSERT_EQ() checks in
v27_idle_unwind_preserves_outer_callback_and_pin_test() so a failing
assertion cannot abort while holding the lock taken by cleanup.

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

Copy link
Copy Markdown
Contributor

Tested on J313 (M1 MacBook Air, T8103, firmware 27.2.1) via ewb/j313-daily (786ad8d1e498, which merges 021728a98ebd / ba76eb6e18f7) on a console-only (fbcon) Debian setup (no Wayland compositor running):

Issue: fbcon freezes after 1 second

  • At t=9.978s (1 s after fbcon takes over), 231c00000.dcp logs v27 idle cache active (mem=49151616 host=0) and switches scanout to the replay cache surface.
  • Because apple_drv.c uses drm_gem_fb_create (without drm/apple: turn framebuffer damage into a commit #2797's fbdev damage commits), fbcon draws directly into its single DMA framebuffer in place without issuing KMS page-flips. Once DCP enters replay, the display freezes permanently on that 1-second snapshot (verified keyboard input was still arriving in /dev/vcs1 underneath, and toggling /sys/class/graphics/fb0/blank 1 -> 0 only unfroze it for 1 second before replay re-engaged).

Secondary note

  • appledrm.idle_cache_ms only controls iomfb_m4.c; iomfb.c hardcodes DCP_V27_IDLE_CACHE_DELAY_MS = 1000U, so setting appledrm.idle_cache_ms=0 does not disable v27 idle caching on this path.

Workaround / suggested fix

Skipping idle-cache admission in iomfb_v27_idle_cache_on_present() when the active primary FB is the fbdev framebuffer (fb == fb->dev->fb_helper->fb) keeps fbcon live while leaving replay caching intact for KMS compositors (or gating on #2797 if fbdev damage commits are intended to exit replay). Wiring a runtime disable/delay parameter similar to iomfb_m4.c would also be useful for debugging.

@erikwb

erikwb commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Added KUnit coverage for the injected failed-submit unwind and session-release paths in 125129d93ae9 and f7e6fb162951 (drivers/gpu/drm/apple/iomfb_v27_test.c):

  • Failed swap_submit after IOVA and session preparation (v27_idle_failed_submit_unwind_test): Exercises iomfb_v27_idle_cache_work() -> A352 negotiation -> drm_gem_dma_create() + dcp_retain_live_session_prepare() -> A406 swap_start -> iomfb_v27_idle_swap_started(), then injects -EAGAIN from dcp_send_message_checked() (via a CONFIG_DRM_APPLE_KUNIT_TEST-only test_send hook) after A408 swap_submit arms ch_cmd with surf_iova[0] prepared. Verifies dcp_push_context() unwinds ch_cmd.depth and clears slot 0 (callbacks, cookies, output, end), clears v27_idle_submitting/v27_idle_swap_pending/v27_idle_swap_id without swallowing normal swap completions, aborts the uncommitted session retention (dcp->retain_dma == false, dcp_test_session_retained() false, device kref back to baseline), preserves subsequent dcp_push() callback delivery on ch_cmd (with a manual-ack sentinel and single explicit iomfb_recv_msg() completion), and releases v27_idle_obj cleanly on iomfb_v27_idle_cache_release_obj().
  • Outer slot callback & prior DMA pin preservation (v27_idle_unwind_preserves_outer_callback_and_pin_test): Injects -EAGAIN at ch_cmd.depth == 1 (iomfb_test_push_context()) with iomfb.lock / iomfb.owner released before fatal assertions, and verifies slot 0's callback and cookie stay intact and fire on ack; also verifies a prior v27_idle_dma_pinned owner survives a failed re-submit while a clean swap_submit commits dcp->retain_dma and iomfb_v27_idle_cache_release_obj() preserves the retained v27_idle_obj object (keeping full unbind verification in the hardware row).
  • Verification at f7e6fb162951: apple-dcp-v27 KUnit 5/5 passed, topology.kunitconfig 210 passed / 1 skipped, display.kunitconfig 167 passed / 1 skipped, dcpext26-queue-tests.py and dcpext26-startup-tests.py passed, scripts/checkpatch.pl --strict --git 021728a98ebd..HEAD clean (0 errors, 0 warnings, 0 checks), and LLVM=1 ARCH=arm64 W=1 drivers/gpu/drm/apple/ compiled with 0 warnings.

Regarding the M5 Max row: the earlier J716c test at ed0e9648f90c ran with paired DP-1 and DP-4 active and stayed in state 2 (2 -> 6 -> 2 refreshes, 0 replays). Current-head hardware at f7e6fb162951 (default command line): J713 (firmware 27.2, batched candidate b3dbf237542b) logged v27 idle cache active (mem=51117696 host=1) and went 0 -> 1 -> 2 -> 4 after each of 3x DPMS off/on cycles and through 3x s2idle (replays=21..24) with 0 DCP/IOMFB errors. J716c (batched candidate c3da8eed6f72, standalone eDP-1) negotiated and went 0 -> 1 -> 2, returned to 0 on DPMS off and re-entered 1 -> 2 on DPMS on with no refusal warnings, but still replays=0 and never reached state 4, so active replay is not yet verified on T6050; if it stays at setup state 2, admission will be gated on a demonstrated replay capability.

@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 new KUnit cases address the failed-submit unwind and retained-owner checks. J713 demonstrates replay at this head. J716c still stops at setup with zero replays, even with the internal panel alone. Please demonstrate active replay there or restrict admission using a verified replay capability. Also record the live-session unbind result once that path is tested.

@DjDeveloperr DjDeveloperr removed the merge-conflict Conflicts with the base branch (bot) label Dec 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Review at 0b097c67b7e9: the code is fine to merge once the hardware rows below are in.

I read the full diff. The idle-cache worker takes its state under v27_idle_lock. It negotiates before it allocates the cache or retains the session, so a refusal leaves the panel rebindable. Retention is committed only after swap_submit has been sent. A failed send clears only the slot it pushed, and only on this path (unwind_on_err). Every other dcp_push_context() caller keeps the old behaviour. Cancel and release run before the PIODMA shutdown guard at unbind. Replay stays off by default and is enabled only on the T8132 firmware-27 profile, where replay has been shown to work. The last forward merge only renames dcp_send_message_checked() to main's dcp_send_message_ret() and keeps the KUnit send hook. That resolution is correct.

Local checks on a merge with main b3a5fda631b9 (merge-tree clean, merge tree 07835a634c58), on the x86_64 build box:

  • make ARCH=arm64 LLVM=1 W=1 drivers/gpu/drm/apple/ (aurora_defconfig, CONFIG_DRM_APPLE_KUNIT_TEST=m): 47 objects rebuilt, including iomfb_v27_test.o, with 0 warnings and 0 errors. main alone was also clean. The KUnit cases compiled and linked but were not run (no QEMU here).
  • git diff main..merge | scripts/checkpatch.pl --strict --no-signoff -: 0 errors, 0 warnings and 1 check (the continuation-line alignment after the rename in dcp_push_context()).
  • git diff --check main..merge: clean.
  • python3 -I tools/asahi/run-host-tests.py --jobs 16 (full suite, in the hosted workflow's ubuntu 24.04 image with clang 18 and rust 1.96, no network): 967/969 passed, including apple-dcp, dcp-tunnel, dcpext26-startup and dcpaud-open. The 2 failures are centauri-scan-tests and its negative controls, which fail the same way on plain main (the Bluetooth harness doesn't build there).

Still needed before merge: hardware rows at exact head 0b097c67b7e9 on two generations. The existing rows are at 0388c9334b8d, before the last main merge.

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Dec 2, 2026
Bring in main ccb3d8b, which now carries #3410. Keep both the
external idle power-off fields and the firmware 27 idle-cache fields in
struct apple_dcp. Take main's dcp_push_try() and pass unwind_on_err =
false there, so only the idle-cache submit unwinds a failed send, and
keep the KUnit iomfb_test_push_context() wrapper.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Contributor

J773g (T8132 / M4 mini) 0b097c6 (0b097c67b7e970a8e656a5641d116f74c93853e1) PASS — composite 7.3.0-j773g-comp2-3332-3809 (main b3a5fda6, merge tree 27b8f0f690ec, boot_id=427c8f95, panic=10, WDT 178 s): external-only J773g control (panel-gated v27 idle cache inactive as expected, 0 v27 idle-cache/refused warnings), DP-3 (3840x2160@60) passed DPMS Off/On (rc=0), forced connector replug (off->detect), and 3x s2idle with plasmalogin active, 0 DART faults, 0 WARN/Oops, 0 failed units.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Forward-merged main ccb3d8bd1b32 at a74ae40960c3, because #3410 landed and this branch conflicted in dcp-internal.h and iomfb.c. The merge keeps both the external idle-off fields and the idle-cache fields. It also takes main's dcp_push_try() with unwind_on_err = false and keeps iomfb_test_push_context(). With this head, arm64 W=1 drivers/gpu/drm/apple/ builds clean (0 warnings, with both PRs' KUnit cases linked), checkpatch output is unchanged, and these host tests pass: apple-dcp, dcp-tunnel, dcpext26, dcpaud, backlight-coldboot, display-sleep-merge, afk. The hardware rows now need this head.

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) and removed merge-conflict Conflicts with the base branch (bot) labels Dec 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

No forward merge is needed at a74ae40960c3. It still merges cleanly into main 87c01c2c901d. GitHub's test merge (refs/pull/3289/merge, parents 87c01c2c and a74ae409) has tree 65a1de8d7403, and git merge-tree --merge-base=ccb3d8bd1b32 produces the same tree. It also merges cleanly into 1262f9e1b6af. The dcp-internal.h, dcp.c and iomfb.c conflicts seen in a local check came from a shallow clone that found a second merge base, 18edb08ad329, which is really an ancestor of ccb3d8bd. I left the head unchanged so rows already running at a74ae409 still count.

Checks on merge tree 65a1de8d (x86_64 build box, warm O=):

  • make ARCH=arm64 LLVM=1 W=1 drivers/gpu/drm/apple/ (CONFIG_DRM_APPLE_KUNIT_TEST=m) rebuilt 68 objects with 0 compiler warnings and 0 errors. These include dcp.o (with main's dcp_s2r_test.c and dcp-firmware-test.c included), iomfb.o, iomfb_v27.o, iomfb_v27_test.o and apple_drv.o. DTC printed the existing audio-no-sio-test.dtso address-size warning. The KUnit cases compiled but were not run, since there is no QEMU on the build box.
  • tools/asahi/run-host-tests.py --only passed for dcp-tunnel (18/18), dcpext26 (23/23), dcpaud (22/22), backlight-coldboot (2/2), display-sleep-merge (1/1) and afk (13/13).
  • apple-dcp passed in full in the hosted workflow's ubuntu 24.04 image. On the build box's own toolchain, 87/101 pass. The 14 failures are in USB, mux, PM and panel-takeover cases, not the idle-cache code.

The hardware rows still need head a74ae409.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Host-tests at a74ae40960c3 passed 996/998. Both failures were Centauri cases from the hosted merge on main 87c01c2c901d, before #3987 fixed the shared harness. I merged the same head locally onto b47fc630ebd9 (tree 3f6b8850a97d). The fixture and its three source files match main byte-for-byte. In the CI Ubuntu 24.04 container, taskset -c 4-23 python3 -I tools/asahi/centauri-scan-tests.py and the same command with --negative-controls both passed.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

J773g a74ae40 PASS (7.3.0-j773g-comp4-2856-3227 on main 1262f9e, boot_id=a2fdb8dc-5904-45ba-aca5-cd6391aa061a; boot clean with 0 WARN/Oops; dmesg "idle cache|replay" count=0; 4x DPMS off/on + 10x DRM off->detect replugs on external DP-3 3840x2160 OK; chvt 3 console update verified in /dev/vcs3 and chvt back to VT1 OK; 3x s2idle OK; 0 DART faults, 0 failed units)

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Dec 2, 2026
Main 110d84f. The only textual conflict was the case list in
drivers/gpu/drm/apple/iomfb_v27_test.c: main added
v27_hdmi_pq_from_sdr_test (#3952) where this branch added its five
v27_idle_* cases. Keep all six.

dcp.c, dcp-internal.h, iomfb.c and lifecycle.py merged without conflicts.
dcp_crtc_atomic_modeset() drops the idle-cache template before either mode
set of the SDR-then-PQ sequence runs.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@github-actions github-actions Bot added merge-conflict Conflicts with the base branch (bot) needs-hw-row No hardware row at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Dec 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Merged main 110d84f8ec93 into the branch with a merge commit (merge tree 45f084930cad). #3952 had made it conflict.

What the merge resolved. The only text conflict was the KUnit case list in iomfb_v27_test.c: main added v27_hdmi_pq_from_sdr_test where this branch added its five v27_idle_* cases. All six are kept, and dcp-internal.h is still included once. dcp.c, dcp-internal.h, iomfb.c and lifecycle.py merged on their own, and I read those hunks too:

  • dcp_crtc_atomic_modeset() drops the idle-cache template once, before both mode sets of drm/apple: set SDR before PQ on an HDMI link not yet settled #3952's SDR-then-PQ sequence, so nothing can start a replay between them. On an HDMI pipe the call only clears unused state.
  • _dcp_poweroff(), dcp_hdmi_observed() and the hdmi_link_settled writes are exactly as on main. The soft-DPMS path of a panel returns before _dcp_poweroff(), and only a panel can have an idle cache, so the two features never run on the same pipe.
  • dcp_s2r_warm_restart() keeps main's reordered DART wake (dcp_s2r_wake_darts()) and still resets the idle cache first. The new dcp_s2r_test.c case reaches that reset with no firmware set, where it returns at once.

The PR's own diff is line-for-line the same as before the merge, apart from that shared include.

Local checks on the merged tree (x86_64 build box):

  • linux-build/build kernel --profile asahi <tree> -- W=1 drivers/gpu/drm/apple/ (arm64, LLVM): all 67 display objects rebuilt, with the KUnit cases built in. 0 warnings, 0 errors.
  • The same build with CONFIG_DRM_APPLE_KUNIT_TEST off: no compiler warnings. DTC prints the audio-no-sio-test.dtso address-size warning that main already has.
  • tools/testing/kunit/kunit.py build --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/topology.kunitconfig: builds and links with all six cases in vmlinux. Not run, because the build box has no arm64 runner.
  • python3 -I tools/asahi/run-host-tests.py --jobs 16 (full suite, in the hosted workflow's ubuntu 24.04 image): 1020/1020. The two Centauri failures of the last hosted run are gone with main's fix.
  • scripts/checkpatch.pl --strict on each of the PR's eight own commits: 0 errors, 0 warnings, 0 checks. The combined diff against main has one alignment check in dcp_push_context(), as before.
  • It also merges cleanly into the newer main 53732c475cb2.

Review: I read the full diff against main again and found nothing that blocks it. Idle caching stays limited to the T8132 firmware-27 panel profile. That profile already keeps its adopted session until reboot, so replay changes nothing about unbind or shutdown there.

Not run yet:

  • J773g is owed again at the new head, because the DCP code under it changed.
  • A second generation with an internal panel on firmware 27 (J714s) is owed too: the callback table, the send path, suspend and DPMS are shared, and the mini has no panel to exercise them.
  • Active replay needs a T8132 panel (J713). It last ran before the recent main merges.

@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 19c91f5

Checked: Since the previous approval, the production delta moves the wait-queue initializer to the shared IOMFB initializer and routes caching-capable scanout through the dirty callback. Probe initializes the queue before publishing the DCP. The KMS path takes the dirty callback for a caching CRTC, excludes the separate T8132 external CRTCs and keeps the distinct framebuffer ops on the non-caching clients. Replay admission still requires a capable internal panel, and the new KUnit case exercises the dirty callback through an atomic commit.

@RyanTheTide

Copy link
Copy Markdown
Contributor

J713 row at exact head 19c91f5a: no regression, but the idle cache never engaged on this J713 (13" MacBook Air M4, T8132, firmware 27.2, appledrm.idle_cache_ms=1000)

A = saved 7.3.0-aurora-fleet94; B = one-shot kernel built from 19c91f5abb31 with the fleet config (only DRM_APPLE_DISPLAY_KUNIT_TEST off, for main's current snd_pcm_lib_preallocate_free modpost break with DRM_APPLE=m/SND=m), BLS one-shot entry, saved default unchanged. GNOME session up, internal panel only.

Method: ftrace function tracer filtered on every iomfb_v27_idle_* function present in B (21 of them, e.g. _cache_kick, _cache_work, _send_swap_start, _swapped). Fresh frames were forced by turning GNOME clock seconds on, and "static" means clock seconds off with nothing else drawing.

A fleet94 B 19c91f5a
static desktop, 12 s (no idle-cache code) 0 calls
frames every second, 6 s (7 frames) - fb_eligible 7, on_present 14, on_displayed 7, swap_complete 7, surface_span 7, retry 1; no cache_kick, cache_work or send_swap_start
static again for 8 s right after the last frame - 0 calls: the 1 s idle work never ran, so no cache surface was registered (replay not entered)
DPMS off/on connected, On connected, On
s2idle (rtcwake -d rtc1 -m freeze -s 20) resumes resumes
one deep sleep (rtcwake -d rtc1 -m mem -s 25) resumes (0.32 s resume) resumes (0.32 s resume)
idle-cache warnings / DCP errors / DART faults / WARN 0 / 0 / 0 / 0 0 / 0 / 0 / 0

So nothing regresses (display, DPMS, s2idle and deep all as base), but the static desktop does not enter replay on this J713. The per-frame hooks run, yet iomfb_v27_idle_cache_kick is never reached, so the scanout buffer is apparently never accepted by iomfb_v27_idle_cache_fb_eligible() (or a later gate) for GNOME's framebuffers here. "Exits on input" can't be judged without an entry. If there's a debug switch or a dynamic-debug site that says why it isn't eligible, I can re-run with it. The one failed unit on B is speakerguardd-v2-switchtest (non-fleet kernel), unrelated. Restored afterwards: saved fleet94, test kernel removed, SELinux Enforcing.

@github-actions github-actions Bot added merge-conflict Conflicts with the base branch (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Dec 3, 2026
Keep main's external idle-off and DART save/restore flags alongside
the firmware-27 panel replay capability.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Forward-merged main cff875630c61 as fb84ed7145a0. The only conflict was in dcp-internal.h, where main's external-idle and DART flags now sit alongside v27_idle_cache. The added and removed lines match the previous PR in every file. On PC, the arm64 W=1 Apple DRM objects linked with zero warnings and errors on the same DCP sources before #3629. The DCP, display-sleep and IOMFB host checks passed 105/105 on the final head. The prior J713 smoke remains useful as a control. With #3629's T8132 sleep wiring in this base, a fresh J713 run needs to exercise active state-4 replay and exit as well as sleep and wake.

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) and removed merge-conflict Conflicts with the base branch (bot) labels Dec 3, 2026

This branch has not been deployed

No deployments
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) area:gpu Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (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.

5 participants