devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0e4fd1b4d1e6e9d37015a4e70d8a9f0e66d5c50a
commit 0e4fd1b4d1e6e9d37015a4e70d8a9f0e66d5c50a Author: MinJeong Kim <minjjj....@samsung.com> Date: Mon Aug 4 08:47:10 2014 -0400 ecore-drm: implement function to disable ecore drm inputs on vt switching Summary: When vt is released by SIGUSR1, drm_inputs have to be disabled. For that this revision includes, 1. Unrefer udev monitor 2. Remove fd handler for udev monitor 3. Release dbus device Reviewers: stefan_schmidt, devilhorns, gwanglim Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1268 --- src/lib/ecore_drm/ecore_drm_dbus.c | 18 ++++++++++++++++++ src/lib/ecore_drm/ecore_drm_inputs.c | 16 +++++++++++++++- src/lib/ecore_drm/ecore_drm_private.h | 1 + 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_drm/ecore_drm_dbus.c b/src/lib/ecore_drm/ecore_drm_dbus.c index 1998602..d6276f8 100644 --- a/src/lib/ecore_drm/ecore_drm_dbus.c +++ b/src/lib/ecore_drm/ecore_drm_dbus.c @@ -363,6 +363,18 @@ flag_err: return -1; } +static void +_dbus_device_close(const char *path) +{ + struct stat st; + int ret; + + if ((ret = stat(path, &st)) < 0) return; + if (!S_ISCHR(st.st_mode)) return; + + _dbus_device_release(major(st.st_rdev), minor(st.st_rdev)); +} + static DBusHandlerResult _dbus_cb_filter(DBusConnection *conn EINA_UNUSED, DBusMessage *msg, void *data EINA_UNUSED) { @@ -817,3 +829,9 @@ _ecore_drm_dbus_device_open(const char *device) { return _dbus_device_open(device); } + +void +_ecore_drm_dbus_device_close(const char *device) +{ + _dbus_device_close(device); +} diff --git a/src/lib/ecore_drm/ecore_drm_inputs.c b/src/lib/ecore_drm/ecore_drm_inputs.c index 1f6c1c9..9879209 100644 --- a/src/lib/ecore_drm/ecore_drm_inputs.c +++ b/src/lib/ecore_drm/ecore_drm_inputs.c @@ -228,7 +228,10 @@ ecore_drm_inputs_destroy(Ecore_Drm_Device *dev) Ecore_Drm_Evdev *edev; EINA_LIST_FREE(seat->devices, edev) - _ecore_drm_evdev_device_destroy(edev); + { + _ecore_drm_dbus_device_close(edev->path); + _ecore_drm_evdev_device_destroy(edev); + } } } @@ -300,4 +303,15 @@ EAPI void ecore_drm_inputs_disable(Ecore_Drm_Input *input) { if (!input) return; + + udev_monitor_unref(input->monitor); + input->monitor = NULL; + + if (input->hdlr) + { + ecore_main_fd_handler_del(input->hdlr); + input->hdlr = NULL; + } + + ecore_drm_inputs_destroy(input->dev); } diff --git a/src/lib/ecore_drm/ecore_drm_private.h b/src/lib/ecore_drm/ecore_drm_private.h index 1cba3bd..34484cc 100644 --- a/src/lib/ecore_drm/ecore_drm_private.h +++ b/src/lib/ecore_drm/ecore_drm_private.h @@ -230,6 +230,7 @@ struct _Ecore_Drm_Sprite Eina_Bool _ecore_drm_dbus_init(const char *session); void _ecore_drm_dbus_shutdown(void); int _ecore_drm_dbus_device_open(const char *device); +void _ecore_drm_dbus_device_close(const char *device); Ecore_Drm_Evdev *_ecore_drm_evdev_device_create(Ecore_Drm_Seat *seat, const char *path, int fd); void _ecore_drm_evdev_device_destroy(Ecore_Drm_Evdev *evdev); --