derekf pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7628977fbf4e09fb5a4f39882216db300b426b5f
commit 7628977fbf4e09fb5a4f39882216db300b426b5f Author: Derek Foreman <[email protected]> Date: Thu May 4 13:41:16 2017 -0500 ecore_drm2: Fix flip test error handling We need to free the atomic req if commit fails, so let's merge these failure paths and simplify code a bit. --- src/lib/ecore_drm2/ecore_drm2_fb.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c index fbf5c5f..04af3b1 100644 --- a/src/lib/ecore_drm2/ecore_drm2_fb.c +++ b/src/lib/ecore_drm2/ecore_drm2_fb.c @@ -252,7 +252,6 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output) Eina_Bool _fb_atomic_flip_test(Ecore_Drm2_Output *output) { - Eina_Bool res = EINA_FALSE; #ifdef HAVE_ATOMIC_DRM int ret = 0; Eina_List *l; @@ -349,30 +348,21 @@ _fb_atomic_flip_test(Ecore_Drm2_Output *output) ret = sym_drmModeAtomicCommit(output->fd, req, flags, NULL); - if (ret < 0) ERR("Failed Atomic Commit Test: %m"); - else res = EINA_TRUE; + if (ret < 0) goto err; - if (res) - { - if (output->prep.atomic_req) - { - /* clear any previous request */ - sym_drmModeAtomicFree(output->prep.atomic_req); + /* clear any previous request */ + if (output->prep.atomic_req) + sym_drmModeAtomicFree(output->prep.atomic_req); - /* just use the new request */ - output->prep.atomic_req = req; - } - else - output->prep.atomic_req = req; - } + output->prep.atomic_req = req; + return EINA_TRUE; - return res; - err: + DBG("Failed Atomic Test: %m"); sym_drmModeAtomicFree(req); #endif - return res; + return EINA_FALSE; } static int --
