1 |
commit: 5ab1ba64e93bc0d4ee88f02d9663ea138c1c6ff0 |
2 |
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Sep 6 23:09:16 2022 +0000 |
4 |
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 7 02:10:04 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ab1ba64 |
7 |
|
8 |
x11-wm/mutter: Reenable tests |
9 |
|
10 |
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org> |
11 |
|
12 |
...d-native-Don-t-warn-on-EACCES-if-headless.patch | 79 ++++++++++++++++++++++ |
13 |
.../{mutter-42.4.ebuild => mutter-42.4-r1.ebuild} | 3 +- |
14 |
2 files changed, 81 insertions(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/x11-wm/mutter/files/mutter-42.4-backend-native-Don-t-warn-on-EACCES-if-headless.patch b/x11-wm/mutter/files/mutter-42.4-backend-native-Don-t-warn-on-EACCES-if-headless.patch |
17 |
new file mode 100644 |
18 |
index 000000000000..98b58d3dfeff |
19 |
--- /dev/null |
20 |
+++ b/x11-wm/mutter/files/mutter-42.4-backend-native-Don-t-warn-on-EACCES-if-headless.patch |
21 |
@@ -0,0 +1,79 @@ |
22 |
+From db854a8588c1164df2f54c5718930aadf353b948 Mon Sep 17 00:00:00 2001 |
23 |
+From: Simon McVittie <smcv@××××××.org> |
24 |
+Date: Thu, 18 Aug 2022 10:41:01 +0100 |
25 |
+Subject: [PATCH] backend/native: Don't warn on EACCES if headless |
26 |
+ |
27 |
+Since commit 1bf70334 "tests/runner: Make test runner use the headless |
28 |
+backend", tests are run with the native backend in headless mode, which |
29 |
+will attempt to open each GPU and show a warning (fatal during tests) |
30 |
+if it cannot. |
31 |
+ |
32 |
+However, in headless mode we might not be logged in on any seat (for |
33 |
+example we might be logged in via ssh instead), which means we might |
34 |
+legitimately not have permission to use any GPUs, even if they exist. |
35 |
+Downgrade the warning to a debug message in this case. |
36 |
+ |
37 |
+Resolves: https://gitlab.gnome.org/GNOME/mutter/-/issues/2381 |
38 |
+Signed-off-by: Simon McVittie <smcv@××××××.org> |
39 |
+Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2584> |
40 |
+(cherry picked from commit 64a67aa00bfe54fe7219d7f581950897fcbf9a75) |
41 |
+--- |
42 |
+ src/backends/native/meta-backend-native.c | 35 +++++++++++++++++++---- |
43 |
+ 1 file changed, 30 insertions(+), 5 deletions(-) |
44 |
+ |
45 |
+diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c |
46 |
+index 224538787..a2babb4b0 100644 |
47 |
+--- a/src/backends/native/meta-backend-native.c |
48 |
++++ b/src/backends/native/meta-backend-native.c |
49 |
+@@ -514,8 +514,20 @@ on_udev_device_added (MetaUdev *udev, |
50 |
+ new_gpu_kms = create_gpu_from_udev_device (native, device, &error); |
51 |
+ if (!new_gpu_kms) |
52 |
+ { |
53 |
+- g_warning ("Failed to hotplug secondary gpu '%s': %s", |
54 |
+- device_path, error->message); |
55 |
++ if (meta_backend_is_headless (backend) && |
56 |
++ g_error_matches (error, G_IO_ERROR, |
57 |
++ G_IO_ERROR_PERMISSION_DENIED)) |
58 |
++ { |
59 |
++ meta_topic (META_DEBUG_BACKEND, |
60 |
++ "Ignoring unavailable secondary gpu '%s': %s", |
61 |
++ device_path, error->message); |
62 |
++ } |
63 |
++ else |
64 |
++ { |
65 |
++ g_warning ("Failed to hotplug secondary gpu '%s': %s", |
66 |
++ device_path, error->message); |
67 |
++ } |
68 |
++ |
69 |
+ return; |
70 |
+ } |
71 |
+ |
72 |
+@@ -552,9 +564,22 @@ init_gpus (MetaBackendNative *native, |
73 |
+ |
74 |
+ if (!gpu_kms) |
75 |
+ { |
76 |
+- g_warning ("Failed to open gpu '%s': %s", |
77 |
+- g_udev_device_get_device_file (device), |
78 |
+- local_error->message); |
79 |
++ if (meta_backend_is_headless (backend) && |
80 |
++ g_error_matches (local_error, G_IO_ERROR, |
81 |
++ G_IO_ERROR_PERMISSION_DENIED)) |
82 |
++ { |
83 |
++ meta_topic (META_DEBUG_BACKEND, |
84 |
++ "Ignoring unavailable gpu '%s': %s'", |
85 |
++ g_udev_device_get_device_file (device), |
86 |
++ local_error->message); |
87 |
++ } |
88 |
++ else |
89 |
++ { |
90 |
++ g_warning ("Failed to open gpu '%s': %s", |
91 |
++ g_udev_device_get_device_file (device), |
92 |
++ local_error->message); |
93 |
++ } |
94 |
++ |
95 |
+ g_clear_error (&local_error); |
96 |
+ continue; |
97 |
+ } |
98 |
+-- |
99 |
+2.35.1 |
100 |
+ |
101 |
|
102 |
diff --git a/x11-wm/mutter/mutter-42.4.ebuild b/x11-wm/mutter/mutter-42.4-r1.ebuild |
103 |
similarity index 98% |
104 |
rename from x11-wm/mutter/mutter-42.4.ebuild |
105 |
rename to x11-wm/mutter/mutter-42.4-r1.ebuild |
106 |
index 105efceb6652..dcaaa2a66b00 100644 |
107 |
--- a/x11-wm/mutter/mutter-42.4.ebuild |
108 |
+++ b/x11-wm/mutter/mutter-42.4-r1.ebuild |
109 |
@@ -16,7 +16,7 @@ IUSE="doc elogind gnome input_devices_wacom +introspection screencast sysprof sy |
110 |
REQUIRED_USE=" |
111 |
wayland? ( ^^ ( elogind systemd ) udev ) |
112 |
test? ( wayland )" |
113 |
-RESTRICT="!test? ( test ) test" # Tests need access to /dev/dri/card0 |
114 |
+RESTRICT="!test? ( test )" |
115 |
|
116 |
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86" |
117 |
|
118 |
@@ -110,6 +110,7 @@ BDEPEND=" |
119 |
|
120 |
PATCHES=( |
121 |
"${FILESDIR}"/${PN}-42.0-Disable-anonymous-file-test.patch |
122 |
+ "${FILESDIR}"/${P}-backend-native-Don-t-warn-on-EACCES-if-headless.patch |
123 |
) |
124 |
|
125 |
python_check_deps() { |