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 <cp.michael@samsung.com>
This commit is contained in:
parent
f32268ad1b
commit
ca194584d5
|
@ -742,6 +742,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
|
||||
*
|
||||
|
|
|
@ -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"))
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue