From 88e91ae5248f2d4ea86b4b1956aa77181a33f9a7 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Fri, 22 Mar 2019 12:41:25 -0400 Subject: [PATCH] ecore-drm2: Factor in output rotation when getting output info Summary: Enlightenment uses this function to get information about a given output, so we should be accounting for output rotation when returning width/height values. ref T7690 @fix Depends on D8114 Reviewers: raster, cedric, zmike Reviewed By: cedric Subscribers: cedric Tags: #efl, #do_not_merge Maniphest Tasks: T7690 Differential Revision: https://phab.enlightenment.org/D8115 --- src/lib/ecore_drm2/ecore_drm2_outputs.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index c754023..6734cac 100644 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c @@ -1675,8 +1675,21 @@ ecore_drm2_output_info_get(Ecore_Drm2_Output *output, int *x, int *y, int *w, in EINA_SAFETY_ON_NULL_RETURN(output); EINA_SAFETY_ON_TRUE_RETURN(!output->current_mode); - if (w) *w = output->current_mode->width; - if (h) *h = output->current_mode->height; + switch (output->rotation) + { + case ECORE_DRM2_ROTATION_90: + case ECORE_DRM2_ROTATION_270: + if (w) *w = output->current_mode->height; + if (h) *h = output->current_mode->width; + break; + case ECORE_DRM2_ROTATION_NORMAL: + case ECORE_DRM2_ROTATION_180: + default: + if (w) *w = output->current_mode->width; + if (h) *h = output->current_mode->height; + break; + } + if (refresh) *refresh = output->current_mode->refresh; if (x) *x = output->x; if (y) *y = output->y; -- 2.7.4