This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch devs/devilhorns/apos
in repository efl.

View the commit online.

commit 862115284a15df64824d589f7f21edf12d6dbf2b
Author: Christopher Michael <devilho...@comcast.net>
AuthorDate: Tue Nov 21 09:34:22 2023 -0500

    ecore_drm2: Add API to return the supported rotations of a given display
---
 src/lib/ecore_drm2/Ecore_Drm2.h          |  1 +
 src/lib/ecore_drm2/ecore_drm2_displays.c | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index fff06679cb..170cb8525b 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -82,6 +82,7 @@ EAPI void ecore_drm2_display_rotation_set(Ecore_Drm2_Display *disp, uint64_t rot
 EAPI void ecore_drm2_display_mode_set(Ecore_Drm2_Display *disp, Ecore_Drm2_Display_Mode *mode, int x, int y);
 EAPI Ecore_Drm2_Crtc *ecore_drm2_display_crtc_get(Ecore_Drm2_Display *disp);
 EAPI Eina_Bool ecore_drm2_display_possible_crtc_get(Ecore_Drm2_Display *disp, Ecore_Drm2_Crtc *crtc);
+EAPI int ecore_drm2_display_supported_rotations_get(Ecore_Drm2_Display *disp);
 
 # endif
 
diff --git a/src/lib/ecore_drm2/ecore_drm2_displays.c b/src/lib/ecore_drm2/ecore_drm2_displays.c
index 337a30a258..72eaf9dd9b 100644
--- a/src/lib/ecore_drm2/ecore_drm2_displays.c
+++ b/src/lib/ecore_drm2/ecore_drm2_displays.c
@@ -915,3 +915,22 @@ next:
 
    return ret;
 }
+
+EAPI int
+ecore_drm2_display_supported_rotations_get(Ecore_Drm2_Display *disp)
+{
+   Ecore_Drm2_Plane *plane;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(disp, -1);
+
+   /* get the primary plane for this output */
+   plane = _ecore_drm2_planes_primary_find(disp->dev, disp->crtc->id);
+   if (!plane) return -1;
+
+   /* if plane state has not been filled yet, bail out */
+   /* NB: We could modify this to get the plane rotations directly from drm */
+   if (!plane->state.current) return -1;
+
+   /* return primary plane state supported_rotations */
+   return plane->state.current->supported_rotations;
+}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to