ecore_drm: Change page flipping logic so we can't tear
authorDerek Foreman <derekf@osg.samsung.com>
Thu, 18 Feb 2016 19:22:19 +0000 (13:22 -0600)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 18 Feb 2016 20:50:15 +0000 (15:50 -0500)
commit5d7271683be0e790c1b845e7413a36992ebfb703
treea1fddfd6a59a7ac9922c45676208fa687776c10c
parent1f576da49e662a563d16ea4915e485516aa2b4ee
ecore_drm: Change page flipping logic so we can't tear

Summary:
Previously if we ever tried to queue up two page flips in less than a
retrace interval (which can easily happen since the evas clock isn't
based on vblank) we'd give up on ever using page flips again, and tear
on every screen update.

This fixes that by using a vblank callback for custom ticks and using
page flips whenever possible.

If a page flip fails it means a page flip raced with the vblank ticker,
so we need to queue up that frame when the current page flip completes.
This ensures that while we might drop interim frames, we will never
lose the most recent.

Now it should only be possible to tear if two ticks fire during the
wait for a page flip to complete.  This would result in rendering
taking place in the front buffer.  I don't think this can happen,
but an error is logged if it does.

Reviewers: zmike, devilhorns

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3594
src/lib/ecore_drm/Ecore_Drm.h
src/lib/ecore_drm/ecore_drm_device.c
src/lib/ecore_drm/ecore_drm_fb.c
src/lib/ecore_drm/ecore_drm_private.h
src/modules/evas/engines/drm/evas_outbuf.c