derekf pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b902ef7c69443a54f64fedcdd07f7a3e0e2fb4fe
commit b902ef7c69443a54f64fedcdd07f7a3e0e2fb4fe Author: Derek Foreman <der...@osg.samsung.com> Date: Fri Apr 28 12:22:04 2017 -0500 ecore_drm2: Make _release_buffer take a state struct instead of fb Lets us push the NULL set into _release_buffer for some clean up --- src/lib/ecore_drm2/ecore_drm2_fb.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c index fefd8be..462f41b 100644 --- a/src/lib/ecore_drm2/ecore_drm2_fb.c +++ b/src/lib/ecore_drm2/ecore_drm2_fb.c @@ -209,10 +209,11 @@ ecore_drm2_fb_dirty(Ecore_Drm2_Fb *fb, Eina_Rectangle *rects, unsigned int count } static void -_release_buffer(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *b) +_release_buffer(Ecore_Drm2_Output *output, Ecore_Drm2_Output_State *s) { - b->busy = EINA_FALSE; - if (output->release_cb) output->release_cb(output->release_data, b); + s->fb->busy = EINA_FALSE; + if (output->release_cb) output->release_cb(output->release_data, s->fb); + s->fb = NULL; } EAPI Eina_Bool @@ -221,7 +222,7 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output) EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); if (output->current.fb && (output->current.fb != output->pending.fb)) - _release_buffer(output, output->current.fb); + _release_buffer(output, &output->current); output->current.fb = output->pending.fb; output->pending.fb = NULL; @@ -393,7 +394,7 @@ _fb_flip(Ecore_Drm2_Output *output) return ret; } - if (output->current.fb) _release_buffer(output, output->current.fb); + if (output->current.fb) _release_buffer(output, &output->current); output->current.fb = fb; output->current.fb->busy = EINA_TRUE; output->next.fb = NULL; @@ -471,7 +472,7 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output) if (output->pending.fb) { - if (output->next.fb) _release_buffer(output, output->next.fb); + if (output->next.fb) _release_buffer(output, &output->next); output->next.fb = fb; if (output->next.fb) output->next.fb->busy = EINA_TRUE; return 0; @@ -525,8 +526,7 @@ ecore_drm2_fb_release(Ecore_Drm2_Output *o, Eina_Bool panic) if (o->next.fb) { - _release_buffer(o, o->next.fb); - o->next.fb = NULL; + _release_buffer(o, &o->next); return EINA_TRUE; } if (!panic) return EINA_FALSE; @@ -541,15 +541,13 @@ ecore_drm2_fb_release(Ecore_Drm2_Output *o, Eina_Bool panic) */ if (o->current.fb) { - _release_buffer(o, o->current.fb); - o->current.fb = NULL; + _release_buffer(o, &o->current); return EINA_TRUE; } if (o->pending.fb) { - _release_buffer(o, o->pending.fb); - o->pending.fb = NULL; + _release_buffer(o, &o->pending); return EINA_TRUE; } --