Skip to content

drm/apple: v14.7: take primary planes that reach past the mode's edge - #2152

Merged
RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
scottjones:upstream/dcp-v14.7-primary-planes
Nov 26, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
scottjones:upstream/dcp-v14.7-primary-planes

Conversation

@scottjones

@scottjones scottjones commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

iomfb_v14_7_atomic_check() compared the plane's raw src/crtc fields with the mode, so it rejected with -EINVAL a primary plane whose destination reaches past the right or bottom edge. The uAPI allows that plane, and apple_plane_atomic_check() has already clipped it.

KWin builds such a plane when mirroring (a 1921x1080 plane on a 1920x1080 mode). Every commit failed, the external display showed nothing, and after a hotplug KWin retried a modeset that included the panel on every frame.

The check now uses the clipped state. A KUnit file covers the plane rules.

Evidence

  • Built on integration/aurora a7dd26e6d60e with the 7.3 package config, LLVM 18 and Rust 1.85:
    • make W=1 drivers/gpu/drm/apple/: builds
    • W=1: no warnings the base does not have
    • run-host-tests.py: every tools/asahi test is registered
    • KUnit on arm64 QEMU (stacked tree, PR-related Apple suites): apple-dcp-v14-plane (new) 15/15 parameter cases pass.
    • Stacked with the other 12 PRs on the same base, the full kernel, modules and DTBs build and package (linux-aurora 7.3.0-0testastip2-1-ARCH, 137 DTBs).
  • Booted as part of the full set: a kernel built from integration/aurora a7dd26e6 plus all 13 branches of this set (before the three small fix-up commits) booted on an M3 MacBook Air (J613), a Neo (J700) and an M1 Pro with no regressions against their baselines (on the M1 Pro, only the checks already known to differ: GPU name and DRAM OPP), and a 25-minute GPU soak was clean on all three. No M3 Pro, M3 Max, J504, J615 or M4 Pro ran this kernel.
  • Reported on a J514S (M3 Pro) mirroring onto DisplayPort glasses, per the author's commit message.

Merge Danger

Door: two-way

Blast Radius: display

v14.7 display path only; it accepts planes it used to reject.

The 14.7 presenter scans out one unscaled image of the mode's size from
the top-left of the framebuffer, and iomfb_v14_7_atomic_check() admitted
only planes that describe exactly that. It compared the plane's raw
src_* and crtc_* fields with the mode, so it rejected a plane whose
destination reaches past the right or bottom edge of the CRTC with
-EINVAL. The DRM uAPI allows such a plane: apple_plane_atomic_check()
has already clipped it with drm_atomic_helper_check_plane_state()
(can_position is true), and the part left on the mode is what the
presenter shows.

KWin puts up such a plane when it mirrors one output on another. On a
J514S (M3 Pro), with the 3024x1964 panel at scale 1.7 mirrored onto an
XREAL One (1920x1080 over DisplayPort alt mode), it centres a 1663-pixel
wide picture and rounds the 128.5-pixel border up on both sides, so the
external primary plane is 1921x1080 on a 1920x1080 mode. Every frame on
the glasses then failed its commit, and they showed nothing. Once the
glasses dropped and asserted HPD again, the connector's link-status
went bad and KWin forced a modeset that included the panel. That commit
failed on the same plane, and KWin retried it on every frame, so the
panel froze too, with the pointer: around 350 failed commits a second
until the mirror was turned off.

Judge the plane by its clipped rectangles instead: the clipped source
must start at the framebuffer's origin and, like the clipped
destination, be of the mode's size. Hand the presenter the clipped
source size on external pipes. Planes that start left of or above the
mode, are offset into the framebuffer, are scaled or do not cover the
mode are still rejected, and the panel still takes only a framebuffer of
its mode's size, as before. A plane that the old check admitted has
clipped rectangles equal to its raw ones, so it is judged and shown as
before.

The new KUnit suite runs drm_atomic_helper_check_plane_state() with the
limits apple_plane_atomic_check() passes it, and checks which planes are
admitted and, through the helper flush uses, what size the presenter is
given.

Fixes: 98d767e ("drm/apple, media: apple: avd: T6030 internal panel, external display and AVD fixes")
Signed-off-by: Eryk Wieliczko <[email protected]>
Signed-off-by: Scott Jones <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor

The production boot stub pins at macOS 27.2 (26B123), so please retarget this to 27.2. This changes the v14.7 display path only; please make the 27.2 DCP path the supported case.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 1.

  1. Commit 59b4288 carries Assisted-by: Claude:claude-opus-5-5 in the commit message. Keep commits to the human Signed-off-by lines and move the Assisted-by note to the last line of the PR body (it currently ends with a "Generated with Claude Code" line instead).

