srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/wayland/Cargo.toml
diff options
context:
space:
mode:
authorsrdusr <[email protected]>2025-03-21 23:23:00 +0200
committersrdusr <[email protected]>2025-03-21 23:23:00 +0200
commitef4bc112b8507880ddfa53ffce45505762384612 (patch)
tree7c46b4d0c67ec9949b510082630245eac3cafdc0 /crates/wayland/Cargo.toml
parent9f7744698128d7effb234eb9021b67707db3f721 (diff)
downloadsrdwm-ef4bc112b8507880ddfa53ffce45505762384612.tar.gz
srdwm-ef4bc112b8507880ddfa53ffce45505762384612.zip
Add opt-in GBM+EGL capability probe (Phase 1 of GPU rendering)
The udev backend is, by explicit design, 100% software: PixmanRenderer compositing into legacy KMS dumb buffers. That was a deliberate choice for portability (dumb buffers work on essentially any DRM driver, including a VM with no GBM/3D support), not an oversight - but this machine's real hardware (Intel UHD 620, i915) should support real GBM+EGL rendering, and the user has asked for a genuine GPU-accelerated path, GPU preferred with CPU fallback, built as a separate track that doesn't risk the working software path. Adds `udev/gpu.rs::probe`: gated behind `SRDWM_GPU=1` (unset by default - a no-op, zero behavior change for every session that doesn't set it), attempts GBM device creation on a duped DRM fd, EGL display/device creation, and a software-rasterizer check, logging exactly which step failed if any and falling back silently. Wired in at udev backend startup, right after the DRM fd is opened. Deliberately does not yet create an EGLContext, a GlesRenderer, or touch scanout at all. Reading smithay's own reference compositor (anvil/src/udev.rs) confirmed it wires GBM+EGL rendering together with atomic-KMS scanout as one unit via DrmCompositor, not as a renderer swapped into the existing legacy set_crtc/page_flip flip loop this backend uses today. Adopting DrmCompositor is separate, larger-scoped work than "swap the renderer" - it replaces the same UdevHead mode-set/flip machinery the VT-switch fixes (register_session_notifier's ActivateSession arm, copy_and_flip's retry backoff) live in, and needs its own plan. This probe answers the first question - does the hardware even support it at all - safely, before that larger integration is scoped and attempted. Cargo.toml: added backend_egl/backend_gbm smithay features, additive to the existing renderer_pixman path (unchanged, still the default).
Diffstat (limited to 'crates/wayland/Cargo.toml')
-rw-r--r--crates/wayland/Cargo.toml7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/wayland/Cargo.toml b/crates/wayland/Cargo.toml
index 1ddddc6..ac6f771 100644
--- a/crates/wayland/Cargo.toml
+++ b/crates/wayland/Cargo.toml
@@ -62,6 +62,13 @@ features = [
"backend_libinput",
"backend_udev",
"backend_session_libseat",
+ # `backend_egl`/`backend_gbm`: the udev backend's opt-in (`SRDWM_GPU=1`)
+ # GPU render path - see `udev/gpu.rs`'s own module doc comment. Additive
+ # to the existing `renderer_pixman` dumb-buffer path below, not a
+ # replacement: that path stays the default for portability (a low-spec
+ # machine or a VM with no GBM/3D support still needs it to work).
+ "backend_egl",
+ "backend_gbm",
"renderer_gl",
"renderer_pixman",
"desktop",