Repository navigation
drm/apple: create the HDMI pipeline's CRTC last - #3610
Conversation
41ac80f to
77c4f6d
Compare
A Type-C display cannot be moved onto the pipeline that drives the HDMI port while an HDMI display is connected. A compositor that has switched that display off sees its CRTC as free and gives it to the next Type-C display that arrives when it comes first in the CRTC list. Every mode is then refused, and Hyprland aborts. Create that pipeline's CRTC after the others, so the first free CRTC of an arriving Type-C display is one it can use. Signed-off-by: Andreas Fernandez <andreas.fernandez@hotmail.com>
77c4f6d to
00dbc20
Compare
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
Verdict: HOLD at 00dbc209
Blockers:
- Hosted
pull_requestCI workflows (Apple build and KUnit,Apple DRM KUnit,Host tests,pr-text) arecompleted/action_requiredawaiting maintainer workflow approval for this fork PR; onlypr-readinesshas executed at00dbc209.
Checked:
drivers/gpu/drm/apple/apple_drv.c(apple_drm_init_dcp()) andtools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py.- Verified the two-pass loop (
pass = 0withouthdmi-hpd-gpios,pass = 1withhdmi-hpd-gpios) visits every usable DCP node once, preserves thenum_dcp/dcp[]/crtc_mask[]alignment passed toapple_probe_typec_ports(), and leaves non-HDMI hardware order unchanged. - Verified J314s M1 Pro hardware evidence (
00dbc20914e4/c397c4d6f188, 3 rounds ofverify/kvm-repro.sh 0x3f 8 1, 0"cannot follow"errors, 0 Hyprland aborts).
Evidence
- Workflow runs at
00dbc20914e437b0d2d6158071cf4986422fec64:pr-readiness(pull_request_target) succeeded;Apple build and KUnit,Apple DRM KUnit,Host tests, andpr-text(pull_request) arecompleted/action_required;pull_request_targetbuild/test workflows skipped as expected for fork PRs. - Once fork CI workflows are approved and pass green at
00dbc209, this is ready to approve.
|
Also ran this on other MacBook Pros, against main ea7aa36 built the same way, no external displays attached. M2 Max (3 boots with this, 3 with main) and 16-inch M4 Pro (2 and 1) have the HDMI pipeline: with this commit its CRTC and connector are created last there too, and they boot to the desktop with the same omarchy-m-test results as main and no new kernel errors. The 14-inch M4 Pro and the M3 Max have no HDMI pipeline on main, and nothing changes there. One difference on the M2 Max, 2 of 2 boots: the panel's first mode set during boot is the notch-free 3456x2160 that the console gets, where main's first one is 3456x2234. The desktop then sets 3456x2234 as on main, and the screenshots match. I haven't looked into why the order of those first two mode sets moves. The switch-away case itself still needs an external display, so that's only tested on the J314s. |
There was a problem hiding this comment.
Verdict: MERGE at 00dbc20914e4
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - drivers/gpu/drm/apple/apple_drv.c (apple_drm_init_dcp()) and tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py.
- Verified the two-pass loop (
pass = 0withouthdmi-hpd-gpios,pass = 1withhdmi-hpd-gpios) visits every usable DCP node once, preserves thenum_dcp/dcp[]/crtc_mask[]alignment passed toapple_probe_typec_ports(), and leaves non-HDMI hardware order unchanged. - Verified J314s M1 Pro hardware evidence (
00dbc20914e4/c397c4d6f188, 3 rounds ofverify/kvm-repro.sh 0x3f 8 1, 0"cannot follow"errors, 0 Hyprland aborts).
Follow-ups (not blocking): fork CI workflow approval
|
Merging at |
What: With the session locked the HDMI pipeline's CRTC is free although its display is still connected, so a USB-C display that drops and returns (a KVM switch) gets paired with it, every mode is refused (
DP-2 cannot follow its CRTC here) and Hyprland 0.57.2 aborts. This creates the CRTC of the pipeline that hashdmi-hpd-gpiosafter the others, so the first free CRTC an arriving Type-C display gets is one it can be driven from.Tested: J314s M1 Pro at 00dbc20 (candidate c397c4d6f188 on main ea7aa36): boots, the same failed units as plain main, three rounds of locked session plus an 8 s USB-C port disconnect with the HDMI display attached and no compositor abort.
Risk: two-way door · Macs with an HDMI port behind DCP (
hdmi-hpd-gpiosin the DT); the CRTC order changes there, nothing else.Not yet: compositors other than Hyprland.
Details
As far as I can tell Hyprland takes the first free CRTC the connector allows, and the HDMI pipeline's comes first. The abort is Hyprland's to fix as well and I have not reported it there yet; this only stops the kernel from offering a CRTC that cannot work in that state. Most of the diff is the existing loop indented one level for the second pass (
git diff -wis 13 lines). If you'd rather have it without the re-indent, or the order decided somewhere else, say so.Since the first push the host tests failed on this change: the readiness fixture in
lifecycle.pyonly allowed a lookup ofphys, and the driver now also asks forhdmi-hpd-gpios. The fixture answers that now; the driver change is the same.Evidence
CMonitorResources::initFB, after289c00000.dcp: DP-2 cannot follow its CRTC here.verify/kvm-repro.sh 0x3f 8 1three times: 0 x "cannot follow", the same Hyprland pid before and after, crash reports unchanged.Thanks for looking!