Skip to content
Snippets Groups Projects
Commit ddf31e44 authored by Aleksei Bavshin's avatar Aleksei Bavshin Committed by Aleksei Bavshin
Browse files

sway: fallback to legacy DRM interface on virtio

Some time ago, 'WLR_RENDERER=pixman' stopped working properly on virtio.
Appears that it only affects the atomic KMS and falling back to the
legacy DRM interface was enough to work around.

While legacy is a less tested codepath, I don't see any other ways to
address that :'(
parent d414e06e
No related branches found
No related tags found
1 merge request!22sway: fallback to legacy DRM interface on virtio
......@@ -41,10 +41,19 @@ chmod +x ${RUN_SCRIPT}
# Set some compatibility variables if we're in a VM
if systemd-detect-virt --quiet --vm; then
export WLR_NO_HARDWARE_CURSORS=1
export WLR_RENDERER=pixman
fi
case $(systemd-detect-virt --vm) in
"none"|"")
;;
"kvm")
# WLR_NO_HARDWARE_CURSORS=1 is not needed with legacy DRM interface
export WLR_RENDERER=pixman
export WLR_DRM_NO_ATOMIC=1
;;
*)
# https://github.com/swaywm/sway/issues/6581
export WLR_NO_HARDWARE_CURSORS=1
;;
esac
sway --config=${CONFIG_FILE}
exit_code=$(< ${EXIT_CODE_SAVE})
......
......@@ -12,9 +12,18 @@ if [ -x /usr/bin/start-sway ]; then
fi
# Set some compatibility variables in case if sway-config-fedora is not present
if systemd-detect-virt --quiet --vm; then
export WLR_NO_HARDWARE_CURSORS=1
export WLR_RENDERER=pixman
fi
case $(systemd-detect-virt --vm) in
"none"|"")
;;
"kvm")
# WLR_NO_HARDWARE_CURSORS=1 is not needed with legacy DRM interface
export WLR_RENDERER=pixman
export WLR_DRM_NO_ATOMIC=1
;;
*)
# https://github.com/swaywm/sway/issues/6581
export WLR_NO_HARDWARE_CURSORS=1
;;
esac
exec /usr/bin/sway "$@"
......@@ -16,8 +16,6 @@ case $(systemd-detect-virt --vm) in
"none"|"")
;;
"kvm")
# https://github.com/swaywm/sway/issues/6581
export WLR_NO_HARDWARE_CURSORS=1
# There's two drivers we can get here, depending on the 3D acceleration
# flag state: either virtio_gpu/virgl or kms_swrast/llvmpipe.
#
......@@ -30,6 +28,10 @@ case $(systemd-detect-virt --vm) in
#
# See also: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/2871
export WLR_RENDERER=pixman
# 'pixman' on virtio_gpu with recent kernels is glitchy. Appears that
# it only affects atomic KMS, and legacy interface works.
export WLR_DRM_NO_ATOMIC=1
# WLR_NO_HARDWARE_CURSORS=1 is not needed with legacy DRM interface
;;
*)
# https://github.com/swaywm/sway/issues/6581
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment