devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2a9272333f730ac3d5b437b65dcd804a169c2ed3

commit 2a9272333f730ac3d5b437b65dcd804a169c2ed3
Author: vivek <vivek.el...@samsung.com>
Date:   Wed Oct 22 08:14:26 2014 -0400

    ecore_drm: Added internal function to check if drm device is hotplug device
    
    Summary:
    Added _ecore_drm_output_device_is_hotplug API to check if the
    drm device is hotplug device. It returns EINA_TRUE if device is
    hotplug else returns EINA_FALSE
    
    @feature
    
    Signed-off-by: vivek <vivek.el...@samsung.com>
    
    Reviewers: devilhorns
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D1559
---
 src/lib/ecore_drm/ecore_drm_output.c | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_drm/ecore_drm_output.c 
b/src/lib/ecore_drm/ecore_drm_output.c
index 67f8f0c..1b46e6b 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -623,6 +623,26 @@ finish:
    _ecore_drm_output_frame_finish(output);
 }
 
+static Eina_Bool
+_ecore_drm_output_device_is_hotplug(Ecore_Drm_Output *output)
+{
+   const char *syspath;
+   const char *val;
+   int sysnum;
+
+   syspath = output->dev->drm.path;
+   sysnum = eeze_udev_syspath_get_sysnum(syspath);
+
+   if ((sysnum == -1) || (sysnum != output->dev->id))
+     return EINA_FALSE;
+
+   val = eeze_udev_syspath_get_property(syspath, "HOTPLUG");
+   if (!val)
+     return EINA_FALSE;
+
+   return (strcmp(val, "1") == 0);
+}
+
 static void
 _ecore_drm_output_event(const char *device, Eeze_Udev_Event event, void *data, 
Eeze_Udev_Watch *watch EINA_UNUSED)
 {
@@ -630,7 +650,10 @@ _ecore_drm_output_event(const char *device, 
Eeze_Udev_Event event, void *data, E
 
    if (!(output = data)) return;
 
-   /* TODO: Check if device is hotplug and update outputs */
+   if (_ecore_drm_output_device_is_hotplug(output))
+     {
+        DBG("Output Hotplug Event");
+     }
 }
 
 /**

-- 


Reply via email to