Merge lp:~albertomilone/gdm/lp1697882 into lp:~ubuntu-desktop/gdm/ubuntu
- lp1697882
- Merge into ubuntu
Status: | Merged |
---|---|
Approved by: | Iain Lane |
Approved revision: | 432 |
Merged at revision: | 432 |
Proposed branch: | lp:~albertomilone/gdm/lp1697882 |
Merge into: | lp:~ubuntu-desktop/gdm/ubuntu |
Diff against target: |
271 lines (+256/-0) 2 files modified
debian/patches/95_hide_x11_sessions_with_nvidia_kms.patch (+255/-0) debian/patches/series (+1/-0) |
To merge this branch: | bzr merge lp:~albertomilone/gdm/lp1697882 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Iain Lane | Approve | ||
Daniel van Vugt (community) | Needs Fixing | ||
Jeremy BĂcha | Pending | ||
Review via email: mp+326426@code.launchpad.net |
Commit message
Description of the change
This change, which is (Ubuntu specific), will hide away the X11 sessions when KMS is enabled in the nvidia driver, leaving the Wayland session as the only option.
Disabling KMS will make the sessions available again after a reboot.
Fixes LP: #1697882
Alberto Milone (albertomilone) wrote : | # |
> Thanks. Please could you file upstream and then add that URL into the patch as
> "Forwarded: <url>"?
>
This is something that will have to be fixed in the kernel, when the Unix Device Memory Allocator API lands in the kernel. It will take a while. I don't think it's a GNOME specific problem, but we might want to work around it for now.
> Is there a better way than looking at a configuration file such as looking at
> the loaded modules somehow? Isn't that distro specific or at least fragile?
Sure, /sys/module/
Iain Lane (laney) wrote : | # |
On Wed, Jun 28, 2017 at 04:35:35PM -0000, Alberto Milone wrote:
> > Thanks. Please could you file upstream and then add that URL into the patch as
> > "Forwarded: <url>"?
> >
>
> This is something that will have to be fixed in the kernel, when the Unix Device Memory Allocator API lands in the kernel. It will take a while. I don't think it's a GNOME specific problem, but we might want to work around it for now.
Right, but it is correct that this workaround (disabling X on nvidia +
modesetting) is not Ubuntu specific, isn't it?
> > Is there a better way than looking at a configuration file such as looking at
> > the loaded modules somehow? Isn't that distro specific or at least fragile?
>
> Sure, /sys/module/
gdm3 runs as root. I'm not sure if it drops permissions before getting
to this point - I think probably not, and this is worth looking into.
--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]
Alberto Milone (albertomilone) wrote : | # |
> On Wed, Jun 28, 2017 at 04:35:35PM -0000, Alberto Milone wrote:
> > > Thanks. Please could you file upstream and then add that URL into the
> patch as
> > > "Forwarded: <url>"?
> > >
> >
> > This is something that will have to be fixed in the kernel, when the Unix
> Device Memory Allocator API lands in the kernel. It will take a while. I don't
> think it's a GNOME specific problem, but we might want to work around it for
> now.
>
> Right, but it is correct that this workaround (disabling X on nvidia +
> modesetting) is not Ubuntu specific, isn't it?
>
Correct. It is how we check KMS that, with the current approach, is Ubuntu specific (because of the root privileges thing).
> gdm3 runs as root. I'm not sure if it drops permissions before getting
> to this point - I think probably not, and this is worth looking into.
>
I'm pretty sure I ran into this problem when I started working on this. I can double check, as the effort should be minimal.
Alberto Milone (albertomilone) wrote : | # |
Unfortunately, I have just checked, and we no longer have root privileges by the time can_create_
Iain Lane (laney) wrote : | # |
On Wed, Jun 28, 2017 at 06:41:32PM -0000, Alberto Milone wrote:
> Unfortunately, I have just checked, and we no longer have root privileges by the time can_create_
Ok, that's annoying - I don't suppose it's possible to grab this value
before privileges are dropped and pass it around?
--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]
Alberto Milone (albertomilone) wrote : | # |
> On Wed, Jun 28, 2017 at 06:41:32PM -0000, Alberto Milone wrote:
> > Unfortunately, I have just checked, and we no longer have root privileges by
> the time can_create_
>
> Ok, that's annoying - I don't suppose it's possible to grab this value
> before privileges are dropped and pass it around?
>
I'm not sure about that. It's probably easier to use the current udev rule, that the nvidia packages ship, to check the value when the module is loaded, and to write it somewhere in /run, so that GDM can read it later.
What do you think?
Iain Lane (laney) wrote : | # |
On Thu, Jun 29, 2017 at 10:29:58AM -0000, Alberto Milone wrote:
> > On Wed, Jun 28, 2017 at 06:41:32PM -0000, Alberto Milone wrote:
> > > Unfortunately, I have just checked, and we no longer have root privileges by
> > the time can_create_
> >
> > Ok, that's annoying - I don't suppose it's possible to grab this value
> > before privileges are dropped and pass it around?
> >
>
> I'm not sure about that. It's probably easier to use the current udev rule, that the nvidia packages ship, to check the value when the module is loaded, and to write it somewhere in /run, so that GDM can read it later.
>
> What do you think?
I like that more than reading the configuration file - but it doesn't
sounds like something that could go in gdm upstream? Unless maybe you
can get some buy in for standardising on this. Maybe file a bug on
bugzilla and ask for opinions.
If it's too hard to grab the value from /sys, I guess we can do it this
way.
--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]
Alberto Milone (albertomilone) wrote : | # |
> I like that more than reading the configuration file - but it doesn't
> sounds like something that could go in gdm upstream? Unless maybe you
> can get some buy in for standardising on this. Maybe file a bug on
> bugzilla and ask for opinions.
>
I don't think it should be upstreamed, and I hope we can drop this in the near future. I think we can live with a small patch for now (which I am going to maintain).
> If it's too hard to grab the value from /sys, I guess we can do it this
> way.
Ok, I'll work on it.
Iain Lane (laney) wrote : | # |
On Thu, Jun 29, 2017 at 11:59:23AM -0000, Alberto Milone wrote:
> > I like that more than reading the configuration file - but it doesn't
> > sounds like something that could go in gdm upstream? Unless maybe you
> > can get some buy in for standardising on this. Maybe file a bug on
> > bugzilla and ask for opinions.
> >
>
> I don't think it should be upstreamed, and I hope we can drop this in the near future. I think we can live with a small patch for now (which I am going to maintain).
Why not? Does this somehow work on other distributions? If it doesn't,
why would it be desirable to keep showing broken sessions there?
> > If it's too hard to grab the value from /sys, I guess we can do it this
> > way.
>
> Ok, I'll work on it.
k.
--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]
Alberto Milone (albertomilone) wrote : | # |
I have just filed an upstream bug report about this:
https:/
- 411. By Ken VanDine
-
Only prompt the user to choose display managers when we haven't already determined a migration to gdm3 is recommended.
- 412. By Ken VanDine
-
Merged
- 413. By Ken VanDine
-
* debian/gdm3.config
- Only prompt the user to choose display managers when we haven't already
determined a migration to gdm3 is recommended.
* debian/control.in
- Explicitly depend on ubuntu-session so we can ensure gdm3 configure gets
run after ubuntu-session's configure to handle the transition from
lightdm to gdm3 - 414. By Ken VanDine
-
released
- 415. By Ken VanDine
-
* debian/gdm3.config
- Handle the transition from lightdm in gdm3 rather than ubuntu-session
* debian/control.in
- Dropped depends from ubuntu-session - 416. By Ken VanDine
-
Fixed ubuntu-session version check
- 417. By Ken VanDine
-
Dropped depends for ubuntu-session
- 418. By Ken VanDine
-
releasing package gdm3 version 3.24.2-1ubuntu5
- 419. By Didier Roche-Tolomelli
-
debian/
patches/ ubuntu_ prefer_ x11_session. patch:
Prefer X11 session over wayland. As we are not ready yet for
switching to wayland yet, let's prefer X11 session when no specific
choice was made. (LP: #1703601)
This will be reverted once we switch to wayland by default. - 420. By Didier Roche-Tolomelli
-
releasing package gdm3 version 3.24.2-1ubuntu6
- 421. By Iain Lane
-
debian/gdm3.config: Check the version of gdm3 instead of ubuntu-session.
And some other minor improvements.
- 422. By Iain Lane
-
Compare with a ~ version, so that any backports of this exact version aren't re-migrated
- 423. By Iain Lane
-
releasing package gdm3 version 3.24.2-1ubuntu7
- 424. By Daniel van Vugt
-
First attempt
- 425. By Daniel van Vugt
-
Remember the changelog
Daniel van Vugt (vanvugt) wrote : | # |
Pretty sure this will have conflicts now, sorry.
- 426. By Will Cooke
-
* debian/default.pa
- Added new file to disable Bluetooth audio devices in PulseAudio from
gdm3. (LP: #1703415) (LP: #1489651)
* debian/gdm3.install
- Added details of the default.pa file
* debian/gdm3.postinst
- Added installation of default.pa and creation of dir if it doesn't
exist. - 427. By Jeremy BĂcha
-
releasing package gdm3 version 3.24.2-1ubuntu9
- 428. By Jeremy BĂcha
-
New upstream release 3.25.90.1
* debian/control.in:
- Bump minimum gnome-settings-daemon to 3.24
* Drop patches applied in new release:
- Avoid-double-NULL-terminated -array- LP-1704050. patch
- revert_drop_gdm_ shell_session. patch - 429. By Jeremy BĂcha
-
releasing package gdm3 version 3.25.90.1-0ubuntu1
- 430. By Didier Roche-Tolomelli
-
* debian/
patches/ ubuntu_ prefer_ x11_session. patch:
- remove x11 session preference now that both Ubuntu and GNOME
switched to wayland - 431. By Didier Roche-Tolomelli
-
releasing package gdm3 version 3.25.90.1-0ubuntu2
Alberto Milone (albertomilone) wrote : | # |
I have come up with a better solution, which I attached to the upstream bug report:
https:/
- 432. By Alberto Milone
-
Hide X11 sessions when KMS is enabled in the nvidia driver
NOTE: this doesn't affect systems with hybrid graphics
Fixes LP: #1697882
Alberto Milone (albertomilone) wrote : | # |
The latest patch is based on what upstream recommended. I have already pushed a change to the udev rule included in the NVIDIA driver in Artful, so that the Gnome shell (which doesn't run with root privileges) can check KMS when getting the sessions using libgdm.
My patch works well here.
Iain Lane (laney) wrote : | # |
I left some comments upstream - please consider those for Ubuntu before the 17.10 release - but I think we can probably upload this now.
Thanks!
Preview Diff
1 | === added file 'debian/patches/95_hide_x11_sessions_with_nvidia_kms.patch' | |||
2 | --- debian/patches/95_hide_x11_sessions_with_nvidia_kms.patch 1970-01-01 00:00:00 +0000 | |||
3 | +++ debian/patches/95_hide_x11_sessions_with_nvidia_kms.patch 2017-08-24 09:08:19 +0000 | |||
4 | @@ -0,0 +1,255 @@ | |||
5 | 1 | From 06a4117ae5761c184c2c9fe54e4f297becf1d2a9 Mon Sep 17 00:00:00 2001 | ||
6 | 2 | From: Alberto Milone <alberto.milone@canonical.com> | ||
7 | 3 | Date: Tue, 20 Jun 2017 16:49:10 +0200 | ||
8 | 4 | Subject: [PATCH 1/1] Hide X11 sessions when KMS is enabled in the nvidia | ||
9 | 5 | driver | ||
10 | 6 | |||
11 | 7 | Fixes LP: #1697882 | ||
12 | 8 | --- | ||
13 | 9 | common/gdm-common.c | 78 ++++++++++++++++++++++++++++++++++++++ | ||
14 | 10 | common/gdm-common.h | 2 + | ||
15 | 11 | daemon/gdm-display.c | 10 +++++ | ||
16 | 12 | daemon/gdm-local-display-factory.c | 5 +++ | ||
17 | 13 | daemon/gdm-session.c | 6 ++- | ||
18 | 14 | libgdm/Makefile.am | 3 ++ | ||
19 | 15 | libgdm/gdm-sessions.c | 8 +++- | ||
20 | 16 | 7 files changed, 109 insertions(+), 3 deletions(-) | ||
21 | 17 | |||
22 | 18 | diff --git a/common/gdm-common.c b/common/gdm-common.c | ||
23 | 19 | index 31fc810..0dcbbe2 100644 | ||
24 | 20 | --- a/common/gdm-common.c | ||
25 | 21 | +++ b/common/gdm-common.c | ||
26 | 22 | @@ -47,6 +47,8 @@ | ||
27 | 23 | |||
28 | 24 | G_DEFINE_QUARK (gdm-common-error, gdm_common_error); | ||
29 | 25 | |||
30 | 26 | +int nvidia_has_kms = -1; | ||
31 | 27 | + | ||
32 | 28 | const char * | ||
33 | 29 | gdm_make_temp_dir (char *template) | ||
34 | 30 | { | ||
35 | 31 | @@ -797,3 +799,79 @@ gdm_shell_expand (const char *str, | ||
36 | 32 | } | ||
37 | 33 | return g_string_free (s, FALSE); | ||
38 | 34 | } | ||
39 | 35 | + | ||
40 | 36 | +static gboolean | ||
41 | 37 | +is_module_loaded (const char *module) { | ||
42 | 38 | + char line[4096]; | ||
43 | 39 | + gboolean status = FALSE; | ||
44 | 40 | + FILE *file = NULL; | ||
45 | 41 | + const char *modules_file = "/proc/modules"; | ||
46 | 42 | + | ||
47 | 43 | + file = fopen (modules_file, "r"); | ||
48 | 44 | + if (!file) { | ||
49 | 45 | + g_debug ("Failed to parse %s\n", modules_file); | ||
50 | 46 | + return status; | ||
51 | 47 | + } | ||
52 | 48 | + | ||
53 | 49 | + while (fgets (line, sizeof (line), file)) { | ||
54 | 50 | + char *tok; | ||
55 | 51 | + tok = strtok (line, " \t"); | ||
56 | 52 | + if (strstr (tok, module) != NULL) { | ||
57 | 53 | + status = TRUE; | ||
58 | 54 | + break; | ||
59 | 55 | + } | ||
60 | 56 | + } | ||
61 | 57 | + fclose(file); | ||
62 | 58 | + | ||
63 | 59 | + return status; | ||
64 | 60 | +} | ||
65 | 61 | + | ||
66 | 62 | +gboolean | ||
67 | 63 | +is_nvidia_kms_available (void) | ||
68 | 64 | +{ | ||
69 | 65 | + gsize length; | ||
70 | 66 | + GError *error = NULL; | ||
71 | 67 | + gboolean status = FALSE; | ||
72 | 68 | + gchar *contents = NULL; | ||
73 | 69 | + const char *kms_file = "/sys/module/nvidia_drm/parameters/modeset"; | ||
74 | 70 | + | ||
75 | 71 | + g_debug ("Checking if the NVIDIA driver is loaded, and has KMS enabled\n"); | ||
76 | 72 | + | ||
77 | 73 | + /* Use the cached value */ | ||
78 | 74 | + if (nvidia_has_kms > -1) { | ||
79 | 75 | + g_debug ("is_nvidia_kms_available: using cached value %d\n", nvidia_has_kms); | ||
80 | 76 | + return (nvidia_has_kms == 1); | ||
81 | 77 | + } | ||
82 | 78 | + | ||
83 | 79 | + /* Let's leave hybrid graphics alone */ | ||
84 | 80 | + if (is_module_loaded ("i915")) { | ||
85 | 81 | + g_debug ("is_nvidia_kms_available: Intel detected, doing nothing.\n"); | ||
86 | 82 | + goto end; | ||
87 | 83 | + } | ||
88 | 84 | + | ||
89 | 85 | + if (!g_file_test (kms_file, G_FILE_TEST_EXISTS)) { | ||
90 | 86 | + g_debug ("is_nvidia_kms_available: Cannot access '%s'", kms_file); | ||
91 | 87 | + goto end; | ||
92 | 88 | + } | ||
93 | 89 | + | ||
94 | 90 | + if (!g_file_get_contents (kms_file, &contents, &length, &error)) { | ||
95 | 91 | + g_debug ("is_nvidia_kms_available: Failed to parse '%s': %s", | ||
96 | 92 | + kms_file, | ||
97 | 93 | + (error && error->message) ? error->message : "(null)"); | ||
98 | 94 | + g_error_free (error); | ||
99 | 95 | + goto end; | ||
100 | 96 | + } | ||
101 | 97 | + | ||
102 | 98 | + g_debug ("is_nvidia_kms_available: contents, \n%s\n", contents); | ||
103 | 99 | + | ||
104 | 100 | + status = (strstr (contents, "Y\n") != NULL); | ||
105 | 101 | + g_free (contents); | ||
106 | 102 | + | ||
107 | 103 | +end: | ||
108 | 104 | + /* Cache the value */ | ||
109 | 105 | + nvidia_has_kms = status ? 1 : 0; | ||
110 | 106 | + | ||
111 | 107 | + g_debug ("is_nvidia_kms_available: setting status to %d\n", status); | ||
112 | 108 | + | ||
113 | 109 | + return status; | ||
114 | 110 | +} | ||
115 | 111 | diff --git a/common/gdm-common.h b/common/gdm-common.h | ||
116 | 112 | index 8d83a12..6f88f2f 100644 | ||
117 | 113 | --- a/common/gdm-common.h | ||
118 | 114 | +++ b/common/gdm-common.h | ||
119 | 115 | @@ -71,6 +71,8 @@ char * gdm_shell_expand (const char *str, | ||
120 | 116 | GdmExpandVarFunc expand_func, | ||
121 | 117 | gpointer user_data); | ||
122 | 118 | |||
123 | 119 | +gboolean is_nvidia_kms_available (void); | ||
124 | 120 | + | ||
125 | 121 | G_END_DECLS | ||
126 | 122 | |||
127 | 123 | #endif /* _GDM_COMMON_H */ | ||
128 | 124 | diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c | ||
129 | 125 | index 0057e2c..42648f9 100644 | ||
130 | 126 | --- a/daemon/gdm-display.c | ||
131 | 127 | +++ b/daemon/gdm-display.c | ||
132 | 128 | @@ -54,6 +54,8 @@ | ||
133 | 129 | |||
134 | 130 | #define GDM_DISPLAY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_DISPLAY, GdmDisplayPrivate)) | ||
135 | 131 | |||
136 | 132 | +extern int nvidia_has_kms; | ||
137 | 133 | + | ||
138 | 134 | struct GdmDisplayPrivate | ||
139 | 135 | { | ||
140 | 136 | char *id; | ||
141 | 137 | @@ -118,6 +120,7 @@ enum { | ||
142 | 138 | PROP_DOING_INITIAL_SETUP, | ||
143 | 139 | }; | ||
144 | 140 | |||
145 | 141 | + | ||
146 | 142 | static void gdm_display_class_init (GdmDisplayClass *klass); | ||
147 | 143 | static void gdm_display_init (GdmDisplay *self); | ||
148 | 144 | static void gdm_display_finalize (GObject *object); | ||
149 | 145 | @@ -1447,6 +1450,13 @@ can_create_environment (const char *session_id) | ||
150 | 146 | char *path; | ||
151 | 147 | gboolean session_exists; | ||
152 | 148 | |||
153 | 149 | +#ifdef ENABLE_WAYLAND_SUPPORT | ||
154 | 150 | + /* Disable X11 sessions if KMS is enabled in the nvidia driver | ||
155 | 151 | + * See LP: #1697882. | ||
156 | 152 | + */ | ||
157 | 153 | + if (is_nvidia_kms_available ()) | ||
158 | 154 | + return FALSE; | ||
159 | 155 | +#endif | ||
160 | 156 | path = g_strdup_printf (GNOME_SESSION_SESSIONS_PATH "/%s.session", session_id); | ||
161 | 157 | session_exists = g_file_test (path, G_FILE_TEST_EXISTS); | ||
162 | 158 | |||
163 | 159 | diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c | ||
164 | 160 | index 7a4643d..50ddaea 100644 | ||
165 | 161 | --- a/daemon/gdm-local-display-factory.c | ||
166 | 162 | +++ b/daemon/gdm-local-display-factory.c | ||
167 | 163 | @@ -48,6 +48,8 @@ | ||
168 | 164 | |||
169 | 165 | #define MAX_DISPLAY_FAILURES 5 | ||
170 | 166 | |||
171 | 167 | +extern int nvidia_has_kms; | ||
172 | 168 | + | ||
173 | 169 | struct GdmLocalDisplayFactoryPrivate | ||
174 | 170 | { | ||
175 | 171 | GdmDBusLocalDisplayFactory *skeleton; | ||
176 | 172 | @@ -459,6 +461,9 @@ gdm_local_display_factory_sync_seats (GdmLocalDisplayFactory *factory) | ||
177 | 173 | is_initial = FALSE; | ||
178 | 174 | } | ||
179 | 175 | |||
180 | 176 | + if (is_nvidia_kms_available ()) | ||
181 | 177 | + session_type = "wayland"; | ||
182 | 178 | + | ||
183 | 179 | create_display (factory, seat, session_type, is_initial); | ||
184 | 180 | } | ||
185 | 181 | |||
186 | 182 | diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c | ||
187 | 183 | index 0b83223..5e597c4 100644 | ||
188 | 184 | --- a/daemon/gdm-session.c | ||
189 | 185 | +++ b/daemon/gdm-session.c | ||
190 | 186 | @@ -62,6 +62,8 @@ | ||
191 | 187 | |||
192 | 188 | #define GDM_WORKER_DBUS_PATH "/org/gnome/DisplayManager/Worker" | ||
193 | 189 | |||
194 | 190 | +extern int nvidia_has_kms; | ||
195 | 191 | + | ||
196 | 192 | typedef struct | ||
197 | 193 | { | ||
198 | 194 | GdmSession *session; | ||
199 | 195 | @@ -354,7 +356,9 @@ get_system_session_dirs (GdmSession *self) | ||
200 | 196 | |||
201 | 197 | search_array = g_array_new (TRUE, TRUE, sizeof (char *)); | ||
202 | 198 | |||
203 | 199 | - g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs)); | ||
204 | 200 | + if (!is_nvidia_kms_available ()) { | ||
205 | 201 | + g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs)); | ||
206 | 202 | + } | ||
207 | 203 | |||
208 | 204 | #ifdef ENABLE_WAYLAND_SUPPORT | ||
209 | 205 | if (!self->priv->ignore_wayland) { | ||
210 | 206 | diff --git a/libgdm/Makefile.am b/libgdm/Makefile.am | ||
211 | 207 | index 99ada9a..66af6b5 100644 | ||
212 | 208 | --- a/libgdm/Makefile.am | ||
213 | 209 | +++ b/libgdm/Makefile.am | ||
214 | 210 | @@ -36,6 +36,8 @@ AM_CPPFLAGS = \ | ||
215 | 211 | -I$(builddir) \ | ||
216 | 212 | -I$(top_srcdir) \ | ||
217 | 213 | -I$(top_builddir) \ | ||
218 | 214 | + -I$(top_srcdir)/common \ | ||
219 | 215 | + -I$(top_builddir)/common \ | ||
220 | 216 | -DG_LOG_DOMAIN=\"Gdm\" \ | ||
221 | 217 | -DDMCONFDIR=\""$(dmconfdir)"\" \ | ||
222 | 218 | -DDATADIR=\""$(datadir)"\" \ | ||
223 | 219 | @@ -64,6 +66,7 @@ libgdm_la_LDFLAGS = \ | ||
224 | 220 | $(END_OF_LIST) | ||
225 | 221 | |||
226 | 222 | libgdm_la_LIBADD = \ | ||
227 | 223 | + $(top_builddir)/common/libgdmcommon.la \ | ||
228 | 224 | $(LIBGDM_LIBS) \ | ||
229 | 225 | $(SYSTEMD_LIBS) \ | ||
230 | 226 | $(END_OF_LIST) | ||
231 | 227 | diff --git a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c | ||
232 | 228 | index a645224..419f055 100644 | ||
233 | 229 | --- a/libgdm/gdm-sessions.c | ||
234 | 230 | +++ b/libgdm/gdm-sessions.c | ||
235 | 231 | @@ -37,6 +37,8 @@ | ||
236 | 232 | |||
237 | 233 | #include "gdm-sessions.h" | ||
238 | 234 | |||
239 | 235 | +extern int nvidia_has_kms; | ||
240 | 236 | + | ||
241 | 237 | typedef struct _GdmSessionFile { | ||
242 | 238 | char *id; | ||
243 | 239 | char *path; | ||
244 | 240 | @@ -208,8 +210,10 @@ collect_sessions (void) | ||
245 | 241 | g_free, g_free); | ||
246 | 242 | } | ||
247 | 243 | |||
248 | 244 | - for (i = 0; xorg_search_dirs [i] != NULL; i++) { | ||
249 | 245 | - collect_sessions_from_directory (xorg_search_dirs [i]); | ||
250 | 246 | + if (!is_nvidia_kms_available ()) { | ||
251 | 247 | + for (i = 0; xorg_search_dirs [i] != NULL; i++) { | ||
252 | 248 | + collect_sessions_from_directory (xorg_search_dirs [i]); | ||
253 | 249 | + } | ||
254 | 250 | } | ||
255 | 251 | |||
256 | 252 | #ifdef ENABLE_WAYLAND_SUPPORT | ||
257 | 253 | -- | ||
258 | 254 | 2.7.4 | ||
259 | 255 | |||
260 | 0 | 256 | ||
261 | === modified file 'debian/patches/series' | |||
262 | --- debian/patches/series 2017-08-21 08:48:14 +0000 | |||
263 | +++ debian/patches/series 2017-08-24 09:08:19 +0000 | |||
264 | @@ -5,6 +5,7 @@ | |||
265 | 5 | 92_systemd_unit.patch | 5 | 92_systemd_unit.patch |
266 | 6 | 93_translate-default-desktop.patch | 6 | 93_translate-default-desktop.patch |
267 | 7 | 94_retain_xorg_log.patch | 7 | 94_retain_xorg_log.patch |
268 | 8 | 95_hide_x11_sessions_with_nvidia_kms.patch | ||
269 | 8 | ubuntu_run_xsession.d.patch | 9 | ubuntu_run_xsession.d.patch |
270 | 9 | ubuntu_xresources_is_a_dir.patch | 10 | ubuntu_xresources_is_a_dir.patch |
271 | 10 | ubuntu_nvidia_prime.patch | 11 | ubuntu_nvidia_prime.patch |
Thanks. Please could you file upstream and then add that URL into the patch as "Forwarded: <url>"?
Is there a better way than looking at a configuration file such as looking at the loaded modules somehow? Isn't that distro specific or at least fragile?