ecore-drm: Add API function for getting size of an output.
authorChris Michael <cp.michael@samsung.com>
Fri, 28 Mar 2014 10:32:59 +0000 (10:32 +0000)
committerChris Michael <cp.michael@samsung.com>
Tue, 1 Apr 2014 06:09:49 +0000 (07:09 +0100)
@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_drm/Ecore_Drm.h
src/lib/ecore_drm/ecore_drm_output.c

index 8e1d4d0..a8f0a64 100644 (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);
index 827c162..82cb51e 100644 (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);
+}