diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h index e8c32197f5..614db0dba7 100644 --- a/src/lib/ecore_drm2/Ecore_Drm2.h +++ b/src/lib/ecore_drm2/Ecore_Drm2.h @@ -74,6 +74,7 @@ EAPI void ecore_drm2_display_mode_info_get(Ecore_Drm2_Display_Mode *mode, int *w EAPI Eina_Bool ecore_drm2_display_primary_get(Ecore_Drm2_Display *disp); EAPI void ecore_drm2_display_primary_set(Ecore_Drm2_Display *disp, Eina_Bool primary); EAPI const Eina_List *ecore_drm2_displays_get(Ecore_Drm2_Device *dev); +EAPI void ecore_drm2_display_info_get(Ecore_Drm2_Display *disp, int *x, int *y, int *w, int *h, unsigned int *refresh); /* XXX: These are 'test' APIs */ EAPI void ecore_drm2_display_mode_set(Ecore_Drm2_Display *disp, Ecore_Drm2_Display_Mode *mode, int x, int y); diff --git a/src/lib/ecore_drm2/ecore_drm2_displays.c b/src/lib/ecore_drm2/ecore_drm2_displays.c index 298a0c21fc..47568ea87b 100644 --- a/src/lib/ecore_drm2/ecore_drm2_displays.c +++ b/src/lib/ecore_drm2/ecore_drm2_displays.c @@ -693,3 +693,37 @@ ecore_drm2_displays_get(Ecore_Drm2_Device *dev) EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE); return dev->displays; } + +EAPI void +ecore_drm2_display_info_get(Ecore_Drm2_Display *disp, 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(disp); + EINA_SAFETY_ON_TRUE_RETURN(!disp->current_mode); + + if (x) *x = disp->x; + if (y) *y = disp->y; + + /* FIXME !! */ + /* switch (disp->rotation) */ + /* { */ + /* case ECORE_DRM2_ROTATION_90: */ + /* case ECORE_DRM2_ROTATION_270: */ + /* if (w) *w = disp->current_mode->height; */ + /* if (h) *h = disp->current_mode->width; */ + /* break; */ + /* case ECORE_DRM2_ROTATION_NORMAL: */ + /* case ECORE_DRM2_ROTATION_180: */ + /* default: */ + if (w) *w = disp->current_mode->width; + if (h) *h = disp->current_mode->height; + /* break; */ + /* } */ + + if (refresh) *refresh = disp->current_mode->refresh; +}