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 <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2017-01-18 11:30:30 -05:00
parent 307072fc43
commit ba7e910f9c
1 changed files with 27 additions and 17 deletions

View File

@ -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);