From 0d9bdd9d86b72da96c696155f63a2cc7ccf8d29b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 11 Nov 2024 21:17:44 +0100 Subject: [PATCH 1/2] Switch VT before starting weston libseat >= 0.9.0 doesn't do that anymore, and it's necessary to get access to devices. More details at https://lists.sr.ht/~kennylevinsen/seatd-devel/%3CZy_-FRQnBTeNPXVj@mail-itl%3E https://github.com/QubesOS/qubes-issues/issues/9568 --- scripts/run-gui-backend.guiweston | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/run-gui-backend.guiweston b/scripts/run-gui-backend.guiweston index 76c91c3..cd0b7fa 100755 --- a/scripts/run-gui-backend.guiweston +++ b/scripts/run-gui-backend.guiweston @@ -24,6 +24,11 @@ EOF chmod +x ${RUN_SCRIPT} +if [ -n "$XDG_VTNR" ]; then + # change to VT on which we run to get access to devices + chvt "${XDG_VTNR}" +fi + weston --config=${CONFIG_FILE} --socket=wl-firstboot-0 exit_code=$(< ${EXIT_CODE_SAVE}) From 7d0349cac2e74c200444107d39f4802ad6e5a06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 20 Nov 2024 20:28:07 +0100 Subject: [PATCH 2/2] Try to use outputs on all cards Normally weston uses card0 only. In dual-GPU setup, it may not be the one with monitor connected, and when it doesn't find any connector monitor, it fails to startup. Look also at outputs connected to other cards too. There doesn't seems to be any option to check all connected devices, so enumerate them via sysfs manually. --- scripts/run-gui-backend.guiweston | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/run-gui-backend.guiweston b/scripts/run-gui-backend.guiweston index cd0b7fa..1e266c6 100755 --- a/scripts/run-gui-backend.guiweston +++ b/scripts/run-gui-backend.guiweston @@ -29,7 +29,13 @@ if [ -n "$XDG_VTNR" ]; then chvt "${XDG_VTNR}" fi -weston --config=${CONFIG_FILE} --socket=wl-firstboot-0 +cards=$(ls -d /sys/class/drm/card*| grep -v -- -| cut -d / -f 5) +primary_card=$(echo "$cards" | head -1 ) +secondary_cards=$(echo "$cards"| + tail -n +2| + xargs printf "%s,") + +weston --config=${CONFIG_FILE} --socket=wl-firstboot-0 --drm-device="$primary_card" --additional-devices="$secondary_cards" exit_code=$(< ${EXIT_CODE_SAVE}) rm ${CONFIG_FILE} ${RUN_SCRIPT} ${EXIT_CODE_SAVE}