diff options
author | Chris Michael <cpmichael@osg.samsung.com> | 2016-05-11 09:36:34 -0400 |
---|---|---|
committer | Chris Michael <cpmichael@osg.samsung.com> | 2016-05-27 11:57:53 -0400 |
commit | d08d7e18e3a43f12ee9c109031a80b950d552868 (patch) | |
tree | 88bf326c3350a2533354f148d44be6a0a931f450 | |
parent | 1eb85aab57b1663d95889cb58924dd761f0e9ecd (diff) | |
download | efl-d08d7e18e3a43f12ee9c109031a80b950d552868.tar.gz |
ecore-drm2: Add API to return current resolution of a given output
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
-rw-r--r-- | src/lib/ecore_drm2/Ecore_Drm2.h | 13 | ||||
-rw-r--r-- | src/lib/ecore_drm2/ecore_drm2_outputs.c | 15 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h index 9792395d06..494d03ad83 100644 --- a/src/lib/ecore_drm2/Ecore_Drm2.h +++ b/src/lib/ecore_drm2/Ecore_Drm2.h @@ -555,6 +555,19 @@ EAPI Eina_Bool ecore_drm2_output_cloned_get(Ecore_Drm2_Output *output); EAPI unsigned int ecore_drm2_output_connector_type_get(Ecore_Drm2_Output *output); /** + * Get the current resolution of a given output + * + * @param output + * @param *w + * @param *h + * @param *refresh + * + * @ingroup Ecore_Drm2_Output_Group + * @since 1.18 + */ +EAPI void ecore_drm2_output_resolution_get(Ecore_Drm2_Output *output, int *w, int *h, unsigned int *refresh); + +/** * @defgroup Ecore_Drm2_Fb_Group Drm framebuffer functions * * Functions that deal with setup of framebuffers diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index da2ca928ca..87f962861c 100644 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c @@ -1069,3 +1069,18 @@ ecore_drm2_output_connector_type_get(Ecore_Drm2_Output *output) EINA_SAFETY_ON_NULL_RETURN_VAL(output, 0); return output->conn_type; } + +EAPI void +ecore_drm2_output_resolution_get(Ecore_Drm2_Output *output, int *w, int *h, unsigned int *refresh) +{ + 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; +} |