mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-11-22 08:13:59 +00:00
fix(compositor): allow the software renderer when asked, and ask in the VM
QEMU's default virtio-gpu has no 3D acceleration, so Mesa offers only a software EGL device, which the DRM backend refused; the compositor took the display but had no renderer for its output. WEFT_ALLOW_SOFTWARE_RENDERING lets it use that device, and the VM's compositor unit sets it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QS8QcxvhVJwU3X2qhPamUW
This commit is contained in:
parent
538c752d80
commit
4d5590c73e
2 changed files with 10 additions and 3 deletions
|
|
@ -311,8 +311,10 @@ fn device_added(state: &mut WeftCompositorState, node: DrmNode, path: &Path) ->
|
||||||
let egl_display =
|
let egl_display =
|
||||||
unsafe { EGLDisplay::new(gbm.clone()).context("EGLDisplay::new failed")? };
|
unsafe { EGLDisplay::new(gbm.clone()).context("EGLDisplay::new failed")? };
|
||||||
let egl_device = EGLDevice::device_for_display(&egl_display).context("no EGL device")?;
|
let egl_device = EGLDevice::device_for_display(&egl_display).context("no EGL device")?;
|
||||||
if egl_device.is_software() {
|
// A software renderer is refused unless asked for: it is the only
|
||||||
anyhow::bail!("software renderer");
|
// one a virtual GPU without 3D acceleration offers.
|
||||||
|
if egl_device.is_software() && std::env::var_os("WEFT_ALLOW_SOFTWARE_RENDERING").is_none() {
|
||||||
|
anyhow::bail!("software renderer (set WEFT_ALLOW_SOFTWARE_RENDERING to use it)");
|
||||||
}
|
}
|
||||||
let rn = egl_device
|
let rn = egl_device
|
||||||
.try_get_render_node()
|
.try_get_render_node()
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,12 @@
|
||||||
# units after it; a restarted compositor must not inherit it, or an
|
# units after it; a restarted compositor must not inherit it, or an
|
||||||
# X11 DISPLAY, or it would pick the nested backend.
|
# X11 DISPLAY, or it would pick the nested backend.
|
||||||
UnsetEnvironment = "WAYLAND_DISPLAY DISPLAY";
|
UnsetEnvironment = "WAYLAND_DISPLAY DISPLAY";
|
||||||
Environment = "LIBSEAT_BACKEND=seatd";
|
Environment = [
|
||||||
|
"LIBSEAT_BACKEND=seatd"
|
||||||
|
# QEMU's default virtio-gpu has no 3D acceleration; Mesa renders in
|
||||||
|
# software.
|
||||||
|
"WEFT_ALLOW_SOFTWARE_RENDERING=1"
|
||||||
|
];
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = "1";
|
RestartSec = "1";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue