devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=ba7e910f9c2e0111dfa06fe0cc83af22da4bef20

commit ba7e910f9c2e0111dfa06fe0cc83af22da4bef20
Author: Chris Michael <[email protected]>
Date:   Wed Jan 18 11:30:30 2017 -0500

    re-enable getting and setting output rotations in wl_drm
    
    Small patch to re-enable the ability to query and set the rotation of
    an output.
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/modules/wl_drm/e_mod_main.c | 44 +++++++++++++++++++++++++----------------
 1 file changed, 27 insertions(+), 17 deletions(-)

diff --git a/src/modules/wl_drm/e_mod_main.c b/src/modules/wl_drm/e_mod_main.c
index 6d9cb62..1d962ea 100644
--- a/src/modules/wl_drm/e_mod_main.c
+++ b/src/modules/wl_drm/e_mod_main.c
@@ -444,30 +444,26 @@ _drm2_randr_create(void)
                          s->config.geom.w, s->config.geom.h);
                }
 
-             /* TODO: cannot support rotations until we support planes
-              * and we cannot support planes until Atomic support is in */
-
              s->info.can_rot_0 = EINA_FALSE;
              s->info.can_rot_90 = EINA_FALSE;
              s->info.can_rot_180 = EINA_FALSE;
              s->info.can_rot_270 = EINA_FALSE;
 
-/* # if (EFL_VERSION_MAJOR > 1) || (EFL_VERSION_MINOR >= 18) */
-/*              unsigned int rotations; */
+# if (EFL_VERSION_MAJOR > 1) || (EFL_VERSION_MINOR >= 18)
+             int rotations;
 
-/*              rotations = */
-/*                ecore_drm_output_supported_rotations_get(output, */
-/*                                                         
ECORE_DRM_PLANE_TYPE_PRIMARY); */
+             rotations =
+               ecore_drm2_output_supported_rotations_get(output);
 
-/*              if (rotations & ECORE_DRM_PLANE_ROTATION_NORMAL) */
-/*                s->info.can_rot_0 = EINA_TRUE; */
-/*              if (rotations & ECORE_DRM_PLANE_ROTATION_90) */
-/*                s->info.can_rot_90 = EINA_TRUE; */
-/*              if (rotations & ECORE_DRM_PLANE_ROTATION_180) */
-/*                s->info.can_rot_180 = EINA_TRUE; */
-/*              if (rotations & ECORE_DRM_PLANE_ROTATION_270) */
-/*                s->info.can_rot_270 = EINA_TRUE; */
-/* # endif */
+             if (rotations & ECORE_DRM2_ROTATION_NORMAL)
+               s->info.can_rot_0 = EINA_TRUE;
+             if (rotations & ECORE_DRM2_ROTATION_90)
+               s->info.can_rot_90 = EINA_TRUE;
+             if (rotations & ECORE_DRM2_ROTATION_180)
+               s->info.can_rot_180 = EINA_TRUE;
+             if (rotations & ECORE_DRM2_ROTATION_270)
+               s->info.can_rot_270 = EINA_TRUE;
+# endif
 
              if (cs)
                {
@@ -625,6 +621,20 @@ _drm2_randr_apply(void)
 
         /* TODO: cannot support rotations until we support planes
          * and we cannot support planes until Atomic support is in */
+# if (EFL_VERSION_MAJOR > 1) || (EFL_VERSION_MINOR >= 18)
+        int orient;
+
+        if (s->config.rotation == 0)
+          orient = ECORE_DRM2_ROTATION_NORMAL;
+        else if (s->config.rotation == 90)
+          orient = ECORE_DRM2_ROTATION_90;
+        else if (s->config.rotation == 180)
+          orient = ECORE_DRM2_ROTATION_180;
+        else if (s->config.rotation == 270)
+          orient = ECORE_DRM2_ROTATION_270;
+
+        ecore_drm2_output_rotation_set(output, orient);
+# endif
 
         if (s->config.priority == top_priority)
           _drm2_output_primary_set(outputs, output);

-- 


Reply via email to