The change itself checks out: iomfb_v14_7_atomic_check() runs from dcp_crtc_atomic_check() after apple_plane_atomic_check() (plane.c:257) has clipped the plane, so p->src/p->dst are valid there; dcp_v14_plane_fits_mode() (iomfb_v14_7_plane.h:31) keeps the old rejections for offset, scaled and short planes and the exact-size panel rule, and the flush passes the clipped source width on external pipes with the framebuffer's own pitch, which the pitch and object-size checks at iomfb_v14_7.c:3086-3093 still bound.

HW row: J514S (M3 Pro, v14.7 path) on this head: KWin mirroring the panel onto a 1920x1080 external display with a 1921x1080 primary plane, picture shown on both outputs, no failed commits in the KWin log, hotplug the external once and confirm no modeset retry loop, plus 0 AVC / 0 failed units / no new kernel errors. The J613/J700/M1 Pro boots in the PR do not exercise iomfb_v14_7.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge-train adversarial review (MERGETRAIN-LINUX2) at 59b4288: BLOCKERS.

Not merging until the blockers below are fixed or answered; the details give file:line and a failure case.

Full review

#2152 drm/apple: v14.7: take primary planes that reach past the mode's edge @59b42888

VERDICT: BLOCKERS

Blockers:

  1. Commit 59b4288 carries Assisted-by: Claude:claude-opus-5-5. Commits must have only the human Signed-off-by lines (Eryk Wieliczko, Scott Jones are present). The PR body ends with "Generated with Claude Code" instead of the Assisted-by: LLM (...) line.

Code checks out:

  • The v14.7 primary plane uses apple_primary_plane_helper_funcs (plane.c:584, from apple_plane_init_v14_7() plane.c:861-882), whose apple_plane_atomic_check() clips (plane.c:257). drm_atomic_helper_check_planes() runs that before the CRTC check.
  • iomfb_v14_7_atomic_check() (iomfb_v14_7.c:3048-3096) only looks at a plane state that is in the commit and visible. On a modeset, the helper adds the affected planes, so the clipped rectangles are always against the new mode.
  • The flush (:3343-3366) uses the clipped source width on external pipes and fb->width on the panel. Pitch and object size stay bounded at :3086-3093.

Nits:

  • The same raw-field rejection is still in iomfb_v26_6_atomic_check() (iomfb_v26_6.c:1730-1733), iomfb_m4_present.h:26-27 and dcpext_drm.c:89-91. So KWin mirroring with a 1921-wide plane still fails on every non-14.7 path, including the 27.2 path the stub pins. The review comment asking to target 27.2 is unaddressed.
  • iomfb_v14_7_plane.h:20-26: a plane that is scaled by less than a pixel can clip to exactly the mode size and is then accepted and shown unscaled. This is documented and harmless, but it is a slight distortion rather than a rejection.

Missing rows:

  • None of the PR's boots runs iomfb_v14_7: J613 runs t8122/v26-class paths, J700 is t8140, and the M1 Pro is 13.x/12.x.
  • Needed on J514S or another M3 Pro/Max (T6030/T6031, 14.7 firmware):
    • KWin mirroring onto a 1920x1080 external display with a 1921x1080 plane: both outputs show the picture, no failed commits, one hotplug with no modeset retry loop.
    • A regression check that the panel still rejects an offset or scaled plane.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Correction to my merge-train review above: the commit trailer is not a merge blocker. Our rule for already-pushed commits is to leave history alone (no force push), so the code verdict stands as NO BLOCKERS. The missing rows listed there still apply, and Dj's verdict is still needed. For new commits, please keep agent trailers out.

@DjDeveloperr DjDeveloperr left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Formal pre-PR §1–§6 review at 59b42888836e against integration/aurora tip 70a00e583b03: REQUEST_CHANGES.

