diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h index 863a9c6df9..2b87981da5 100644 --- a/src/lib/ecore_drm2/Ecore_Drm2.h +++ b/src/lib/ecore_drm2/Ecore_Drm2.h @@ -866,10 +866,13 @@ EAPI void ecore_drm2_fb_busy_set(Ecore_Drm2_Fb *fb, Eina_Bool busy); * * @param output The output to force release * @param panic Try to release even buffers committed to scanout + * + * @return EINA_TRUE if a buffer was released + * * @ingroup Ecore_Drm2_Fb_Group * @since 1.19 */ -EAPI void ecore_drm2_fb_release(Ecore_Drm2_Output *o, Eina_Bool panic); +EAPI Eina_Bool ecore_drm2_fb_release(Ecore_Drm2_Output *o, Eina_Bool panic); /** * Set the user data for the output's page flip handler diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c index 3737bdfcc0..6648d67aab 100644 --- a/src/lib/ecore_drm2/ecore_drm2_fb.c +++ b/src/lib/ecore_drm2/ecore_drm2_fb.c @@ -455,20 +455,24 @@ ecore_drm2_fb_busy_set(Ecore_Drm2_Fb *fb, Eina_Bool busy) fb->busy = busy; } -EAPI void +EAPI Eina_Bool ecore_drm2_fb_release(Ecore_Drm2_Output *o, Eina_Bool panic) { - EINA_SAFETY_ON_NULL_RETURN(o); + EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); if (o->next) { _release_buffer(o, o->next); o->next = NULL; - return; + return EINA_TRUE; } - if (!panic) return; + if (!panic) return EINA_FALSE; - WRN("Buffer release request when no next buffer"); + /* This has been demoted to DBG from WRN because we + * call this function to reclaim all buffers on a + * surface resize. + */ + DBG("Buffer release request when no next buffer"); /* If we have to release these we're going to see tearing. * Try to reclaim in decreasing order of visual awfulness */ @@ -476,15 +480,17 @@ ecore_drm2_fb_release(Ecore_Drm2_Output *o, Eina_Bool panic) { _release_buffer(o, o->current); o->current = NULL; - return; + return EINA_TRUE; } if (o->pending) { _release_buffer(o, o->pending); o->pending = NULL; - return; + return EINA_TRUE; } + + return EINA_FALSE; } EAPI void *