compositor-drm: Clean up page_flip_pending path
authorDaniel Stone <daniels@collabora.com>
Tue, 4 Apr 2017 16:54:33 +0000 (17:54 +0100)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Mon, 10 Apr 2017 10:56:12 +0000 (13:56 +0300)
commit205c0a018ccf79c59f4b43ebb2b6df32103c32fd
treef2b183d216c6f629a15202db2d92c2863c77e9c8
parent65d87d071f739fe2580a0c3ecb95686384eb0bf3
compositor-drm: Clean up page_flip_pending path

page_flip_pending is only be set when do a pageflip to a newly-rendered
buffer; if the flag is not set, we have landed in the start_repaint_loop
path where the vblank query fails, and thus we must pageflip to the same
buffer.

This test was not sufficient for what it was supposed to guard:
releasing framebuffers back. When using client-supplied framebuffers, it
is possible to reuse the same buffer multiple times, and we would send a
framebuffer-release event too early.

However, since we have a properly reference-counted drm_fb now, we can
just drop this test, and rely on the reference counting to prevent
too-early release of client framebuffers.

page_flip_pending now becomes exactly what the name suggests: a flag
which indicates whether or not we are expecting a pageflip event. Add
asserts here to verify that we never receive a pageflip event we weren't
expecting.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
libweston/compositor-drm.c