summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/elput/elput_logind.c18
-rw-r--r--src/lib/elput/elput_private.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c
index aa9006e5bb..91eaffcbda 100644
--- a/src/lib/elput/elput_logind.c
+++ b/src/lib/elput/elput_logind.c
@@ -84,6 +84,7 @@ _cb_device_paused(void *data, const Eldbus_Message *msg)
84 uint32_t maj, min; 84 uint32_t maj, min;
85 85
86 em = data; 86 em = data;
87 if (!em->drm_opens) return;
87 88
88 if (eldbus_message_error_get(msg, &errname, &errmsg)) 89 if (eldbus_message_error_get(msg, &errname, &errmsg))
89 { 90 {
@@ -93,6 +94,20 @@ _cb_device_paused(void *data, const Eldbus_Message *msg)
93 94
94 if (eldbus_message_arguments_get(msg, "uus", &maj, &min, &type)) 95 if (eldbus_message_arguments_get(msg, "uus", &maj, &min, &type))
95 { 96 {
97 /* If we opened a device during probing then we're still going
98 * to get a "gone" callback when we release it, so we'd better
99 * eat that instead of treating it like losing the drm device
100 * we currently have open, and crapping up libinput's internals
101 * for a nice deferred explosion at shutdown...
102 *
103 * FIXME: do this better?
104 */
105 if ((em->drm_opens > 1) && (maj == 226) && !strcmp(type, "gone"))
106 {
107 em->drm_opens--;
108 return;
109 }
110
96 if (!strcmp(type, "pause")) 111 if (!strcmp(type, "pause"))
97 _logind_device_pause_complete(em, maj, min); 112 _logind_device_pause_complete(em, maj, min);
98 113
@@ -607,6 +622,9 @@ _logind_open(Elput_Manager *em, const char *path, int flags)
607 fd = _logind_device_take(em, major(st.st_rdev), minor(st.st_rdev)); 622 fd = _logind_device_take(em, major(st.st_rdev), minor(st.st_rdev));
608 if (fd < 0) return fd; 623 if (fd < 0) return fd;
609 624
625 if (major(st.st_rdev) == 226) //DRM_MAJOR
626 em->drm_opens++;
627
610 fl = fcntl(fd, F_GETFL); 628 fl = fcntl(fd, F_GETFL);
611 if (fl < 0) goto err; 629 if (fl < 0) goto err;
612 630
diff --git a/src/lib/elput/elput_private.h b/src/lib/elput/elput_private.h
index 5b38c14ab6..709871c368 100644
--- a/src/lib/elput/elput_private.h
+++ b/src/lib/elput/elput_private.h
@@ -279,6 +279,8 @@ struct _Elput_Manager
279 } cached; 279 } cached;
280 int output_w, output_h; 280 int output_w, output_h;
281 281
282 int drm_opens;
283
282 Elput_Input input; 284 Elput_Input input;
283 Eina_Bool del : 1; 285 Eina_Bool del : 1;
284}; 286};