From 9c3b8e48ee9949ee0e7b20d5f4718262a5de713b Mon Sep 17 00:00:00 2001 From: ergosteur <1992147+ergosteur@users.noreply.github.com> Date: Sun, 27 Sep 2026 11:57:44 -0400 Subject: [PATCH] Fix kernel 7.x black screen under Plasma Login via DPMS cycle An apt upgrade switched the display manager from SDDM to plasmalogin, whose kwin_wayland greeter never runs the SDDM Xsetup hook. Add a plasma-login.service user drop-in that cycles DPMS off/on with kscreen-doctor on 7.x kernels, forcing the full modeset that un-sticks i915 pipe A (a plain resolution change is absorbed by the eDP panel fitter and doesn't help). Verified across a cold reboot. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 33 ++++++++++++++++++++++-- setup-i915-kernel7-fix.sh | 53 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 80 insertions(+), 6 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 34c3f9c..f5de196 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -3,7 +3,7 @@ ## Agent-accessible host - **hp-chell** (`hp-chell.lan.1qaz.ca`) — KDE neon (Debian-based) x86_64 laptop (Intel Core m7-6Y75, 4 cores, 15GiB RAM, 117GB disk, Intel HD Graphics 515), full sudo (nopasswd) account `agent-user` (uid 60123). Provisioned 2026-09-03. - - Auth: SSH key preferred (this machine's `~/.ssh/id_ed25519.pub` is already in the host's `authorized_keys`) — `ssh agent-user@hp-chell.lan.1qaz.ca`. + - Auth: SSH key preferred (this machine's `~/.ssh/id_ed25519.pub` is already in the host's `authorized_keys`) — `ssh agent-user@hp-chell.lan.1qaz.ca`. When working *on* hp-chell itself as `matt` (no nopasswd sudo), `matt`'s own `~/.ssh/id_ed25519.pub` is also authorized (added 2026-09-27) — use `ssh agent-user@localhost 'sudo ...'` for root. - Fallback password: stored in local Bitwarden vault, item id `1db3b9f6-a82e-4692-846a-b4bb002a5be6` (name "agent-user@hp-chell.lan.1qaz.ca (SSH)") — fetch with `bw get password 1db3b9f6-a82e-4692-846a-b4bb002a5be6` (vault must be unlocked; `bw unlock`). - Host inventory/specs: see `~/AGENT_INFO.md` on the host itself. Original provisioning prompt saved at `~/AGENT_PROMPT.txt` on the host. - Groups: adm,cdrom,sudo,dip,plugdev,lpadmin,sambashare,docker. Has docker, tailscale0 interface (not connected as of provisioning), python3.12, git, jq, rsync, tmux. @@ -71,8 +71,37 @@ selects the newest installed kernel, so `7.0.0-30-generic` is what boots by default now; `6.17.0-42-generic` remains available via the GRUB "Advanced options" submenu as a known-good fallback if ever needed. +**2026-09-27, SDDM → Plasma Login**: an `apt upgrade` (which also +brought kernel `7.0.0-34-generic`) switched the display manager to +`plasmalogin` (`/etc/X11/default-display-manager`). Its greeter runs +under `kwin_wayland` (user `plasmalogin`, uid 984, `plasma-login*.service` +in its systemd *user* manager), so the SDDM `Xsetup` hook above no +longer fires and the black screen came back. Findings: +- A resolution change via `kscreen-doctor` (1600x900 and back) is **not** + enough under KWin: the eDP panel fitter absorbs it (kernel adjusted + mode stays native 3200x1800, no real pipe modeset). Going to 1600x900 + and staying there would also be unusable anyway — KWin keeps the 1.85x + scale, giving an 865x487 logical greeter. +- A DPMS cycle (`kscreen-doctor --dpms off` then `--dpms on`) fully + disables the CRTC (`i915_display_info` shows pipe A `active=no`) and + its re-enable is a genuine full modeset — that un-sticks the pipe. +- `kscreen-doctor` needs the greeter's session bus to *apply* changes + (`DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/984/bus`, + `WAYLAND_DISPLAY=wayland-0`); with `KSCREEN_BACKEND_INPROCESS=1` it + reads outputs fine but silently fails to set ("Cannot find output + with id 1"). Mode specs must match exactly (`1600x900@59.95`, not + `@60`) or use mode ids. +- i915 debugfs is under `/sys/kernel/debug/dri/1/` on this box (DRM + minor 1), not `dri/0`. + +Fix: `/usr/local/libexec/hp-chell-i915-dpms-cycle` (no-op unless kernel +`7.*` and user `plasmalogin`; waits for KWin, then cycles DPMS), run via +`/etc/systemd/user/plasma-login.service.d/10-i915-kernel7-dpms-cycle.conf` +as `ExecStartPre` (plasma-login.service is ordered after +plasma-login-kwin_wayland.service, so KWin is already up). + Setup script for a fresh install: `setup-i915-kernel7-fix.sh` (in this -repo) installs the `Xsetup` fix and sets `GRUB_TIMEOUT=5` / +repo) installs both the SDDM `Xsetup` fix and the Plasma Login drop-in, and sets `GRUB_TIMEOUT=5` / `GRUB_TIMEOUT_STYLE=menu` so the boot menu is visible for 5s. Idempotent, safe to re-run. diff --git a/setup-i915-kernel7-fix.sh b/setup-i915-kernel7-fix.sh index 7df1c0a..63a1740 100755 --- a/setup-i915-kernel7-fix.sh +++ b/setup-i915-kernel7-fix.sh @@ -4,10 +4,11 @@ # Run on a fresh hp-chell (HP Chromebook 13 "chell", coreboot/MrChromebox # firmware, KDE neon) install to apply two things: # -# 1. The kernel 7.x cold-boot black-screen workaround: a -# /usr/share/sddm/scripts/Xsetup hook that forces a second modeset -# on eDP-1 to un-stick i915's pipe A on 7.x kernels. See project -# CLAUDE.md for the full diagnosis writeup. +# 1. The kernel 7.x cold-boot black-screen workaround, which forces a +# second modeset on eDP-1 to un-stick i915's pipe A on 7.x kernels: +# a /usr/share/sddm/scripts/Xsetup hook (SDDM) and a +# plasma-login.service drop-in doing a DPMS cycle (Plasma Login). +# See project CLAUDE.md for the full diagnosis writeup. # 2. GRUB_TIMEOUT=5 / GRUB_TIMEOUT_STYLE=menu, so the boot menu is # visible for 5 seconds (useful for picking a fallback kernel like # 6.17.0-42-generic if a future 7.x point release regresses again). @@ -50,6 +51,50 @@ esac EOF chmod 755 /usr/share/sddm/scripts/Xsetup +# Plasma Login (plasmalogin, replaced SDDM on neon in 2026-09) runs its +# greeter under kwin_wayland, so the SDDM Xsetup hook above never fires. +# Equivalent fix there: a DPMS off/on cycle via kscreen-doctor, run from +# the greeter's own systemd user manager right after KWin comes up. A +# plain resolution change is NOT enough under KWin -- the eDP panel +# fitter absorbs it as a fastset without a real pipe modeset; DPMS off +# fully disables the CRTC so the "on" is a genuine full modeset. +echo "==> installing plasmalogin greeter i915 kernel-7.x workaround" +install -d /usr/local/libexec +cat > /usr/local/libexec/hp-chell-i915-dpms-cycle << 'EOF' +#!/bin/sh +# Run as the plasmalogin greeter user (from plasma-login.service's +# ExecStartPre). Forces a full modeset on kernel 7.x to un-stick i915 +# pipe A after the cold-boot first modeset. See hp-chell CLAUDE.md. +case "$(uname -r)" in + 7.*) ;; + *) exit 0 ;; +esac +[ "$(id -un)" = plasmalogin ] || exit 0 + +export WAYLAND_DISPLAY="${WAYLAND_DISPLAY:-wayland-0}" +export QT_QPA_PLATFORM=wayland + +# wait (up to ~20s) for KWin's output management to answer +i=0 +until kscreen-doctor -o >/dev/null 2>&1; do + i=$((i + 1)) + [ "$i" -ge 40 ] && { echo "kscreen-doctor never came up" >&2; exit 0; } + sleep 0.5 +done + +kscreen-doctor --dpms off >/dev/null 2>&1 +sleep 1 +kscreen-doctor --dpms on >/dev/null 2>&1 +echo "cycled DPMS off/on (i915 kernel 7.x cold-boot workaround)" +EOF +chmod 755 /usr/local/libexec/hp-chell-i915-dpms-cycle + +install -d /etc/systemd/user/plasma-login.service.d +cat > /etc/systemd/user/plasma-login.service.d/10-i915-kernel7-dpms-cycle.conf << 'EOF' +[Service] +ExecStartPre=-/usr/local/libexec/hp-chell-i915-dpms-cycle +EOF + echo "==> setting GRUB_TIMEOUT=5 / GRUB_TIMEOUT_STYLE=menu" grub_conf=/etc/default/grub