diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h index fcf784b2c2..0003ef50eb 100644 --- a/src/lib/ecore_drm/Ecore_Drm.h +++ b/src/lib/ecore_drm/Ecore_Drm.h @@ -868,6 +868,18 @@ EAPI Eina_List *ecore_drm_output_modes_get(Ecore_Drm_Output *output); */ EAPI Ecore_Drm_Output *ecore_drm_output_primary_get(Ecore_Drm_Device *dev); +/** + * Get the size of the crtc for a given output + * + * @param output The Ecore_Drm_Output to get the crtc size of + * @param *width The parameter in which width is stored + * @param *height The parameter in which height is stored + * + * @ingroup Ecore_Drm_Output_Group + * @since 1.15 + */ +EAPI void ecore_drm_output_crtc_size_get(Ecore_Drm_Output *output, int *width, int *height); + #ifdef __cplusplus } #endif diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c index d9283f1b06..8b4369ec4c 100644 --- a/src/lib/ecore_drm/ecore_drm_output.c +++ b/src/lib/ecore_drm/ecore_drm_output.c @@ -1263,3 +1263,15 @@ ecore_drm_output_primary_get(Ecore_Drm_Device *dev) return NULL; } + +EAPI void +ecore_drm_output_crtc_size_get(Ecore_Drm_Output *output, int *width, int *height) +{ + if (width) *width = 0; + if (height) *height = 0; + + EINA_SAFETY_ON_NULL_RETURN(output); + + if (width) *width = output->crtc->width; + if (height) *height = output->crtc->height; +}