summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm/ecore_drm_device.c
diff options
context:
space:
mode:
authorSeunghun Lee <shiin.lee@samsung.com>2014-12-09 09:36:42 -0500
committerChris Michael <cp.michael@samsung.com>2014-12-09 09:36:42 -0500
commitb10ab1a86f35ab793ba6efb49224d9ecdd1b7dbd (patch)
treea29763a81807d24d4a994dfff9b7098a02e22e45 /src/lib/ecore_drm/ecore_drm_device.c
parent05006e64634359613e093776af19e7b9ca0caec1 (diff)
ecore-drm: added drm launcher that is allow to determine whether to launch with logind or root privilege.
Summary: - allow to launch drm backend without systemd-logind with root privilege. - allow to open drm device node via logind, not directly open it, in case exist systemd-logind. - fixes issue that couldn't switch session, because ecore-drm couldn't drop master to drm device with no permission. (allow to switch session appropriate.) Reviewers: gwanglim, devilhorns Subscribers: torori, cedric Differential Revision: https://phab.enlightenment.org/D1704
Diffstat (limited to 'src/lib/ecore_drm/ecore_drm_device.c')
-rw-r--r--src/lib/ecore_drm/ecore_drm_device.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c
index e8ca0521fa..957c439e03 100644
--- a/src/lib/ecore_drm/ecore_drm_device.c
+++ b/src/lib/ecore_drm/ecore_drm_device.c
@@ -254,7 +254,8 @@ ecore_drm_device_open(Ecore_Drm_Device *dev)
254 /* check for valid device */ 254 /* check for valid device */
255 if ((!dev) || (!dev->drm.name)) return EINA_FALSE; 255 if ((!dev) || (!dev->drm.name)) return EINA_FALSE;
256 256
257 dev->drm.fd = open(dev->drm.name, O_RDWR | O_CLOEXEC); 257 /* DRM device node is needed immediately to keep going. */
258 dev->drm.fd = _ecore_drm_launcher_device_open_no_pending(dev->drm.name, O_RDWR);
258 if (dev->drm.fd < 0) return EINA_FALSE; 259 if (dev->drm.fd < 0) return EINA_FALSE;
259 260
260 DBG("Opened Device %s : %d", dev->drm.name, dev->drm.fd); 261 DBG("Opened Device %s : %d", dev->drm.name, dev->drm.fd);
@@ -319,7 +320,7 @@ ecore_drm_device_close(Ecore_Drm_Device *dev)
319 if (dev->drm.hdlr) ecore_main_fd_handler_del(dev->drm.hdlr); 320 if (dev->drm.hdlr) ecore_main_fd_handler_del(dev->drm.hdlr);
320 dev->drm.hdlr = NULL; 321 dev->drm.hdlr = NULL;
321 322
322 close(dev->drm.fd); 323 _ecore_drm_launcher_device_close(dev->drm.name, dev->drm.fd);
323 324
324 /* reset device fd */ 325 /* reset device fd */
325 dev->drm.fd = -1; 326 dev->drm.fd = -1;