MetaRendererNative: Flush all pending swap notifies on idle
authorRui Matos <tiagomatos@gmail.com>
Mon, 5 Dec 2016 18:18:24 +0000 (19:18 +0100)
committerAndreas Henriksson <andreas@fatal.se>
Sun, 8 Jan 2017 02:12:13 +0000 (02:12 +0000)
commit11e1cc7c605bb977a6446c0ead51a7015afbd71f
tree8795603046e0cab99406619fbe4385e6e5ce9c0a
parent56cbaecd4107eac9d4a1a9ca7270af25b7fe1697
MetaRendererNative: Flush all pending swap notifies on idle

We need to do swap notifications asynchronously from flip events since
these might be processed during swap buffers if we are waiting for the
previous frame's flip to continue with the current.

This means that we might have more than one swap notification queued
to be delivered when the idle handler runs. In that case we must
deliver all notifications for which we've already seen a flip event.

Failing to do so means that if a new frame, that only swaps buffers on
such a swap notification backlogged Onscreen, is started, when later
we get its flip event, we'd notify only an old frame which would hit
this MetaStageNative's frame_cb() early exit:

  if (global_frame_counter <= presented_frame_counter)
    return;

and we'd never finish the new frame and thus clutter's master clock
would be waiting forever stuck.

https://bugzilla.gnome.org/show_bug.cgi?id=774557

Gbp-Pq: Name git_flush_all_swap_notifies_on_idle.patch
src/backends/native/meta-renderer-native.c