aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/ecore_evas
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-10-04 11:41:59 -0400
committerChris Michael <cp.michael@samsung.com>2017-10-04 11:41:59 -0400
commit5e36b1c7c19649f189899ddd2027a63d031fa0db (patch)
treedb9ad84c0973cb8232d450b6138b96421ceb3858 /src/modules/ecore_evas
parentector: minor grammar fixups (diff)
downloadefl-5e36b1c7c19649f189899ddd2027a63d031fa0db.tar.gz
ecore-evas-drm: Implement support for hardware output rotations
This patch adds support for doing output rotations via hardware. This is implemented inside the Ecore_Evas engine so that it is transparent to the caller of ecore_evas_rotation_set. ref https://phab.enlightenment.org/T5999 Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/modules/ecore_evas')
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index bd569ddbd5..521e05bd42 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -221,13 +221,64 @@ static void
_drm_rotation_do(Ecore_Evas *ee, int rotation, int resize)
{
Evas_Engine_Info_Drm *einfo;
- int diff;
+ Ecore_Evas_Engine_Drm_Data *edata;
+ Eina_Bool use_hw = EINA_FALSE;
+ int diff, rotations = 0, orient = 0;
if (ee->rotation == rotation) return;
einfo = (Evas_Engine_Info_Drm *)evas_engine_info_get(ee->evas);
if (!einfo) return;
+ edata = ee->engine.data;
+
+ rotations = ecore_drm2_output_supported_rotations_get(edata->output);
+ if (rotations >= 0)
+ {
+ if (rotations & ECORE_DRM2_ROTATION_NORMAL)
+ {
+ if (rotation == 0)
+ {
+ use_hw = EINA_TRUE;
+ orient = ECORE_DRM2_ROTATION_NORMAL;
+ }
+ }
+
+ if (rotations & ECORE_DRM2_ROTATION_90)
+ {
+ if (rotation == 90)
+ {
+ use_hw = EINA_TRUE;
+ orient = ECORE_DRM2_ROTATION_90;
+ }
+ }
+
+ if (rotations & ECORE_DRM2_ROTATION_180)
+ {
+ if (rotation == 180)
+ {
+ use_hw = EINA_TRUE;
+ orient = ECORE_DRM2_ROTATION_180;
+ }
+ }
+
+ if (rotations & ECORE_DRM2_ROTATION_270)
+ {
+ if (rotation == 270)
+ {
+ use_hw = EINA_TRUE;
+ orient = ECORE_DRM2_ROTATION_270;
+ }
+ }
+ }
+
+ if (use_hw)
+ {
+ ecore_drm2_output_rotation_set(edata->output, orient);
+ ee->rotation = rotation;
+ return;
+ }
+
einfo->info.rotation = rotation;
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
ERR("evas_engine_info_set() for engine '%s' failed", ee->driver);