summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_fb.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-05-04 13:41:16 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-05-05 12:53:25 -0500
commit7628977fbf4e09fb5a4f39882216db300b426b5f (patch)
tree87a32897159dc497c0242475bec99368494af4d9 /src/lib/ecore_drm2/ecore_drm2_fb.c
parent699ed066ea4d57531b5900eff23597ba0dd70017 (diff)
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.
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_fb.c26
1 files 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 fbf5c5faa6..04af3b1325 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)
252Eina_Bool 252Eina_Bool
253_fb_atomic_flip_test(Ecore_Drm2_Output *output) 253_fb_atomic_flip_test(Ecore_Drm2_Output *output)
254{ 254{
255 Eina_Bool res = EINA_FALSE;
256#ifdef HAVE_ATOMIC_DRM 255#ifdef HAVE_ATOMIC_DRM
257 int ret = 0; 256 int ret = 0;
258 Eina_List *l; 257 Eina_List *l;
@@ -349,30 +348,21 @@ _fb_atomic_flip_test(Ecore_Drm2_Output *output)
349 348
350 ret = 349 ret =
351 sym_drmModeAtomicCommit(output->fd, req, flags, NULL); 350 sym_drmModeAtomicCommit(output->fd, req, flags, NULL);
352 if (ret < 0) ERR("Failed Atomic Commit Test: %m"); 351 if (ret < 0) goto err;
353 else res = EINA_TRUE;
354 352
355 if (res) 353 /* clear any previous request */
356 { 354 if (output->prep.atomic_req)
357 if (output->prep.atomic_req) 355 sym_drmModeAtomicFree(output->prep.atomic_req);
358 {
359 /* clear any previous request */
360 sym_drmModeAtomicFree(output->prep.atomic_req);
361 356
362 /* just use the new request */ 357 output->prep.atomic_req = req;
363 output->prep.atomic_req = req; 358 return EINA_TRUE;
364 }
365 else
366 output->prep.atomic_req = req;
367 }
368 359
369 return res;
370
371err: 360err:
361 DBG("Failed Atomic Test: %m");
372 sym_drmModeAtomicFree(req); 362 sym_drmModeAtomicFree(req);
373#endif 363#endif
374 364
375 return res; 365 return EINA_FALSE;
376} 366}
377 367
378static int 368static int