devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=94adf30b93e7a1bc2f7d77ea98beddc81bffdd06

commit 94adf30b93e7a1bc2f7d77ea98beddc81bffdd06
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Wed May 6 12:15:56 2015 -0400

    ecore-drm: Add support for a Primary Output
    
    Summary: As 'primary' output support is not implemented in hardware,
    we need to support this feature via software. For now, the first
    output returned via libdrm will be marked as 'primary' until user
    changes it via config
    
    @feature
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/ecore_drm/ecore_drm_output.c  | 8 ++++++++
 src/lib/ecore_drm/ecore_drm_private.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/src/lib/ecore_drm/ecore_drm_output.c 
b/src/lib/ecore_drm/ecore_drm_output.c
index 32249cb..9ce8641 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -507,6 +507,13 @@ _ecore_drm_output_create(Ecore_Drm_Device *dev, drmModeRes 
*res, drmModeConnecto
 
    dev->outputs = eina_list_append(dev->outputs, output);
 
+   /* NB: 'primary' output property is not supported in HW, so we need to
+    * implement it via software. As such, the First output which gets
+    * listed via libdrm will be assigned 'primary' until user changes
+    * it via config */
+   if (eina_list_count(dev->outputs) == 1)
+     output->primary = EINA_TRUE;
+
    DBG("Created New Output At %d,%d", output->x, output->y);
    DBG("\tCrtc Pos: %d %d", output->crtc->x, output->crtc->y);
    DBG("\tCrtc: %d", output->crtc_id);
@@ -515,6 +522,7 @@ _ecore_drm_output_create(Ecore_Drm_Device *dev, drmModeRes 
*res, drmModeConnecto
    DBG("\tModel: %s", output->model);
    DBG("\tName: %s", output->name);
    DBG("\tCloned: %d", output->cloned);
+   DBG("\tPrimary: %d", output->primary);
 
    EINA_LIST_FOREACH(output->modes, l, mode)
      {
diff --git a/src/lib/ecore_drm/ecore_drm_private.h 
b/src/lib/ecore_drm/ecore_drm_private.h
index 8a2ca3c..063ac06 100644
--- a/src/lib/ecore_drm/ecore_drm_private.h
+++ b/src/lib/ecore_drm/ecore_drm_private.h
@@ -135,6 +135,7 @@ struct _Ecore_Drm_Output
 
    Ecore_Drm_Backlight *backlight;   
 
+   Eina_Bool primary : 1;
    Eina_Bool connected : 1;
    Eina_Bool enabled : 1;
    Eina_Bool cloned : 1;

-- 


Reply via email to