ecore-drm: Add API function for getting size of an output.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2014-03-28 10:32:59 +00:00
parent c5c378f5f9
commit bba98a515c
2 changed files with 16 additions and 0 deletions

View File

@ -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);

View File

@ -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);
}