[mutter] renderer-native: Freeze frames while retrying to page flip
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] renderer-native: Freeze frames while retrying to page flip
- Date: Tue, 2 Apr 2019 13:57:44 +0000 (UTC)
commit b2d0184c6efa164ad5dd7a2ca8b10cf13acf5b4c
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Fri Mar 29 20:56:57 2019 +0100
renderer-native: Freeze frames while retrying to page flip
We're currently always waiting for unfinished page flips before flipping
again. This is awkward when we are in an asynchronous retry-page-flip
loop, as we can synchronously wait for any KMS page flip event.
To avoid ending up with such situations, just freeze the frame clock
while we're retrying, then thaw it when we succeded.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/506
src/backends/native/meta-renderer-native.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index 8258da37d..086e8e43c 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -1703,6 +1703,9 @@ retry_page_flips (gpointer user_data)
}
else
{
+ MetaBackend *backend = backend_from_renderer_native (renderer_native);
+
+ meta_backend_thaw_updates (backend);
g_clear_pointer (&onscreen_native->retry_page_flips_source,
g_source_unref);
return G_SOURCE_REMOVE;
@@ -1743,6 +1746,8 @@ schedule_retry_page_flip (MetaOnscreenNative *onscreen_native,
if (!onscreen_native->retry_page_flips_source)
{
+ MetaBackend *backend =
+ backend_from_renderer_native (onscreen_native->renderer_native);
GSource *source;
source = g_source_new (&retry_page_flips_source_funcs, sizeof (GSource));
@@ -1751,6 +1756,7 @@ schedule_retry_page_flip (MetaOnscreenNative *onscreen_native,
g_source_attach (source, NULL);
onscreen_native->retry_page_flips_source = source;
+ meta_backend_freeze_updates (backend);
}
else
{
@@ -3048,8 +3054,15 @@ meta_renderer_native_release_onscreen (CoglOnscreen *onscreen)
g_list_free_full (onscreen_native->pending_page_flip_retries,
(GDestroyNotify) retry_page_flip_data_free);
- g_clear_pointer (&onscreen_native->retry_page_flips_source,
- g_source_destroy);
+ if (onscreen_native->retry_page_flips_source)
+ {
+ MetaBackend *backend =
+ backend_from_renderer_native (onscreen_native->renderer_native);
+
+ meta_backend_thaw_updates (backend);
+ g_clear_pointer (&onscreen_native->retry_page_flips_source,
+ g_source_destroy);
+ }
if (onscreen_egl->egl_surface != EGL_NO_SURFACE)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]