Skip to content

drm/apple: m4: read the notch rows of the M4 panel too - #3926

Open
themartiano wants to merge 1 commit into
aurora-silicon:mainfrom
themartiano:fix/m4-notch-read-main
Open

themartiano wants to merge 1 commit into
aurora-silicon:mainfrom
themartiano:fix/m4-notch-read-main

Conversation

@themartiano

Copy link
Copy Markdown
Contributor

What: On an M4 DCP with firmware 26.6.2 the bind returns before apple,notch-height is read, so notch_rows stays 0 there and #2814's notch-free geometry is never offered. Read the notch rows before iomfb_m4_start().

Replaces #3263, which was stacked on #2814 and closed automatically when #2814 merged and its branch was deleted (no review on it). Same commit, now on main: it applies without change. #2814 alone still never reads the notch on M4 firmware 26.6.2 (the J713 row on #2814 used firmware 27.2, which takes another path).

Tested: J713 (13-inch M4 MacBook Air, firmware 26.6.2), 2026-11-26: PASS. Boot logs a 64-row notch (hidden); the panel offers 2560x1600 and debugfs shows scanout_y 64; writing /sys/class/drm/card1-eDP-1/notch offers 2560x1664 at once. Hyprland 0.57.2 picks up the new mode only after a restart (compositor side). The kernel (7.3.0-0.next2) was main ba29027e1580 merged with #2814 and our other open branches, not this branch alone. The dcp.c change is the same as in the kernel booted; main has not touched the lines around it since. Regression on that kernel: 0 failed units, no oops, crash or stall, 10/10 deep sleeps with the notch hidden, panel back each time, no kernel errors.

Risk: one-way by the "default users see" rule (a plain revert restores the old behaviour): on M4 panels with firmware 26.6.2 the default becomes the notch-free mode unless the boot loader says asahi,show-notch, as #2814 intends for every notched panel.

Other Macs: the call added is inside the M4 branch of the bind; for every other DCP the same code runs at the same place, moved into dcp_read_notch(). The M4 panels with a notch are J713, J715 and J604 (the loader writes apple,notch-height); the iMac and Mac mini have none. On those three, with firmware 26.6.2, the notch can now be hidden and switched at run time, as on the other notched Macs with #2814.

Not yet: DPMS within a few seconds of a switch, a deep sleep in the shown state, the idle cache in the hidden state, a VT switch; J715 and J604.

Details

dcp_read_notch() is #2814's own block, moved unchanged into a function so the M4 bind can call it too. The rest of the M4 path already works from notch_rows: the get_modes twins, dcp_notch_mode_known(), dcp_m4_notch_y(), the destination row of the swap, the full-panel startup and idle-cache surfaces at row 0, and the frame check height + dst_y == panel. dcp_notch_dynamic() is true for the M4 compatible.

#2814 removes the show_notch module parameter, so appledrm show_notch=1 on an existing command line is now ignored with a warning (seen on this J713).

Evidence

J713 test runs of 2026-11-25 and 2026-11-26 on 7.3.0-0.next2:

kernel   apple-dcp 30ae00000.dcp: Detected display with notch of 64 pixel (hidden)
panel    connected, modes 2560x1600; debugfs scanout_y 64
sysfs    card1-eDP-1/notch switched: 2560x1664 offered at once
sleep    10/10 deep: entry deep, exit seen, connectors same as before, no kernel errors, no new failed units

Host, on #2814 + this: apple-dcp host suite 97/97; dcp.o W=1 clean; checkpatch --strict clean.

The notch-free geometry is wired up on the M4 (firmware 26.6.2) path: the
modes, the check, the swap's destination row. But the bind of an M4 DCP
returns before apple,notch-height is read, so notch_rows is always 0
there, the notch-free twin is never offered and the panel has no "notch"
property. Read them before iomfb_m4_start().

Seen on a J713 (26.6.2) with an earlier tree and another implementation
of the same swap: the firmware shows a 2560x1600 frame at destination row
64 with the rows above it black, also across DPMS.

Signed-off-by: Eduardo <git@martiano.me>
@themartiano
themartiano marked this pull request as ready for review December 2, 2026 16:15
@themartiano
themartiano requested review from a team as code owners December 2, 2026 16:15
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) blast:none Macs affected, from Merge risk (bot) door:one-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) labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Merge readiness at f7e22b4f: ready to merge

Check Detail
CI at head ok 9 checks passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok comment at f7e22b4f
Conflicts ok none
PR text ok Risk: one-way · by the "default users see" rule (a plain revert restores the old behaviour): on M4 panels with firmware 26.6.2 the default becomes the notch-free mode unless the boot loader says asahi,show-notch, as #2814 intends for every notched panel. Other Macs: the call added is inside the M4 branch of the bind; for every other DCP the same code runs at the same place, moved into dcp_read_notch(). The M4 panels with a notch are J713, J715 and J604 (the loader writes apple,notch-height); the iMac and Mac mini have none. On those three, with firmware 26.6.2, the notch can now be hidden and switched at run time, as on the other notched Macs with #2814.

Areas: area:display
Merge: gh pr merge 3926 --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.

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed f7e22b4ff26a (drm/apple: m4: read the notch rows of the M4 panel too):

  • Extracting dcp_read_notch() from the existing bind path and calling it before iomfb_m4_start() in dcp_comp_bind_pipe() is minimal, property-driven (apple,notch-height), and leaves non-M4 DCP bind order unchanged.
  • DCO and Risk: are present, and the J713 M4 (firmware 26.6.2) verification is documented.
  • Approved the pending fork workflow runs (pr-text, Host tests, Apple build and KUnit); holding approval for CI to finish green at f7e22b4ff26a.

