devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=26eefa970fafb45b0b8920e7ca79f721670e9e75

commit 26eefa970fafb45b0b8920e7ca79f721670e9e75
Author: Chris Michael <cpmich...@osg.samsung.com>
Date:   Thu Feb 4 09:00:54 2016 -0500

    ecore-drm: Add API function to set rotation on an output
    
    This patch adds an API function to allow the Screen Setup dialog in
    Enlightenment to support setting rotations on an output when running
    under drm
    
    @feature
    
    Signed-off-by: Chris Michael <cpmich...@osg.samsung.com>
---
 src/lib/ecore_drm/Ecore_Drm.h        |  4 ++++
 src/lib/ecore_drm/ecore_drm_output.c | 28 ++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h
index 2942eeb..0366899 100644
--- a/src/lib/ecore_drm/Ecore_Drm.h
+++ b/src/lib/ecore_drm/Ecore_Drm.h
@@ -1006,6 +1006,10 @@ EAPI Eina_Bool 
ecore_drm_output_mode_set(Ecore_Drm_Output *output, Ecore_Drm_Out
 /* @since 1.18 */
 EAPI unsigned int ecore_drm_output_supported_rotations_get(Ecore_Drm_Output 
*output, Ecore_Drm_Plane_Type type);
 
+/* TODO: doxy */
+/* @since 1.18 */
+EAPI Eina_Bool ecore_drm_output_rotation_set(Ecore_Drm_Output *output, 
Ecore_Drm_Plane_Type type, unsigned int rotation);
+
 /**
  * Enable key remap functionality on a Ecore_Drm_Evdev
  *
diff --git a/src/lib/ecore_drm/ecore_drm_output.c 
b/src/lib/ecore_drm/ecore_drm_output.c
index 9dd4fd3..aba2164 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -1500,3 +1500,31 @@ 
ecore_drm_output_supported_rotations_get(Ecore_Drm_Output *output, Ecore_Drm_Pla
 
    return rot;
 }
+
+EAPI Eina_Bool
+ecore_drm_output_rotation_set(Ecore_Drm_Output *output, Ecore_Drm_Plane_Type 
type, unsigned int rotation)
+{
+   Ecore_Drm_Plane *plane;
+   Eina_List *l;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
+
+   EINA_LIST_FOREACH(output->planes, l, plane)
+     {
+        if (plane->type != type) continue;
+        if ((plane->supported_rotations & rotation) == 0)
+          {
+             WRN("Unsupported rotation");
+             return EINA_FALSE;
+          }
+
+        drmModeObjectSetProperty(output->dev->drm.fd,
+                                 output->primary_plane_id,
+                                 DRM_MODE_OBJECT_PLANE,
+                                 output->rotation_prop_id,
+                                 plane->rotation_map[ffs(rotation)]);
+        break;
+     }
+
+   return EINA_TRUE;
+}

-- 


Reply via email to