devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=24ed704c8cc9fb8234792a27f8394ade4140fea2

commit 24ed704c8cc9fb8234792a27f8394ade4140fea2
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Tue Jul 15 09:38:25 2014 -0400

    ecore-drm: Fix ecore_drm_device calls to drop & set drm master
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/ecore_drm/ecore_drm_device.c | 34 ++++++----------------------------
 1 file changed, 6 insertions(+), 28 deletions(-)

diff --git a/src/lib/ecore_drm/ecore_drm_device.c 
b/src/lib/ecore_drm/ecore_drm_device.c
index daa744b..c571b93 100644
--- a/src/lib/ecore_drm/ecore_drm_device.c
+++ b/src/lib/ecore_drm/ecore_drm_device.c
@@ -509,17 +509,15 @@ ecore_drm_device_close(Ecore_Drm_Device *dev)
 EAPI Eina_Bool 
 ecore_drm_device_master_get(Ecore_Drm_Device *dev)
 {
-   /* drm_magic_t mag; */
+   drm_magic_t mag;
 
    /* check for valid device */
    if ((!dev) || (dev->drm.fd < 0)) return EINA_FALSE;
 
-   /* FIXME: Remote this to the slave process !! */
-
    /* get if we are master or not */
-   /* if ((drmGetMagic(dev->drm.fd, &mag) == 0) &&  */
-   /*     (drmAuthMagic(dev->drm.fd, mag) == 0)) */
-   /*   return EINA_TRUE; */
+   if ((drmGetMagic(dev->drm.fd, &mag) == 0) && 
+       (drmAuthMagic(dev->drm.fd, mag) == 0))
+     return EINA_TRUE;
 
    return EINA_FALSE;
 }
@@ -538,22 +536,12 @@ ecore_drm_device_master_get(Ecore_Drm_Device *dev)
 EAPI Eina_Bool 
 ecore_drm_device_master_set(Ecore_Drm_Device *dev)
 {
-   Eina_Bool ret = EINA_FALSE;
-   int dfd;
-
    /* check for valid device */
    if ((!dev) || (dev->drm.fd < 0)) return EINA_FALSE;
 
    DBG("Set Master On Fd: %d", dev->drm.fd);
 
-   /* try to close the device */
-   _ecore_drm_message_send(ECORE_DRM_OP_DEVICE_MASTER_SET, dev->drm.fd, 
-                           NULL, 0);
-
-   /* get the result of the close operation */
-   ret = _ecore_drm_message_receive(ECORE_DRM_OP_DEVICE_MASTER_SET, &dfd,
-                                    NULL, 0);
-   if (!ret) return EINA_FALSE;
+   drmSetMaster(dev->drm.fd);
 
    return EINA_TRUE;
 }
@@ -572,22 +560,12 @@ ecore_drm_device_master_set(Ecore_Drm_Device *dev)
 EAPI Eina_Bool 
 ecore_drm_device_master_drop(Ecore_Drm_Device *dev)
 {
-   Eina_Bool ret = EINA_FALSE;
-   int dfd;
-
    /* check for valid device */
    if ((!dev) || (dev->drm.fd < 0)) return EINA_FALSE;
 
    DBG("Drop Master On Fd: %d", dev->drm.fd);
 
-   /* try to close the device */
-   _ecore_drm_message_send(ECORE_DRM_OP_DEVICE_MASTER_DROP, dev->drm.fd,
-                           NULL, 0);
-
-   /* get the result of the close operation */
-   ret = _ecore_drm_message_receive(ECORE_DRM_OP_DEVICE_MASTER_DROP, &dfd,
-                                    NULL, 0);
-   if (!ret) return EINA_FALSE;
+   drmDropMaster(dev->drm.fd);
 
    return EINA_TRUE;
 }

-- 


Reply via email to