ecore_drm2: distinguish real flip failure from flip deferral
authorDerek Foreman <derekf@osg.samsung.com>
Thu, 8 Sep 2016 03:16:10 +0000 (22:16 -0500)
committerDerek Foreman <derekf@osg.samsung.com>
Thu, 8 Sep 2016 18:55:24 +0000 (13:55 -0500)
If we try to flip too soon we get EBUSY and should queue up the buffer
for later presentation.  Only the other errors need to be dealt with
elsewhere.

src/lib/ecore_drm2/ecore_drm2_fb.c

index 1c1c947..b56486e 100644 (file)
@@ -271,14 +271,18 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output)
    ret =
      drmModePageFlip(fb->fd, output->crtc_id, fb->id,
                      DRM_MODE_PAGE_FLIP_EVENT, output->user_data);
-   if (ret < 0)
+   if ((ret < 0) && (errno != EBUSY))
      {
         DBG("Pageflip Failed for Crtc %u on Connector %u: %m",
             output->crtc_id, output->conn_id);
-        output->next = fb;
-        fb->busy = EINA_TRUE;
         return ret;
      }
+   else if (ret < 0)
+     {
+        output->next = fb;
+        output->next->busy = EINA_TRUE;
+        return 0;
+     }
 
    if (output->current) output->current->busy = EINA_FALSE;
    output->current = fb;