From e121b06fd879f4fbb62590d8f2d14c481b559269 Mon Sep 17 00:00:00 2001 From: rickpeters Date: Sun, 27 Sep 2026 12:27:08 +0200 Subject: [PATCH] fix: Remove whatever is left of HDMI refresh boost, pin or no pin --- AGENTS.md | 7 +++++-- CHANGELOG.md | 6 ++++-- lib/hdmi-refresh.sh | 35 ++++++++++++++--------------------- lib/menu.sh | 8 +++++--- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index c9988b1..50c3983 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -222,8 +222,11 @@ gamescope and the Plasma desktop. Primary target: the Valve Steam Machine `steamify-fremont-poweroff` (`patches/steamify-fremont-poweroff.c`) clears it in a power-off-prepare handler, built for each kernel. It made the kernel pin unnecessary: `kpin` is only available while on (`kpin_available`), and - `detect_components` unticks it (and `hdmi`, which needs the pinned - kernel), so a normal run removes an existing pin. CachyOS's + `detect_components` unticks it, so a normal run removes an existing pin. + `hdmi` (it needed the pin) is retired the same way: `hdmi_status` is on + while anything of it is left (saved displays, hotplug unit, EDID files, + old kernel parameter), `hdmi_available` only then, it's always unticked, + and `hdmi_disable` removes all of it. CachyOS's `linux-cachyos` is clang-built, `-bore` GCC-built: let DKMS pick the compiler, never pass `LLVM=1`. Test shutdown on the real machine for every new major kernel. diff --git a/CHANGELOG.md b/CHANGELOG.md index a4a6e10..969785f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,8 +19,10 @@ one per merged pull request. rebooted. - The kernel pin is no longer offered. An existing pin is shown unticked, so the next run removes it and brings back CachyOS's current kernel; - HDMI refresh boost, which needs the pinned kernel, goes with it (newer - kernels do HDMI 2.1 themselves). + HDMI refresh boost, which needs the pinned kernel, is retired too + (newer kernels do HDMI 2.1 themselves): whatever is left of it (saved + displays, also ones not connected, its hotplug script, the old kernel + parameter) is unticked and removed by the next run, pin or no pin. - Feature versions: each component records the version of what it set up; when a release changes a component, installs with an older version are ticked and updated by a normal run ("update" in the plan and the diff --git a/lib/hdmi-refresh.sh b/lib/hdmi-refresh.sh index a2a8fd8..b3b8ea2 100644 --- a/lib/hdmi-refresh.sh +++ b/lib/hdmi-refresh.sh @@ -56,18 +56,17 @@ hdmi_cmdline_param() { } hdmi_available() { - # Stays available while on, so it can be turned off after the pin is gone. - detect_valve_fremont || return 1 - # Saved displays too, so they can be removed without the pin. - hdmi_status || [[ -n "$(hdmi_saved)" ]] || { pinned_kernel_installed && [[ -n "$(hdmi_connectors)" ]]; } + # No longer offered (it needed the pinned kernel): only shown while + # anything of it is left, so a normal run removes it. + detect_valve_fremont && hdmi_status } hdmi_status() { - # On = the connected display runs on its saved EDID. Another display on - # the port is off, so ticking it sets that one up. The command line: set - # up by an older version, re-applying moves it over. - [[ -n "$(hdmi_active_ids)" ]] || - { [[ -n "$(hdmi_cmdline_param)" ]] && compgen -G "$HDMI_FW_DIR/steamify-*.bin" >/dev/null; } + # On while anything of it is left: saved displays (connected or not), the + # hotplug script, an EDID file, or the kernel parameter of versions + # before 2.1.0. + [[ -n "$(hdmi_saved)" || -f "$HDMI_UNIT" || -n "$(hdmi_cmdline_param)" ]] || + compgen -G "$HDMI_FW_DIR/steamify-*.bin" >/dev/null } hdmi_saved() { [[ -f "$HDMI_MAP" ]] && grep -v '^#' "$HDMI_MAP"; } @@ -688,16 +687,10 @@ hdmi_enable() { } hdmi_disable() { - # For the connected display; other saved displays stay (the app lists - # them). Without the pinned kernel none may stay: newer kernels read the - # EDID themselves. - local id - if [[ -n "$(hdmi_cmdline_param)" ]]; then - hdmi_forget all; hdmi_remove_boot_param || return 1; state_clear hdmi - elif [[ "${WANTED[kpin]:-1}" == 0 ]] || ! pinned_kernel_installed; then - hdmi_forget all - else - for id in $(hdmi_active_ids); do hdmi_forget "$id"; done - fi - ok "HDMI refresh boost removed for the connected display; it uses its own EDID again." + # Everything, for every saved display: newer kernels read the whole EDID + # themselves, and an old one loaded at the next hotplug would be wrong. + hdmi_forget all + hdmi_remove_boot_param || return 1 + state_clear hdmi + ok "HDMI refresh boost removed; displays use their own EDID again." } diff --git a/lib/menu.sh b/lib/menu.sh index 95f8123..6e1742f 100644 --- a/lib/menu.sh +++ b/lib/menu.sh @@ -108,9 +108,11 @@ detect_components() { component_available "$c" || continue { feature_outdated "$c" || feature_new "$c"; } && WANTED[$c]=1 done - # The kernel pin is no longer needed (the power-off fix): drop it, and - # HDMI refresh boost, which needs it, on a normal run. - if component_available kpin; then WANTED[kpin]=0; WANTED[hdmi]=0; fi + # The kernel pin is no longer needed (the power-off fix), and HDMI + # refresh boost needed the pin: whatever is left of either is unticked, + # so a normal run removes it. + component_available kpin && WANTED[kpin]=0 + component_available hdmi && WANTED[hdmi]=0 # The terminal-only Steamify shortcut from before 2.0.1: tick it, so a # normal run replaces it with the app. launcher_repair && WANTED[launcher]=1