diff options
| author | srdusr <[email protected]> | 2025-05-28 09:42:00 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2025-05-28 09:42:00 +0200 |
| commit | 6a9e50280ad8262e9fe49e390527e7490564f8dd (patch) | |
| tree | 6911dbfe68ac983c228b5c9fc9320beae42b6e6a /crates/config/src | |
| parent | d0103908bd1c316bdebaa48e13aae332cffdeabf (diff) | |
| download | srdwm-6a9e50280ad8262e9fe49e390527e7490564f8dd.tar.gz srdwm-6a9e50280ad8262e9fe49e390527e7490564f8dd.zip | |
Add a real general.gpu config option for the GPU render path
SRDWM_GPU=1 was the only way to opt into the udev backend's GBM+EGL
GPU render path - an env var, not a real config option, with no way
to enable it from init.lua the way every other general.* flag works.
WindowManager::gpu_enabled (plain bool, false by default - unlike
rounded_corners_enabled's Option<bool>, GPU rendering has one
unambiguous default regardless of which backend ends up connecting,
so there's no "let the backend decide" case to preserve) is read from
general.gpu in apply_general_settings, same as every other general.*
key. gpu::probe now takes an explicit enabled: bool instead of
checking the env var itself; udev/platform.rs's call site computes it
as wm.gpu_enabled OR SRDWM_GPU=1, so the env var still works as a
quick manual override for testing without touching config, on top of
the new persistent option.
Falls back to the existing software (Pixman) path exactly as before
on any failure at any step (no GBM device, no atomic-modesetting
support, a software-only EGL renderer, ...) - gpu::probe's own
fallback behavior is unchanged, only how the initial enabled/disabled
decision gets made.
Diffstat (limited to 'crates/config/src')
| -rw-r--r-- | crates/config/src/engine/support.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/config/src/engine/support.rs b/crates/config/src/engine/support.rs index b67a688..9f7e537 100644 --- a/crates/config/src/engine/support.rs +++ b/crates/config/src/engine/support.rs @@ -144,6 +144,16 @@ pub(super) fn default_config() -> HashMap<String, ConfigValue> { set("general.animation_duration", Number(200.0)); set("general.shadows", Bool(true)); set("general.resize_margin", Number(6.0)); + // `false`: real GBM+EGL+`DrmCompositor` GPU rendering on the udev + // backend is opt-in and still missing real window content/decoration + // support (see `crates/wayland/src/udev/gpu.rs`'s own module doc + // comment for exactly what it does render) - unlike `general. + // rounded_corners` just above, this has one unambiguous default + // regardless of which backend ends up connecting (GPU rendering is + // udev-only and experimental everywhere), so it's seeded here like + // every other ordinary flag rather than left absent for a backend to + // decide. + set("general.gpu", Bool(false)); // Deliberately *not* seeded here, unlike every other `general.*` key -- // its actual default differs by backend (GLES/winit: on; udev/Pixman: // off, an untested-on-real-hardware CPU cost too real to default to on |