ecore_drm2: Better handle flip failure
authorDerek Foreman <derekf@osg.samsung.com>
Wed, 17 May 2017 19:53:11 +0000 (14:53 -0500)
committerDerek Foreman <derekf@osg.samsung.com>
Wed, 17 May 2017 20:01:54 +0000 (15:01 -0500)
We need to release the buffer we couldn't flip to when a flip fails.

This makes whatever bug is causing a page flip to happen right after
dpms blanks the screen, which was leading to a failure to ever wake
from dpms because the flip left a pending buffer that never completed.

Fix T5462

src/lib/ecore_drm2/ecore_drm2_fb.c

index 71ea60d..3c00a98 100644 (file)
@@ -570,13 +570,18 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output)
    else
      ret = _fb_flip(output);
 
+   if (ret)
+     {
+        _release_buffer(output, &output->prep);
+        return ret;
+     }
    output->pending.fb = output->prep.fb;
    output->prep.fb = NULL;
 #ifdef HAVE_ATOMIC_DRM
    output->pending.atomic_req = output->prep.atomic_req;
    output->prep.atomic_req = NULL;
 #endif
-   return ret;
+   return 0;
 }
 
 EAPI Eina_Bool