wl-drm: Enable all degrees of screen rotation

This patch enables all degrees of rotation to be selectable in the
Screen Setup dialog. It then applies the rotation based on hardware or
software ... that is, if the hardware can do the selected rotation,
then we use hardware otherwise we will use ecore_evas_rotation
functions (software).

ref T5999

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2017-09-19 13:08:36 -04:00
parent 2b165e75e3
commit 8f5299be08
1 changed files with 14 additions and 33 deletions

View File

@ -410,23 +410,9 @@ _drm2_randr_create(void)
s->config.geom.w, s->config.geom.h);
}
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;
int rotations;
rotations =
ecore_drm2_output_supported_rotations_get(output);
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;
if (cs)
@ -583,25 +569,12 @@ _drm2_randr_apply(void)
ecore_drm2_output_mode_set(output, mode, s->config.geom.x,
s->config.geom.y);
/* TODO: cannot support rotations until we support planes
* and we cannot support planes until Atomic support is in */
int orient = 0;
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);
ecore_drm2_output_enabled_set(output, s->config.enabled);
if (s->config.priority == top_priority)
_drm2_output_primary_set(outputs, output);
ecore_drm2_output_enabled_set(output, s->config.enabled);
if (!s->config.enabled) continue;
printf("\tDRM2 RRR: Mode\n");
printf("\t\tDRM2 RRR: Geom: %d %d %dx%d\n",
@ -613,7 +586,15 @@ _drm2_randr_apply(void)
printf("\tDRM2 RRR: Relative Mode: %d\n", s->config.relative.mode);
printf("\tDRM2 RRR: Relative To: %s\n", s->config.relative.to);
printf("\tDRM2 RRR: Align: %f\n", s->config.relative.align);
ecore_evas_rotation_with_resize_set(e_comp->ee, s->config.rotation);
/* TODO: rotate e_comp pointer to match screen ?? */
/* ecore_drm2_device_pointer_rotation_set(dev, s->config.rotation); */
}
ecore_drm2_device_calibrate(dev, vw, vh);
ecore_drm2_device_pointer_max_set(dev, vw, vh);
}
static void