diff --git a/src/modules/wl_drm/e_mod_main.c b/src/modules/wl_drm/e_mod_main.c index 6d9cb6263..1d962ea4e 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);