Repository navigation
drm/apple: control the panel notch at run time - #2814
RyanTheTide wants to merge 6 commits into
Conversation
A panel with a camera housing has apple,notch-height rows at its top. Until now the driver read them once at probe: hidden for the whole boot unless the boot loader kept them (chosen asahi,show-notch) or a module parameter said otherwise, with no way to change it without a reboot, and the text console drew under the notch whenever the notch was shown. The panel always runs its native timing; what changes is how much of it is drawn on. Keep both geometries of each panel timing in the mode catalogue: the full panel and its notch-free twin, with the notch rows folded into the vertical sync exactly as the boot-time hidden mode did. The mode a commit carries decides where the frame is scanned out (the twin starts below the notch rows, which stay black), and switching between the twins keeps the panel's mode, so it is no mode set. Which geometry is offered follows a policy: the boot loader's choice, then the new "notch" connector property (enum: hidden, shown), which a compositor sets atomically, or /sys/class/drm/cardN-eDP-1/notch for scripts. A change re-probes userspace and the console. The notch-free modes are always offered; the full ones only while they are wanted and a DRM master owns the device. When no master does (a text-only system, a VT switch, a compositor that dropped master or exited), the console gets the notch-free geometry and re-probes into it; its surface is sized to it, so it never draws under the notch. A master that comes back gets its own mode again, as a fast switch. The M4 (T8132) pipe, which only took full-panel frames, gets the same two modes: a notch-free frame is placed with the swap's destination rectangle. The standalone firmware 14.7/26.6 pipes keep the boot loader's geometry for the boot. Nothing is selected by board: the rows come from apple,notch-height, which the boot loader takes from the ADT, and a panel without them is unchanged. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR Checklist Review (§1–§6) — 0cb64c16fa63f3ffb439c4f1e9689092c9a1d55c
The overall design (twin modes in the catalogue, dcp_notch_offset scanout placement, atomic "notch" property, fastset between twin geometries) is clean and hardware-driven (§1, §3, §4, §6 pass), but there are several concrete blockers in the M4 (DCP_FIRMWARE_M4) path, teardown ordering, formatting, and §5 hardware coverage that need fixing before merge.
Blockers
-
M4 (
DCP_FIRMWARE_M4/iomfb_is_m4()) rejects notch-free modes in 3 un-updatediomfb.csites (§2):
PR #2814 updateddcp_crtc_atomic_check()(dcp.c:2025) to calldcp_notch_mode_known(), but missed three remainingiomfb_is_m4(dcp)mode checks indrivers/gpu/drm/apple/iomfb.cthat still requiredrm_mode_equal(mode, &fixed):dcp_mode_valid()(iomfb.c:3645-3650):drm_helper_probe_single_connector_modes()callsmode_valid()on every mode added bydcp_get_modes()and prunes anything returningMODE_BAD. On an M4DCP_FIRMWARE_M4(26.6.2) boot with notch hidden,dcp_get_modes()offers only the notch-free mode anddcp_mode_valid()immediately prunes it, leaving zero modes on the panel.dcp_crtc_atomic_modeset()(iomfb.c:3675-3683): rejects any real modeset to a notch-free mode with-EINVAL.dcp_crtc_mode_fixup()(iomfb.c:3854-3858): rejects any non-fastset modeset (initial enable, DPMS wake, suspend/resume) to a notch-free mode with-EINVAL.
(This escaped the J713 test because J713 ran firmware 27.2, where
iomfb_is_m4()isfalse.) All three sites should usedcp_notch_mode_known(dcp, ...). -
M4
atomic_checkvsdcp_flush()dst_ymismatch (§2):iomfb_m4_plane_frame()(iomfb_m4_present.h:37-41) computesdst_y = height < DCP_M4_PANEL_HEIGHT ? DCP_M4_PANEL_HEIGHT - height : 0without checkingdcp->notch_rows, whereasdcp_flush()(iomfb.c:4452-4454) computesdcp_notch_offset(&new->mode, READ_ONCE(dcp->notch_panel_rows), dcp->notch_rows).- On M4,
dcp->notch_panel_rowsis only populated insidedcp_get_modes()(iomfb.c:2810). If a commit runs beforedcp_get_modes()(e.g. retained modeset or restoring a cached mode),atomic_checksucceeds whiledcp_flush()computesdst_y = 0and fails mid-commit iniomfb_m4_present_at()->dcp_m4_frame_check()(-EINVAL->dcp_drm_crtc_error(-EIO)). Populatenotch_panel_rowswhen the M4 panel mode is established (or compute consistently fromiomfb_m4_get_mode()).
-
Teardown UAF / workqueue re-arm race in
apple_drm_uninit()(apple_drv.c:2278-2285) (§2):cancel_work_sync(&apple->notch_hotplug)andcancel_work_sync(&apple->notch_console)are placed beforedrm_dev_unplug(&apple->drm)anddrm_atomic_helper_shutdown(&apple->drm).- Until
drm_dev_unplug()unregisters sysfs and closes off DRM ioctls,notch_store(), an atomic commit, orapple_drm_master_drop()can re-queue either work item aftercancel_work_sync()returns, allowingdrm_kms_helper_hotplug_event()/drm_client_dev_hotplug()to run aftercomponent_unbind_all()/dcp_unlink(). - Move both
cancel_work_sync()calls afterdrm_dev_unplug()anddrm_atomic_helper_shutdown(), and guardnotch_store()withdrm_dev_enter()/drm_dev_exit().
-
Accidental deleted newline in
drivers/gpu/drm/apple/parser.h:237:/* Caller serializes readers against replacement. */int replace_modes(struct dcp_parse_ctx *handle,
Please restore the newline between the comment and prototype.
-
§5 Evidence incomplete (acknowledged in PR "Still to run"):
- Only J615 (pre-rebase, fw 27.2) and J713 (fw 27.2) have been tested so far.
- Missing hardware verification on: J616s (desktop 26.6), M1 Pro / M2 (older DCP fw), M4 26.6.2 (
DCP_FIRMWARE_M4path, which has blocker #1 above), a non-notch panel regression (e.g. MacBook Neo / external-only display), and the visual boot-logo check withshow-notchStage 2.
Non-blocking / ABI & Correctness Notes
- Commit message vs
dcp_notch_offer(): The commit message says "The notch-free modes are always offered; the full ones only while they are wanted and a DRM master owns the device", butdcp_notch_offer()actually hides notch-free modes whenevereffective == DCP_NOTCH_SHOWN && full_fits(only one geometry is offered at a time, as the PR body's Design notes describe). Please align the commit message. - Sysfs ABI documentation: The new writable
/sys/class/drm/cardN-eDP-1/notchsysfs attribute should be documented underDocumentation/ABI/testing/. - fbdev initial-probe /
master_drop()race: If a boot splash holds DRM master duringapple_drm_fbdev_probe(),drm_client_modeset_probe()has already selected the full-panel mode beforeapple_drm_fbdev_probe()shrinkssizes->surface_heightbynotch_rows, leaving the cached modeset mode taller than the fbdev surface until the asyncnotch_consolework runs; onmaster_drop(),drm_client_dev_restore()can race ahead ofschedule_work(&apple->notch_console). - Fastset
adjusted_mode: Clearingnew_cs->mode_changed = falseinapple_connector_notch_fastset()skipsmode_fixup()indrm_atomic_helper_check_modeset(), leavingcrtc_state->adjusted_mode.vdisplayat the previous geometry (currently harmless sincedrm/appleusescrtc_state->modeand clock/totals match, but worth copying or noting explicitly).
Assisted-by: LLM (Gemini 4 Neon)
|
Review at 0cb64c1.
|
Follow-up to "drm/apple: control the panel notch at run time": - M4 (T8132, firmware 26.6.2) pipe: mode_valid(), mode_fixup() and the CRTC mode set still required the full panel mode, so the probe pruned the notch-free twin (no mode at all with the notch hidden) and a real mode set of it failed. Accept the panel timing in either geometry everywhere, and place a frame from the timing the firmware reports rather than from a value get_modes() caches. - Teardown: cancel the notch work items after drm_dev_unplug() and the shutdown commit, and run them, the sysfs write and the master-drop scheduling only while the device is plugged. - A full timing that cannot have a twin is offered as it is under either policy, instead of being filtered out. - The physical height reported follows the geometry offered: the notch-free modes and the connector take the panel's adj-height-mm, or the full height scaled by rows. - The fast switch leaves the adjusted mode equal to the mode, as mode_fixup() would. - Drop the show_notch module parameter, now only read at bind: the boot loader sets the starting choice and the "notch" property changes it. - Document the property and the sysfs attribute (Documentation/gpu/apple-dcp-notch.rst, Documentation/ABI/testing/sysfs-class-drm-apple-notch). - Fix the parser.h line the first commit joined. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Thanks to both reviews. Fixed in 0c29a3e (follow-up commit; the first commit is unchanged):
On the earlier J713 row: on fleet80c with firmware 27.2, fbdev first-probe race: if a boot splash held master during the console's first probe, the surface is clamped notch-free and the stale full-height mode set is replaced at the next master drop. A restore that runs before that work item fails once (plane larger than the surface) and changes nothing on screen. It does not occur on a normal boot, where the first probe runs before any master. Host: apple-dcp 94/94 at this head, W=1 clean. Rows at 0c29a3e to follow: J713 (all steps, plus a short s2idle and DPMS off/on with the notch hidden), J615 (s2idle in each policy), J616s regression, M1 Pro and M2. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR Checklist Re-Review (§1–§6) — 0c29a3e42b3d526f27219cbd9ca8414ed23b51f0
All three prior kernel blockers from the 0cb64c16 review (and the formatting/uAPI items) are resolved cleanly in 0c29a3e4:
- M4 (
DCP_FIRMWARE_M4/ 26.6.2) mode checks (resolved):dcp_mode_valid(),dcp_crtc_atomic_modeset(), anddcp_crtc_mode_fixup()indrivers/gpu/drm/apple/iomfb.cnow all usedcp_notch_mode_known(), matchingdcp_crtc_atomic_check(). - M4
dst_yconsistency (resolved):dcp_flush()now usesdcp_m4_notch_y(), deriving the scanout offset directly fromiomfb_m4_get_mode()+dcp_notch_twin_of()so it matchesiomfb_m4_plane_frame()even beforedcp_get_modes()runs. - Teardown ordering (resolved):
apple_drm_uninit()now cancelsnotch_hotplugandnotch_consoleafterdrm_dev_unplug()anddrm_atomic_helper_shutdown(), withdrm_dev_enter()/drm_dev_exit()guards innotch_store()and both work items, plus!drm_dev_is_unplugged(drm)inapple_drm_notch_owner(). - Other prior items (resolved):
parser.hnewline restored;show_notchmodule parameter dropped (pure default cmdline, §2);adj-height-mm/dcp_notch_free_mm()physical height wired up;notch_twinfallback preserves timings without twins; fastset copiesmodetoadjusted_mode; ABI & driver docs added (Documentation/ABI/testing/sysfs-class-drm-apple-notch,Documentation/gpu/apple-dcp-notch.rst). - §1, §2, §3, §4, §6: Pass (DT/ADT-driven with no model gating, human commits with human
Signed-off-byand no AI commit trailers,host-testsCI green).
Remaining Blocker
- §5 Hardware evidence at
0c29a3e4still pending:- No hardware runs have been posted for
0c29a3e4yet (which changeddcp.c,iomfb.c,apple_drv.c,dcp-notch.h, and droppedshow_notch). - As noted in the follow-up comment and PR body ("Still to run"), please post the
0c29a3e4hardware rows before merge: J713 (full steps + s2idle + DPMS off/on with notch hidden), J615 (s2idle in each policy), J616s (desktop 26.6 regression), M1 Pro / M2 template-pipe regression, and the visual boot-logo check with show-notch Stage 2 (each with 0 SELinux denials, 0 failed units, 0 new kernel errors).
- No hardware runs have been posted for
Non-blocking Notes
- Teardown hardening (
apple_drv.c:2307-2308): Switchingcancel_work_sync(&apple->notch_hotplug)/cancel_work_sync(&apple->notch_console)todisable_work_sync()(matchingapple_drm_quiesce_connectors()) would close the narrow window where an in-flightapple_drm_master_drop()(which does not holddrm_dev_enter()) or a nonblocking commit tail runningapple_commit_notch()afterdrm_atomic_helper_commit_hw_done()re-queues work aftercancel_work_sync(). - Async
dcp_set_dimensions()physical height (dcp.c:1509-1512):dcp_set_dimensions()writes fullheight_mmdirectly toconnector->display_info.height_mmwithout applyingdcp_notch_free_mm()whenREAD_ONCE(dcp->notch_free_offered)is true, so an asyncdimensions_wqrun can overwrite the notch-free physical height until the nextdcp_get_modes(). Also, cachingREAD_ONCE(dcp->notch_panel_rows)once indcp_update_connector_dimensions()avoids reading it twice.
Assisted-by: LLM (Gemini 4 Neon)
- Disable rather than cancel the notch work items at teardown, as the connector work items are: a master drop or a commit tail still in flight cannot queue them again. - dcp_set_dimensions() (the asynchronous DisplayAttributes update) reports the connector's size through dcp_update_connector_dimensions(), so it keeps the notch-free height while that geometry is offered. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Hardware rows at 4d7e97f. Each Mac ran fleet81 plus the three commits of this PR as a one-shot (driver diff identical to the PR), and each was restored to its default afterwards. Counts are 0 SELinux denials, 0 failed units, and no kernel error lines beyond the production boot's own.
Notes:
J615 rows at this head (with s2idle in each policy) follow when the Mac is free. The visual boot-logo check is still open. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR Checklist Re-Review (§1–§6) — 4d7e97f68d519724f28f7859940bd0430bde3b42
Verified live at 4d7e97f68d519724f28f7859940bd0430bde3b42 (all 3 commits 0cb64c16 -> 0c29a3e4 -> 4d7e97f6):
- Delta at
4d7e97f6(clean):drivers/gpu/drm/apple/apple_drv.c: switchednotch_hotplugandnotch_consoleteardown inapple_drm_init()(err_unbind) andapple_drm_uninit()fromcancel_work_sync()todisable_work_sync(), closing the re-arm window noted on0c29a3e4.drivers/gpu/drm/apple/dcp.c:dcp_set_dimensions()now callsdcp_update_connector_dimensions()so asynchronousDisplayAttributesupdates preserve the notch-free physical height while that geometry is offered, anddcp_update_connector_dimensions()cachesREAD_ONCE(dcp->notch_panel_rows)once. (dcp_get_modes()recomputesmode->height_mmviadcp_notch_free_mm()when duplicating notch-free modes, so cataloguemode.height_mmstays consistent.)tools/testing/selftests/drivers/gpu/apple-dcp/edid.py: reordered extracted helper definitions to match the new call fromdcp_set_dimensions();host-testsCI is green (1/1).
- §5 Hardware evidence at
4d7e97f6(posted):- Hardware runs on
fleet81+ all 3 PR commits across three distinct notched Mac generations/pipes — J713 (M4 Air, fw 27.2: hidden/shown default, fast runtime toggle with 0 firmware modesets, VT3 &multi-user.targetnotch-free console, 15 s s2idle both policies), M2 Air (template pipe: toggle, VT3 console, DPMS off/on & 15 s s2idle both policies), and J616s (M4 Pro, desktop 26.6 ProMotion: 6 timings + 6 notch-free twins at row 74, toggle, DPMS off/on both policies) — all with 0 SELinux denials, 0 failed units, and 0 new kernel error lines.
- Hardware runs on
- §1, §2, §3, §4, §6: All pass. Pure DT/ADT-driven (
apple,notch-height, no model gating), default kernel command line (noshow_notchmodule param), clean human commit history (Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>on all 3 commits, zero AI commit trailers).
Non-blocking Follow-ups
- Please add the J615
4d7e97f6s2idle row and the visual boot-logo check when the machine is free. - Minor PR body housekeeping: the PR description's Design Notes still mention
show_notchbeing kept (removed in0c29a3e4) and "Still to run" still lists J616s/M2 (now completed at4d7e97f6).
Code, CI, and multi-generation §5 evidence at 4d7e97f6 are clean — approved and ready for MERGETRAIN-LINUX4.
Assisted-by: LLM (Gemini 4 Neon)
|
Merge-train adversarial review (MERGETRAIN-LINUX4) at 4d7e97f: one blocker (below). Merges clean on integration/aurora 000ab96. Blocker: Full reviewVERDICT: BLOCKERS Blockers
Nits / non-blocking issues
Missing rows
Assisted-by: LLM (Claude:Opus 5.5) |
|
J615 (M3 Air 15", firmware 27.2) at 4d7e97f, fleet81 plus this PR as a one-shot:
All the requested rows are now done except two. DPMS on the J713 is blocked by the reset the unmodified fleet81 kernel shows there. The visual check of the boot sequence on the panel is still open. |
…stale apple_drm_master_drop() scheduled a console hotplug on every master drop on a notched panel. With no master at that moment the fbdev client re-probes and commits its framebuffer, so every handoff gap (boot splash to display manager, greeter to session, user switch) could flash the console, which a DROP_MASTER never did before. Every console probe after the first is bounded by its notch-free surface and picks the notch-free modes whoever owns the device. Only a first probe under a master that was offered the full panel (a boot splash with the notch shown) leaves the console with full modes; the surface clamp in apple_drm_fbdev_probe() marks that case, and only the first master drop after it now asks the console to re-probe. The fast switch between the two notch geometries clears mode_changed in the connector check, before the core adds the CRTC's planes to a mode set. The swap that moves the frame by the notch rows needs them: add the planes there. The apple-dcp host case panel-notch-console runs the production fbdev probe and master hooks through repeated handoffs, a stale first probe, an unplugged device, a fixed-geometry pipe and a panel without notch rows. With the old unconditional kick it fails. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist re-review at 182aedbd8b20a971267876cc27403b4ff510e718 (following the new commit on top of previously approved 4d7e97f68d51).
Delta Audit (182aedbd8b20)
- One-shot console re-probe gate (
drivers/gpu/drm/apple/apple_drv.c:89, 275, 311-313) — Clean:
Resolves the MERGETRAIN-LINUX4 master-drop fbdev flash blocker.apple_drm_fbdev_probe()marksnotch_console_stale = true(WRITE_ONCE) only when clamping a full-height initial console probe, andapple_drm_notch_owner()atomically consumes it viaxchg(&to_apple_drm(drm)->notch_console_stale, false)(8-bitxchgis supported onarm64, whichCONFIG_DRM_APPLEdepends on) on!ownedwhile plugged. Subsequent master handoffs (greeter → session, user switch) no longer kickdrm_client_dev_hotplug()or flash fbcon; if a second master races ahead of the scheduled work,drm_fb_helper_hotplug_event()setsdelayed_hotplug = trueso the re-probe is not lost. Teardown remains protected bydisable_work_sync()afterdrm_dev_unplug(). - Fastset plane inclusion (
drivers/gpu/drm/apple/apple_drv.c:1253-1292) — Clean:
apple_connector_notch_fastset()now returnsdrm_atomic_add_affected_planes(state, new->crtc)andapple_connector_atomic_check()propagates errors (-EDEADLK/-ENOMEM). Verified againstiomfb_template.c:4491-4568: untouched overlay planes and MODE_ID-only commits now enter the plane check/swap loop so all active planes are re-clipped against the newvdisplayand receive the updatednotch_yoffset in the same swap. - Host test (
tools/testing/selftests/drivers/gpu/apple-dcp/display.py,run.py) — Clean:
Newpanel-notch-consolecase exercises the productionapple_drv.cprobe/master hooks across repeated handoffs, stale initial probe, unplugged teardown, fixed-geometry pipes, and non-notched panels;host-testsCI is 1/1 green at182aedbd8b20.
Checklist Summary
- §1 No model gating: Pass (DT/ADT-driven
apple,notch-height, no board/SoC gates). - §2 Production-ready, no hacks: Pass (0 code blockers).
- §3 Safety: Pass.
- §4 Clean-room & attribution: Pass (all 4 commits carry human author/committer and human
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>only, zero AI trailers in commits; PR body disclosure present). - §5 Evidence: Waiting on
182aedbd8b20hardware re-verification.- Prior multi-generation hardware rows (J713, M2 Air, J616s, J615) were run at
4d7e97f68d51prior to theapple_drv.cchanges in182aedbd8b20. Please post a quick hardware verification at182aedbd8b20on a notched Mac confirming runtime fastset toggle + VT switch / graphical handoff (greeter → session or VT back/forth, 0 console flash, 0 SELinux denials, 0 failed units, 0 new kernel errors). - Also still noted as open under "Still to run": visual boot-logo check with show-notch Stage 2, and M4 26.6.2 (
DCP_FIRMWARE_M4) hardware verification for the default notch-freedst_yswap path (currently host-test only).
- Prior multi-generation hardware rows (J713, M2 Air, J616s, J615) were run at
- §6 Naming: Pass.
Non-blocking Note
- Consider squashing the 4 fixup commits before merge so intermediate bisect points (specifically
0cb64c16) do not expose the pre-fix M4 mode-check bug or joinedparser.hline.
Zero code or policy blockers remain; posting COMMENT pending §5 hardware confirmation at 182aedbd8b20 before MERGETRAIN-LINUX4.
Assisted-by: LLM (Gemini 4 Neon)
The console's fbdev keeps the physical size of its screen info from its first probe, which offers it the notch-free geometry. After a runtime "notch" change, its next probe is bounded by its notch-free surface and offered only notch-free modes, but get_modes() then left the physical height a compositor had last been given: the full panel's. The fbdev helper copies that height into every var it checks, so each VT's saved var no longer matched and every console switch or unblank, including the one on the way back to a compositor's VT, did a forced restore commit. On a J615 after one hidden/shown cycle, a VT round trip made 9 + 2 console commits instead of 3 + 0. Report the notch-free height whenever the probe offers only the notch-free geometry: the policy hides the notch, or the probe cannot take the full panel. This is the rule dcp_notch_offer() already applies to the modes themselves. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Hardware rows at 182aedb, one new commit (c566162) for a problem these rows found, and the same rows with it. Re-review requested at the head. J615 (M3 Air 15", firmware 27.2), 182aedb. A one-shot of fleet82 + integration (including linux#2857) + this PR, on the default command line and production Stage 2 (show-notch on), restored to the fleet83 default afterwards:
What the rows found. After a runtime toggle the counts doubled: 11 per gdm restart, 7 to 9 per VT3 entry, and 2 on every return to GNOME where fleet83 has 0. A kprobe on c566162
Still open, as in the body: the J713 DPMS row at the head, and an M4 26.6.2 board for the default notch-free swap path. On squashing: no force push here, so a squash merge would keep Evidence and method
Assisted-by: LLM (Claude:Opus 5.5) |
|
Hold: please don't merge yet. The J713 row at the head found a reset that this PR introduces. J713 (M4 Air, firmware 27.2), the same fleet82-based one-shot without an external display: after a runtime hidden -> shown switch under GNOME, the next DPMS off/on resets the Mac at the power-on commit (4 of 4 tries, at 182aedb and with c566162). Everything else on that Mac passes:
Unmodified fleet81 on the same Mac passes s2idle followed by DPMS 3/3. Network console plus runtime drm debug show the switch committed as a 2560x1664 mode change, then the CRTC disabled on DPMS off, then the reset during the enable with nothing logged after it. I'm root-causing this in the M4/fw-27 enable path and will push a fix with J713 rows. Assisted-by: LLM (Claude:Opus 5.5) |
|
Update on the J713 hold. It is timing-dependent:
On this Mac DPMS off stops the DCP firmware and DPMS on is a warm restart; that is not the case on the J615, M2 or J616s, which all pass. The firmware's power-off sequence is the same in a passing run and a resetting one. An offline review found nothing on the Linux restart path that reads the notch state. So the cause is something left pending for some seconds after the notch-free -> full switch, which a firmware stop interrupts. It is not root-caused yet. I'm keeping the hold: the fix has to remove the window, not wait it out, and a VT visit followed by a quick DPMS hits it too. The J615 result and c566162 above are unaffected. Assisted-by: LLM (Claude:Opus 5.5) |
|
HOLD root-caused: the J713 reset is not in this PR's code. Fix: #2962
Merge order: #2962 first, then this PR. Its code is unchanged; head stays c566162. J615 / J616s rows with both are next. |
|
Rows for this PR's head (c566162 content) + #2962, fleet85 kernel, dev appledrm one-shot on each Mac, default cmdline (no notch arg):
No DART faults and no new DCP errors on any of them. The HOLD can come off once #2962 lands; merge #2962 first. |
RyanTheTide
left a comment
There was a problem hiding this comment.
Re-reviewed the delta from the previously approved 4d7e97f68d51 to c56616203ad2. The physical height now follows the geometry that the current probe offers on both mode-list paths. The modes themselves, panel timing and boot property are untouched by this follow-up.
I compiled the exact notch helpers with GCC and Clang under ASan/UBSan. Each passed 16/16 combinations of hidden/shown policy, DRM ownership and bounded/unbounded probes. The bounded console now keeps the notch-free physical height through a shown-policy re-probe, while an unbounded compositor still gets the full height.
This clears the latest source delta. The existing J615 VT trace and the J413 notch/DPMS rows cover different pieces of the behavior, so the J615 VT count remains specific to the bounded-console row.
Keep the shared sleep notifier list and per-device restore work from integration. Keep the notch property and its separately drained hotplug and console work. The removed per-device notifier has no remaining users. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist re-review at verified live head 27b43cd108d74283c1983b0268d3d9aa981f5f1d (MERGEABLE / CLEAN, CI 2/2 green: Apple DRM KUnit / kunit, Host tests / host-tests).
Delta Audit Since 182aedbd8b20
- Bounded-probe physical height (
c56616203ad2,dcp-notch.h,iomfb.c,display.py): Clean fix.dcp_notch_free_only(effective, full_fits)(effective == DCP_NOTCH_HIDDEN || !full_fits) ensures bounded console probes always receive the notch-free physical height on both M4 and cataloguedcp_get_modes()paths, matchingdcp_notch_offer()and eliminating the forced fbdev restore commits on VT return to GNOME. Verified inpanel-notch-geometry(16/16 policy/ownership/fit matrix). - Merge with
integration/aurora(27b43cd108d7): Clean conflict resolution inapple_drv.cpreserving the shared sleep notifier list (pm_node,pm_resume_work) alongsidenotch_hotplug/notch_console(disable_work_sync()in botherr_unbindandapple_drm_uninit()afterdrm_dev_unplug()anddrm_atomic_helper_shutdown()). Confirmedaurora-silicon/linux#2962(48b7191062ea, display-DART DPMS fix that resolved the J713 hold) is merged and an ancestor of27b43cd108d7.
Checklist Summary
- §1 No model gating: Pass — driven purely by DT
apple,notch-heightandchosen/asahi,show-notch; verified across 4 distinct notched Mac pipes (J713 M4 Air, J615 M3 Air, J616s M4 Pro desktop 26.6 ProMotion, M2 Air template) plus non-notched Neo regression. - §2 Production-ready, no hacks: Pass — works on default kernel command line (
appledrm.show_notchmodule param removed), no sleeps/retries/hacks, 0 code blockers. - §3 Safety: Pass — proper teardown ordering and
drm_dev_enter/drm_dev_exitguards; J713 DPMS reset root-caused and fixed in merged#2962. - §4 Clean-room & attribution: Pass — all 6 commits (including merge commit
27b43cd108d7) carry human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and humanSigned-off-by:only, zero AI trailers in commits; PR body disclosure present. - §5 Evidence: Pass — exact driver code (
c5661620+ merged#2962) verified across:- J713 (M4 Air, fw 27.2): 11/11 DPMS + notch-toggle rows pass across 2 boots (vs 9/9 reset without
#2962), plus full toggle/VT3/multi-user/s2idle row, 0 DART faults, 0 SELinux denials, 0 failed units, 0 new kernel errors. - J615 (M3 Air, fw 27.2):
c5661620handoff trace matches unmodified fleet83 (0 console kicks, 0 extra commits on return to GNOME, fbdev var height 204 == VT var 204), toggle/VT3/DPMS/s2idle + 5/5#2962DPMS rows pass, 0 SELinux denials, 0 failed units, 0 new kernel errors. - J616s (M4 Pro MBP, desktop 26.6): 6 ProMotion timings twinned + 4/4
#2962DPMS+toggle rows pass, 0 SELinux denials, 0 failed units, 0 new kernel errors. - M2 Air (template pipe) & Neo (T8140, no notch): toggle/VT3/DPMS/s2idle and 6/6 DPMS no-regression rows pass.
- J713 (M4 Air, fw 27.2): 11/11 DPMS + notch-toggle rows pass across 2 boots (vs 9/9 reset without
- §6 Naming: Pass.
Non-blocking Notes
- Recommend squash-merge (as you noted) so intermediate commit
0cb64c16(pre-fix M4 mode check /parser.hline) does not appear in git bisect history. - Keep the two non-blocking follow-up observations tracked when available (M4 26.6.2
DCP_FIRMWARE_M4hardware check fordst_y, currently covered bym4-notch-framehost test, and the visual boot-logo pass).
All §1–§6 criteria and CI pass — APPROVED and ready to merge.
Assisted-by: LLM (Gemini 4 Neon)
Problem
On a MacBook with a notch, the driver picked the panel geometry once, at probe. The notch rows were either hidden for the whole boot or shown for the whole boot (boot loader
chosen/asahi,show-notch). Changing it needed a reboot. When the notch was shown, the text console drew its top lines under the notch: on a text-only system, or after Ctrl+Alt+F3.Change
notch(enumhidden/shown), which a compositor can set atomically. The same switch is available as/sys/class/drm/cardN-eDP-1/notchfor scripts. It chooses which geometry compositors are offered, and a change sends a hotplug event so they follow. The default is the boot loader's choice.apple,notch-height, which the boot loader takes from the ADT. There is no board list and no command-line or module parameter to set. Panels without notch rows (Neo, external displays) are unchanged. The standalone firmware 14.7 / 26.6 pipes build their single mode from the boot framebuffer, so they keep the boot loader's geometry for the boot.dri/N/eDP-1/notch, reports rows, policy, whether a master owns the device, and the row offset of the last frame.For compositors
Nothing new is needed. A compositor is offered the geometry the policy asks for, and follows a change through the usual hotplug re-probe. GNOME does this unmodified (rows below). A compositor that wants to decide for itself can set
notchin the same atomic commit as the matching mode. Both modes are always accepted in a commit.Testing
panel-notch-geometry(production parser + catalogue code on the J615 timing; twin bit-identical to the old hidden mode; offer/offset/ownership/physical-size rules; a mutation of the console rule fails it) andm4-notch-frame(swap destination y 64, height 1600 on the J713 profile). W=1 arm64 clean, checkpatch clean, CI host-tests green.Still to run
First-commit hardware rows (0cb64c1, pre-review)
Evidence:
traces/display/20261122-notch-dyn/(lab store). Snapshots record the eDP mode list, sysfs and debugfs notch state, CRTC mode, VT/fbcon, the count ofset_digital_out_modecalls this boot, and kernel errors, AVCs and failed units.J615, kernel 7.3.0-aurora-g15nd1 = J615 default source + this commit (pre-rebase; differs only by the base and two whitespace fixes)
echo shownchvt 3chvt 2echo hidden/shownmodetest -a -w 49:notch:0, back to GNOMEmulti-user.targetJ713, kernel 7.3.0-aurora-f80cnd1+ = J713 default source (fleet80c) + this commit; same steps, 2560x1664 full / 2560x1600 notch-free, fbcon 320x100, 3 firmware mode sets per boot throughout.
Kernel error lines on every test boot are the production boot's own set: Bluetooth codec capabilities and AFK ep20 init props on the J615; AFK ep20, DFB layout, DCPDP13Service admission on the J713.
Design notes for reviewers
notch_freemarks the twin; twins are appended after the firmware's timings).dcp_nr_timings()keeps the "single fixed timing" decisions (firmware 27 boot-mode inheritance, desktop 26.x fixed panel) counting firmware timings. The panel EDID is built from the timings only.dcp_notch_offer()): the effective geometry only. Effective = policy while a master owns the device, else notch-free. A probe whose height limit is below the panel (the console's fbdev re-probe, bounded by its surface) is also offered the notch-free modes, so the console's stored mode set never loses the panel while a compositor holds full height. The connector'sfill_modesrecords that limit.apple_connector_notch_fastset()clearsmode_changedin the connector check, before the colour/EOTF logic below it can ask for a real mode set, only when the CRTC stays on, VRR is unchanged, and the new mode is the twin of the old one and in the catalogue.master_set/master_droprecord ownership. On drop, a work item runsdrm_client_dev_hotplug()(master_drop holds master_mutex, which the console restore takes).apple_drm_fbdev_probe()sizes the console surface notch-free if its first probe ever ran while a boot splash held master.notchproperty lives in a connector state subclass. The sysfs write commits it like a compositor would, and the commit tail updates the policy and schedules the hotplug.show_notchmodule parameter is removed (follow-up commit): the boot loader sets the starting policy and the property changes it. Docs:Documentation/gpu/apple-dcp-notch.rst,Documentation/ABI/testing/sysfs-class-drm-apple-notch.