@maralcbr maralcbr 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 f7e22b4ff26a

Blockers:

  1. Hardware row at head: the 2026-11-26 J713 row tested the same dcp.c change inside a combined pre-merge kernel (ba29027e1580 + #2814 + other open branches). Before #2814 merged, it gained 7bc3341694bf ("publish notch policy before atomic completion" in apple_drv.c, touching the runtime notch-switch path), and main has since merged #3321 into iomfb_m4.c. Please post a short J713 (26.6.2) row at f7e22b4ff26a (or a batched M4 candidate containing it unchanged on current main): boot notch log line, default 2560x1600 with scanout_y 64, sysfs notch switch both ways, one DPMS cycle, and one deep sleep.
  2. One-way default sign-off: on J713, J715, and J604 with firmware 26.6.2 (where the loader writes apple,notch-height), this changes the default visible mode to notch-free unless asahi,show-notch is set. Needs an approving review that explicitly accepts this one-way default change (noting J715 and J604 have not yet been booted with a nonzero dst_y swap).

Once the head row is posted and the one-way default is signed off, this is ready to approve and merge without a full re-review.

Checked: code is clean with no blockers; no Apple material, no new chip/board/firmware gates, no new parameters, DCO matches author; dcp_read_notch() extraction, M4 bind order, dcp_notch_dynamic(), external/desktop M4 isolation, unbind cleanup, and clean apply on current main (6ee70d49c228) verified; hosted CI (Apple build and KUnit, Host tests, pr-text) is green at f7e22b4ff26a.

Evidence
  • drivers/gpu/drm/apple/dcp.c:7587-7599, :7698: dcp_read_notch() is #2814's block moved unchanged (dcp->dev equals bind's dev, set at probe before platform_set_drvdata()), leaving non-M4 DCP bind order identical.
  • drivers/gpu/drm/apple/dcp.c:7622-7631: M4 calls dcp_read_notch(dcp) after dcp_pin_live_session() and before iomfb_m4_start(); iomfb_m4_start() does not read dcp->notch_rows (its boot framebuffer check uses dcp_m4_pf->notch_rows).
  • dcp-internal.h:1497-1501: dcp_notch_dynamic() is true on M4, so notch_height stays 0 and static legacy geometry is untouched; MAX_NOTCH_HEIGHT (160) matches DCP_M4_MAX_DST_Y (160).
  • External/desktop M4s: apple,t8132-dcpext is adopted in probe and never reaches dcp_comp_bind_pipe(); nodes without apple,notch-height keep notch_rows = 0 and all consumers gate on notch_rows.
  • Unbind (dcp.c:8128 on main): apple_panel_notch_publish(0, 0) already runs before the M4 early return; rebind is refused by quiescing before the read.
  • Current main (6ee70d49c228): merges cleanly without fuzz.
  • Hosted CI at f7e22b4ff26a: Apple build and KUnit pass, Host tests pass, pr-text pass.
  • Non-blocking note: the bot set blast:none while the PR body names J713, J715, and J604; adjusting the Risk: line wording would make the label match.

@RyanTheTide

Copy link
Copy Markdown
Contributor

J713 no-regression row at exact head f7e22b4f: PASS (13" MacBook Air M4, T8132, firmware 27.2, so the M4 26.6.2 branch this PR changes is not exercised here)

A = saved 7.3.0-aurora-fleet94; B = one-shot kernel built from f7e22b4ff26a 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.

A fleet94 B f7e22b4f
boot log Detected display with notch of 64 pixel (shown) identical
boot state notch=shown, mode 2560x1664, debugfs rows 64 panel_rows 1664 policy shown scanout_y 0 identical
echo hidden > card1-eDP-1/notch 2560x1600, scanout_y 64 identical
echo shown 2560x1664, scanout_y 0 identical
each switch then DPMS off/on (Mutter PowerSaveMode), x2 both ways state kept, connected, DPMS On identical
DCP errors / WARN / Oops 0 / 0 / 0 0 / 0 / 0

On this 27.2 J713 the notch boots shown on both kernels: the boot-time state follows the loader's policy, unchanged by this PR. The one failed unit on B is speakerguardd-v2-switchtest (non-fleet kernel), unrelated. Restored afterwards: saved fleet94, test kernel removed, SELinux Enforcing, 0 failed units.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 3, 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: MERGE at f7e22b4
Checked: The M4 bind now reads apple,notch-height after pinning the live session and before starting IOMFB. The helper clamps the row count and feeds the existing boot and runtime notch policy. The pre-existing bind path calls the same helper at its original position. I accept extending the notch-free boot default to panels on the M4 firmware 26.6.2 path that declare the property. Exact-head Apple DRM host tests and display KUnit passed.

The published J713 exact-head control uses firmware 27.2. The 26.6.2 feature result comes from the author's earlier combined build. #3926 (comment)

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

Reviewed f7e22b4ff26a. The M4 bind now reads and clamps the existing notch property before starting IOMFB. The later bind path calls the same helper in its original place, and the existing boot-loader show/hide policy still applies.

The exact-head J713 result is a 27.2 control. The positive run still needs the 26.6.2 branch on J713, J715 or J604, with the intended default geometry and scanout offset, a shown/hidden switch and DPMS or deep wake with the panel restored. The M4 mini has no built-in notched panel.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (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) blast:none Macs affected, from Merge risk (bot) door:one-way Revertible or not, from Merge 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.

5 participants