From ad58670c5632b6ce5dcb9d8afc7f04e1f8d7c0e3 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Wed, 11 May 2016 09:25:36 -0400 Subject: [PATCH] ecore-drm2: Add API function to return physical size of a given output Signed-off-by: Chris Michael --- src/lib/ecore_drm2/Ecore_Drm2.h | 14 ++++++++++++++ src/lib/ecore_drm2/ecore_drm2_outputs.c | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h index 3b4ffdfebc..41c1b41323 100644 --- a/src/lib/ecore_drm2/Ecore_Drm2.h +++ b/src/lib/ecore_drm2/Ecore_Drm2.h @@ -437,6 +437,20 @@ EAPI Eina_Bool ecore_drm2_output_enabled_get(Ecore_Drm2_Output *output); */ EAPI void ecore_drm2_output_enabled_set(Ecore_Drm2_Output *output, Eina_Bool enabled); +/** + * Get the physical size of a given output + * + * This function will give the physical size (in mm) of an output + * + * @param output + * @param *w + * @param *h + * + * @ingroup Ecore_Drm2_Output_Group + * @since 1.18 + */ +EAPI void ecore_drm2_output_physical_size_get(Ecore_Drm2_Output *output, int *w, int *h); + /** * @defgroup Ecore_Drm2_Fb_Group Drm framebuffer functions * diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index 553c91101c..1c8c576fc6 100644 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c @@ -954,3 +954,15 @@ ecore_drm2_output_enabled_set(Ecore_Drm2_Output *output, Eina_Bool enabled) _output_event_send(output); } + +EAPI void +ecore_drm2_output_physical_size_get(Ecore_Drm2_Output *output, int *w, int *h) +{ + if (w) *w = 0; + if (h) *h = 0; + + EINA_SAFETY_ON_NULL_RETURN(output); + + if (w) *w = output->pw; + if (h) *h = output->ph; +}