summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
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/engines/drm/ecore_evas_drm.c
parentccf3297a0dac16d382b923f7bd9f2af94c30b690 (diff)
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 T5999 Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to '')
-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
221_drm_rotation_do(Ecore_Evas *ee, int rotation, int resize) 221_drm_rotation_do(Ecore_Evas *ee, int rotation, int resize)
222{ 222{
223 Evas_Engine_Info_Drm *einfo; 223 Evas_Engine_Info_Drm *einfo;
224 int diff; 224 Ecore_Evas_Engine_Drm_Data *edata;
225 Eina_Bool use_hw = EINA_FALSE;
226 int diff, rotations = 0, orient = 0;
225 227
226 if (ee->rotation == rotation) return; 228 if (ee->rotation == rotation) return;
227 229
228 einfo = (Evas_Engine_Info_Drm *)evas_engine_info_get(ee->evas); 230 einfo = (Evas_Engine_Info_Drm *)evas_engine_info_get(ee->evas);
229 if (!einfo) return; 231 if (!einfo) return;
230 232
233 edata = ee->engine.data;
234
235 rotations = ecore_drm2_output_supported_rotations_get(edata->output);
236 if (rotations >= 0)
237 {
238 if (rotations & ECORE_DRM2_ROTATION_NORMAL)
239 {
240 if (rotation == 0)
241 {
242 use_hw = EINA_TRUE;
243 orient = ECORE_DRM2_ROTATION_NORMAL;
244 }
245 }
246
247 if (rotations & ECORE_DRM2_ROTATION_90)
248 {
249 if (rotation == 90)
250 {
251 use_hw = EINA_TRUE;
252 orient = ECORE_DRM2_ROTATION_90;
253 }
254 }
255
256 if (rotations & ECORE_DRM2_ROTATION_180)
257 {
258 if (rotation == 180)
259 {
260 use_hw = EINA_TRUE;
261 orient = ECORE_DRM2_ROTATION_180;
262 }
263 }
264
265 if (rotations & ECORE_DRM2_ROTATION_270)
266 {
267 if (rotation == 270)
268 {
269 use_hw = EINA_TRUE;
270 orient = ECORE_DRM2_ROTATION_270;
271 }
272 }
273 }
274
275 if (use_hw)
276 {
277 ecore_drm2_output_rotation_set(edata->output, orient);
278 ee->rotation = rotation;
279 return;
280 }
281
231 einfo->info.rotation = rotation; 282 einfo->info.rotation = rotation;
232 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) 283 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
233 ERR("evas_engine_info_set() for engine '%s' failed", ee->driver); 284 ERR("evas_engine_info_set() for engine '%s' failed", ee->driver);