derekf pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1b853dcfadfdea9e10bf4bca0ea7a24d990af68f
commit 1b853dcfadfdea9e10bf4bca0ea7a24d990af68f Author: Derek Foreman <der...@osg.samsung.com> Date: Thu Aug 3 18:26:18 2017 -0500 ecore_drm2: Add ecore_drm2_output_info_get We've got too many ways to query output information, so let's add more. (this will soon replace all of them) --- src/lib/ecore_drm2/Ecore_Drm2.h | 15 +++++++++++++++ src/lib/ecore_drm2/ecore_drm2_outputs.c | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h index 0468cbca5e..ef35304c35 100644 --- a/src/lib/ecore_drm2/Ecore_Drm2.h +++ b/src/lib/ecore_drm2/Ecore_Drm2.h @@ -718,6 +718,21 @@ EAPI unsigned int ecore_drm2_output_connector_type_get(Ecore_Drm2_Output *output EAPI void ecore_drm2_output_resolution_get(Ecore_Drm2_Output *output, int *w, int *h, unsigned int *refresh); /** + * Get the geometry and refresh rate for a given output + * + * @param output + * @param *x + * @param *y + * @param *w + * @param *h + * @param *refresh + * + * @ingroup Ecore_Drm2_Output_Group + * @since 1.21 + */ +EAPI void ecore_drm2_output_info_get(Ecore_Drm2_Output *output, int *x, int *y, int *w, int *h, unsigned int *refresh); + +/** * Get if an output can be used on a given crtc * * This function will loop the possible crtcs of an encoder to determine if diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index 7c460c0c7f..f3f13081b0 100644 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c @@ -1664,3 +1664,22 @@ ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, int sequence, long *s *usec = v.reply.tval_usec; return EINA_TRUE; } + +EAPI void +ecore_drm2_output_info_get(Ecore_Drm2_Output *output, int *x, int *y, int *w, int *h, unsigned int *refresh) +{ + if (x) *x = 0; + if (y) *y = 0; + if (w) *w = 0; + if (h) *h = 0; + if (refresh) *refresh = 0; + + 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; + if (refresh) *refresh = output->current_mode->refresh; + if (x) *x = output->x; + if (y) *y = output->y; +} --