Code & Supersession Audit

  • Not superseded: Live drivers/gpu/drm/apple/iomfb_v14_7.c:3088-3094 still checks raw p->src_*/p->crtc_* fields and iomfb_v14_7_flush() (:3367-3370) still passes raw p->src_w >> 16 / p->src_h >> 16.
  • Correctness (§1–§3): The v14.7 code path checks out. apple_plane_atomic_check() (drivers/gpu/drm/apple/plane.c:315) clips p->src/p->dst via drm_atomic_helper_check_plane_state() before CRTC atomic check runs iomfb_v14_7_atomic_check(). dcp_v14_plane_fits_mode() (iomfb_v14_7_plane.h:31-46) preserves the origin, unscaled, coverage, and exact-panel-fb invariants, pitch/object bounds remain enforced at iomfb_v14_7.c:3085-3097, and dcp_v14_plane_scanout_size() passes the clipped width/height to dcp_v14_present() on external pipes.
  • CI (§6): Live host-tests check is green (run 44113798086).
  • Scope note (non-blocking): The same raw plane-field check still exists in iomfb_v26_6_atomic_check(), plane.c:290-301 (dcp_is_ext26), and iomfb_m4_present.h; Ryan's earlier comment requesting coverage on the 27.2 DCP path remains unaddressed.

Blockers

  1. §4 (Commit attribution / AI trailer): Commit 59b42888836e carries Assisted-by: Claude:claude-opus-5-5 in the commit message. Commits must carry human author/committer identity and human Signed-off-by: trailers only, with zero AI commit trailers. Remove Assisted-by: from the commit message and place the Assisted-by: disclosure in the PR description (replacing the Generated with Claude Code footer).
  2. §5 (Exact-head hardware & regression evidence): None of the tested machines listed in the PR (J613, J700, M1 Pro) execute the iomfb_v14_7 path, and those boots were on a stacked 13-PR tree before fix-ups. Please add an exact-head run on affected iomfb_v14_7 hardware (e.g., J514S / M3 Pro or M3 Max on v14.7 firmware) confirming KWin mirroring onto a 1920x1080 external display with an overhanging primary plane (e.g., 1921x1080), one external hotplug with no modeset retry loop, and the regression pass (0 SELinux denials, 0 failed units, 0 new kernel errors).

@scottjones
scottjones force-pushed the upstream/dcp-v14.7-primary-planes branch from 59b4288 to 7e752ab Compare November 23, 2026 23:25
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) changes-requested A reviewer requested changes (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) needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: FINISH, then merge at 7e752ab08f01: the code is ready; it needs only a row at this head.

Blockers: none in the code. Missing row: one J514S (or another 14.7 Mac) at this head with a primary plane that reaches past the mode's edge (the DisplayPort-glasses mirror case) presenting without errors. Thanks for removing the trailer.

Because iomfb_v14_7.c is shared by every Mac on 14.7 firmware, it also needs one 14.7 Mac from another generation presenting as before.

Checked: no Apple material, no gates. The commit is clean and signed now. CI green.

@DjDeveloperr
DjDeveloperr dismissed their stale review November 25, 2026 05:16

Superseded by the review at 7e752ab

@github-actions github-actions Bot removed changes-requested A reviewer requested changes (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Merge readiness at 7e752ab0: ready to merge

Check Detail
CI at head ok 3 checks passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok comment at 7e752ab0
Conflicts ok none
PR text adopt when you next edit add a 'Tested:' line; a 'Risk:' line (door and Macs) (guide)

Areas: area:display
Merge: gh pr merge 2152 --merge (Owners and Core through the bypass: add --admin).

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

@RyanTheTide

Copy link
Copy Markdown
Contributor

7e752ab08f01 (batched cleanly in J616s Batch #3 cc59e9b94d16 over main 7c0c2fc25ffc, 0 merge-tree diffs across all 4 changed files) J616s (MacBook Pro 16" M4 Pro, T6040, Apple M4 Pro (G16S B1), macOS 26.6.2 fw, guarded one-shot 7.3.0-aurora-pr2905+, default cmdline, stock Stage 2 1.0.0b17, boot_id=01629efb) PASS: 0 failed units, Enforcing, 0 new AVC (1 matching baseline), 0 GPU faults, 0 subsystem errors, real rtc1 s2idle 2/2 (success=2 fail=0), eDP connected pre/post-sleep, 406600000.sep + 514600000.mtp RTKit v12 clean, Borealis VK dEQP-VK.api.smoke.* 8/8 (pre & post-sleep) + glsl.loops.* 624/624, Wi-Fi 3/3 ping pre/post-sleep; stock 7.3.0-aurora-fleet89 restored & verified (946097c2).

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Nov 26, 2026
@RyanTheTide
RyanTheTide merged commit 8bd4942 into aurora-silicon:main Nov 26, 2026
6 checks passed
@RyanTheTide

Copy link
Copy Markdown
Contributor

Merged into main. Thank you! It went through the J616s batch row at this head (0 failed units, 0 GPU faults, s2idle 2/2), and Dj's review.

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) door:two-way Revertible or not, from Merge risk (bot) needs-template PR body lacks Tested or Risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants