Repository navigation
drm/apple: v14.7: take primary planes that reach past the mode's edge - #2152
RyanTheTide merged 1 commit into
Conversation
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]>
|
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. |
|
Blockers: 1.
The change itself checks out: 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) |
|
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 @59b42888VERDICT: BLOCKERS Blockers:
Code checks out:
Nits:
Missing rows:
|
|
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. |
There was a problem hiding this comment.
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-3094still checks rawp->src_*/p->crtc_*fields andiomfb_v14_7_flush()(:3367-3370) still passes rawp->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) clipsp->src/p->dstviadrm_atomic_helper_check_plane_state()before CRTC atomic check runsiomfb_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 atiomfb_v14_7.c:3085-3097, anddcp_v14_plane_scanout_size()passes the clipped width/height todcp_v14_present()on external pipes. - CI (§6): Live
host-testscheck is green (run44113798086). - 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), andiomfb_m4_present.h; Ryan's earlier comment requesting coverage on the 27.2 DCP path remains unaddressed.
Blockers
- §4 (Commit attribution / AI trailer): Commit
59b42888836ecarriesAssisted-by: Claude:claude-opus-5-5in the commit message. Commits must carry human author/committer identity and humanSigned-off-by:trailers only, with zero AI commit trailers. RemoveAssisted-by:from the commit message and place theAssisted-by:disclosure in the PR description (replacing theGenerated with Claude Codefooter). - §5 (Exact-head hardware & regression evidence): None of the tested machines listed in the PR (J613, J700, M1 Pro) execute the
iomfb_v14_7path, and those boots were on a stacked 13-PR tree before fix-ups. Please add an exact-head run on affectediomfb_v14_7hardware (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).
59b4288 to
7e752ab
Compare
DjDeveloperr
left a comment
There was a problem hiding this comment.
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.
Superseded by the review at 7e752ab
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
|
|
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. |
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, andapple_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
a7dd26e6d60ewith the 7.3 package config, LLVM 18 and Rust 1.85:make W=1 drivers/gpu/drm/apple/: buildsa7dd26e6plus 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.Merge Danger
Door: two-way
Blast Radius: display
v14.7 display path only; it accepts planes it used to reject.