ecore_drm2: Better handle flip failure round 2
authorDerek Foreman <derekf@osg.samsung.com>
Wed, 17 May 2017 22:31:13 +0000 (17:31 -0500)
committerDerek Foreman <derekf@osg.samsung.com>
Wed, 17 May 2017 22:31:13 +0000 (17:31 -0500)
If the buffer being flipped to is the one already on screen then
releasing it on flip failure will leave it on scanout with no
references.  The next time a buffer is queued it will be removed
from scanout and deleted.

Not good.

Fix T5462

src/lib/ecore_drm2/ecore_drm2_fb.c

index 3c00a98..f2c54e3 100644 (file)
@@ -572,7 +572,8 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output)
 
    if (ret)
      {
-        _release_buffer(output, &output->prep);
+        if (output->prep.fb != output->current.fb)
+          _release_buffer(output, &output->prep);
         return ret;
      }
    output->pending.fb = output->prep.fb;