1
0
Fork 0

renderer/native: Avoid requeuing the same onscreen for a power save flip

This is a case that triple buffering will encounter. We don't want it
to queue the same onscreen multiple times because that would represent
multiple flips occurring simultaneously.

It's a linear search but the list length is typically only 1 or 2 so
no need for anything fancier yet.

(cherry picked from commit 19e62b1299405d630cb7d8ce1f210f00a4903db5)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441>
Signed-off-by: Mingi Sung <sungmg@saltyming.net>
This commit is contained in:
Daniel van Vugt 2021-10-26 18:50:50 +08:00 committed by Mingi Sung
parent 99f7286461
commit 2c8aec356a
Signed by: sungmg
GPG key ID: 41BAFD6FFD8036C5

View file

@ -764,6 +764,9 @@ meta_renderer_native_queue_power_save_page_flip (MetaRendererNative *renderer_na
{
const unsigned int timeout_ms = 100;
if (g_list_find (renderer_native->power_save_page_flip_onscreens, onscreen))
return;
if (!renderer_native->power_save_page_flip_source_id)
{
renderer_native->power_save_page_flip_source_id =