devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ca194584d5e9072fa0640d810afa68779beb030b
commit ca194584d5e9072fa0640d810afa68779beb030b Author: Chris Michael <[email protected]> Date: Wed Jan 18 10:38:01 2017 -0500 ecore-drm2: Add API function to return supported rotations of an output Small patch to add an API function which can be used to return the supported rotations of a given output. This is used inside the Enlightenment wl_drm module to determine if rotations is supported on an output. @feature Signed-off-by: Chris Michael <[email protected]> --- src/lib/ecore_drm2/Ecore_Drm2.h | 15 +++++++++++++++ src/lib/ecore_drm2/ecore_drm2_device.c | 1 + src/lib/ecore_drm2/ecore_drm2_outputs.c | 15 +++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h index 2a97277..a7834c4 100644 --- a/src/lib/ecore_drm2/Ecore_Drm2.h +++ b/src/lib/ecore_drm2/Ecore_Drm2.h @@ -743,6 +743,21 @@ EAPI Eina_Bool ecore_drm2_output_possible_crtc_get(Ecore_Drm2_Output *output, un EAPI void ecore_drm2_output_gamma_set(Ecore_Drm2_Output *output, uint16_t size, uint16_t *red, uint16_t *green, uint16_t *blue); /** + * Get the supported rotations of a given output + * + * @param output + * + * @return An integer representing possible rotations, or -1 on failure + * + * @note This function will only return valid values if Atomic support + * is enabled as it requires hardware plane support. + * + * @ingroup Ecore_Drm2_Output_Group + * @since 1.19 + */ +EAPI int ecore_drm2_output_supported_rotations_get(Ecore_Drm2_Output *output); + +/** * @defgroup Ecore_Drm2_Fb_Group Drm framebuffer functions * * Functions that deal with setup of framebuffers diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c index a6e6d22..0c5cb15 100644 --- a/src/lib/ecore_drm2/ecore_drm2_device.c +++ b/src/lib/ecore_drm2/ecore_drm2_device.c @@ -454,6 +454,7 @@ _drm2_atomic_state_plane_fill(Ecore_Drm2_Plane_State *pstate, int fd) { int r = -1; + DBG("\t\t\tRotation: %s", prop->enums[k].name); if (!strcmp(prop->enums[k].name, "rotate-0")) r = ECORE_DRM2_ROTATION_NORMAL; else if (!strcmp(prop->enums[k].name, "rotate-90")) diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index c9f7dde..055b63d 100644 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c @@ -1514,3 +1514,18 @@ ecore_drm2_output_gamma_set(Ecore_Drm2_Output *output, uint16_t size, uint16_t * red, green, blue) < 0) ERR("Failed to set gamma for Output %s: %m", output->name); } + +EAPI int +ecore_drm2_output_supported_rotations_get(Ecore_Drm2_Output *output) +{ + int ret = -1; + + EINA_SAFETY_ON_NULL_RETURN_VAL(output, -1); + +#ifdef HAVE_ATOMIC_DRM + if (_ecore_drm2_use_atomic) + ret = output->plane_state->supported_rotations; +#endif + + return ret; +} --
