From 4c9bbd15513ec14060dad3d28f24cc280d683543 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sat, 12 Sep 2026 12:25:57 -0600 Subject: [PATCH 1/2] feat(hypr): enable direct scanout and allow async tearing for fullscreen games --- default/hypr/apps/retroarch.lua | 1 + default/hypr/apps/steam.lua | 4 ++++ default/hypr/looknfeel.lua | 9 +++++++- .../hypr-direct-scanout-tearing-test.sh | 21 +++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100755 test/shell.d/hypr-direct-scanout-tearing-test.sh diff --git a/default/hypr/apps/retroarch.lua b/default/hypr/apps/retroarch.lua index 0bc8a2180e6b..c4f91b43f920 100644 --- a/default/hypr/apps/retroarch.lua +++ b/default/hypr/apps/retroarch.lua @@ -3,4 +3,5 @@ o.window("com.libretro.RetroArch", { tag = "-default-opacity", opacity = "1 1", idle_inhibit = "fullscreen", + immediate = true, }) diff --git a/default/hypr/apps/steam.lua b/default/hypr/apps/steam.lua index 152aff64c2fb..3c1c037d180f 100644 --- a/default/hypr/apps/steam.lua +++ b/default/hypr/apps/steam.lua @@ -2,3 +2,7 @@ o.window("steam", { float = true, idle_inhibit = "fullscreen" }) o.window({ class = "steam", title = "Steam" }, { center = true, size = { 1100, 700 } }) o.window("steam.*", { tag = "-default-opacity", opacity = "1 1" }) o.window({ class = "steam", title = "Friends List" }, { size = { 460, 800 } }) +-- Enable async tearing / zero-latency presentation for Steam games and Gamescope +o.window("steam_app_.*", { immediate = true }) +o.window("gamescope", { immediate = true }) + diff --git a/default/hypr/looknfeel.lua b/default/hypr/looknfeel.lua index f912169dab72..a0217e6faef8 100644 --- a/default/hypr/looknfeel.lua +++ b/default/hypr/looknfeel.lua @@ -15,10 +15,17 @@ hl.config({ }, resize_on_border = false, - allow_tearing = false, + allow_tearing = true, layout = "dwindle", }, + render = { + -- Direct scanout passes fullscreen frames directly to the display controller, + -- bypassing the compositor pipeline (cuts ~7ms display lag & saves ~1-2W GPU power). + direct_scanout = 2, + }, + + decoration = { rounding = 0, diff --git a/test/shell.d/hypr-direct-scanout-tearing-test.sh b/test/shell.d/hypr-direct-scanout-tearing-test.sh new file mode 100755 index 000000000000..7f0fe98ea218 --- /dev/null +++ b/test/shell.d/hypr-direct-scanout-tearing-test.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -euo pipefail + +source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" + +looknfeel="$ROOT/default/hypr/looknfeel.lua" +steam="$ROOT/default/hypr/apps/steam.lua" +retroarch="$ROOT/default/hypr/apps/retroarch.lua" + +grep -Eq 'allow_tearing[[:space:]]*=[[:space:]]*true' "$looknfeel" || fail "allow_tearing is enabled in looknfeel.lua" +pass "allow_tearing is enabled in looknfeel.lua" + +grep -Eq 'direct_scanout[[:space:]]*=[[:space:]]*2' "$looknfeel" || fail "direct_scanout = 2 is configured in looknfeel.lua" +pass "direct_scanout = 2 is configured in looknfeel.lua" + +grep -Eq 'steam_app_\.\*' "$steam" && grep -Eq 'immediate[[:space:]]*=[[:space:]]*true' "$steam" || fail "immediate rule configured for steam apps" +pass "immediate presentation rule is configured for Steam games" + +grep -Eq 'immediate[[:space:]]*=[[:space:]]*true' "$retroarch" || fail "immediate rule configured for retroarch" +pass "immediate presentation rule is configured for RetroArch" From 5e936e3ba4fbe39d3733242970c83b2c5af4da7c Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sat, 12 Sep 2026 16:25:43 -0600 Subject: [PATCH 2/2] feat(hypr): enable automatic direct scanout for games --- default/hypr/apps/retroarch.lua | 1 - default/hypr/apps/steam.lua | 4 ---- default/hypr/looknfeel.lua | 7 ++----- .../hypr-direct-scanout-tearing-test.sh | 21 ------------------- test/shell.d/hypr-direct-scanout-test.sh | 13 ++++++++++++ 5 files changed, 15 insertions(+), 31 deletions(-) delete mode 100755 test/shell.d/hypr-direct-scanout-tearing-test.sh create mode 100755 test/shell.d/hypr-direct-scanout-test.sh diff --git a/default/hypr/apps/retroarch.lua b/default/hypr/apps/retroarch.lua index c4f91b43f920..0bc8a2180e6b 100644 --- a/default/hypr/apps/retroarch.lua +++ b/default/hypr/apps/retroarch.lua @@ -3,5 +3,4 @@ o.window("com.libretro.RetroArch", { tag = "-default-opacity", opacity = "1 1", idle_inhibit = "fullscreen", - immediate = true, }) diff --git a/default/hypr/apps/steam.lua b/default/hypr/apps/steam.lua index 3c1c037d180f..152aff64c2fb 100644 --- a/default/hypr/apps/steam.lua +++ b/default/hypr/apps/steam.lua @@ -2,7 +2,3 @@ o.window("steam", { float = true, idle_inhibit = "fullscreen" }) o.window({ class = "steam", title = "Steam" }, { center = true, size = { 1100, 700 } }) o.window("steam.*", { tag = "-default-opacity", opacity = "1 1" }) o.window({ class = "steam", title = "Friends List" }, { size = { 460, 800 } }) --- Enable async tearing / zero-latency presentation for Steam games and Gamescope -o.window("steam_app_.*", { immediate = true }) -o.window("gamescope", { immediate = true }) - diff --git a/default/hypr/looknfeel.lua b/default/hypr/looknfeel.lua index a0217e6faef8..f75c56d7a2fc 100644 --- a/default/hypr/looknfeel.lua +++ b/default/hypr/looknfeel.lua @@ -15,17 +15,14 @@ hl.config({ }, resize_on_border = false, - allow_tearing = true, + allow_tearing = false, layout = "dwindle", }, render = { - -- Direct scanout passes fullscreen frames directly to the display controller, - -- bypassing the compositor pipeline (cuts ~7ms display lag & saves ~1-2W GPU power). + -- Attempt direct scanout automatically for fullscreen game content. direct_scanout = 2, }, - - decoration = { rounding = 0, diff --git a/test/shell.d/hypr-direct-scanout-tearing-test.sh b/test/shell.d/hypr-direct-scanout-tearing-test.sh deleted file mode 100755 index 7f0fe98ea218..000000000000 --- a/test/shell.d/hypr-direct-scanout-tearing-test.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" - -looknfeel="$ROOT/default/hypr/looknfeel.lua" -steam="$ROOT/default/hypr/apps/steam.lua" -retroarch="$ROOT/default/hypr/apps/retroarch.lua" - -grep -Eq 'allow_tearing[[:space:]]*=[[:space:]]*true' "$looknfeel" || fail "allow_tearing is enabled in looknfeel.lua" -pass "allow_tearing is enabled in looknfeel.lua" - -grep -Eq 'direct_scanout[[:space:]]*=[[:space:]]*2' "$looknfeel" || fail "direct_scanout = 2 is configured in looknfeel.lua" -pass "direct_scanout = 2 is configured in looknfeel.lua" - -grep -Eq 'steam_app_\.\*' "$steam" && grep -Eq 'immediate[[:space:]]*=[[:space:]]*true' "$steam" || fail "immediate rule configured for steam apps" -pass "immediate presentation rule is configured for Steam games" - -grep -Eq 'immediate[[:space:]]*=[[:space:]]*true' "$retroarch" || fail "immediate rule configured for retroarch" -pass "immediate presentation rule is configured for RetroArch" diff --git a/test/shell.d/hypr-direct-scanout-test.sh b/test/shell.d/hypr-direct-scanout-test.sh new file mode 100755 index 000000000000..76689abf42cf --- /dev/null +++ b/test/shell.d/hypr-direct-scanout-test.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -euo pipefail + +source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" + +looknfeel="$ROOT/default/hypr/looknfeel.lua" + +grep -Eq 'direct_scanout[[:space:]]*=[[:space:]]*2' "$looknfeel" || fail "direct_scanout = 2 is not configured" +pass "direct scanout is automatic for fullscreen game content" + +grep -Eq 'allow_tearing[[:space:]]*=[[:space:]]*false' "$looknfeel" || fail "async tearing was enabled with direct scanout" +pass "direct scanout does not enable experimental tearing"