devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=bba98a515c99a5115bbdfb92f11e0e4c35d4f882
commit bba98a515c99a5115bbdfb92f11e0e4c35d4f882 Author: Chris Michael <cp.mich...@samsung.com> Date: Fri Mar 28 10:32:59 2014 +0000 ecore-drm: Add API function for getting size of an output. @feature Signed-off-by: Chris Michael <cp.mich...@samsung.com> --- src/lib/ecore_drm/Ecore_Drm.h | 1 + src/lib/ecore_drm/ecore_drm_output.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h index 8e1d4d0..a8f0a64 100644 --- a/src/lib/ecore_drm/Ecore_Drm.h +++ b/src/lib/ecore_drm/Ecore_Drm.h @@ -157,6 +157,7 @@ EAPI void ecore_drm_output_cursor_size_set(Ecore_Drm_Output *output, int handle, EAPI Eina_Bool ecore_drm_output_enable(Ecore_Drm_Output *output); EAPI void ecore_drm_output_fb_release(Ecore_Drm_Output *output, Ecore_Drm_Fb *fb); EAPI void ecore_drm_output_repaint(Ecore_Drm_Output *output); +EAPI void ecore_drm_output_size_get(Ecore_Drm_Device *dev, int output, int *w, int *h); EAPI Eina_Bool ecore_drm_inputs_create(Ecore_Drm_Device *dev); EAPI void ecore_drm_inputs_destroy(Ecore_Drm_Device *dev); diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c index 827c162..82cb51e 100644 --- a/src/lib/ecore_drm/ecore_drm_output.c +++ b/src/lib/ecore_drm/ecore_drm_output.c @@ -703,3 +703,18 @@ err: output->next = NULL; } } + +EAPI void +ecore_drm_output_size_get(Ecore_Drm_Device *dev, int output, int *w, int *h) +{ + drmModeFB *fb; + + if (w) *w = 0; + if (h) *h = 0; + if (!dev) return; + + if (!(fb = drmModeGetFB(dev->drm.fd, output))) return; + if (w) *w = fb->width; + if (h) *h = fb->height; + drmModeFreeFB(fb); +} --