[mutter] renderer-native: Advertise _FEATURE_SWAP_THROTTLE
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] renderer-native: Advertise _FEATURE_SWAP_THROTTLE
- Date: Fri, 23 Nov 2018 11:06:27 +0000 (UTC)
commit e8c27603dd69d94793aed5e0525562669e8c0bca
Author: Daniel van Vugt <daniel van vugt canonical com>
Date: Tue Jul 10 17:46:02 2018 +0800
renderer-native: Advertise _FEATURE_SWAP_THROTTLE
Because it is implemented and always on. By advertising this fact
the master clock is able to sync to the native refresh rate instead
of always using the fallback of 60.00Hz.
https://bugzilla.gnome.org/show_bug.cgi?id=781296
src/backends/native/meta-renderer-native.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index 768c70e1c..96afdc4d1 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -2082,6 +2082,13 @@ meta_renderer_native_init_egl_context (CoglContext *cogl_context,
COGL_WINSYS_FEATURE_MULTIPLE_ONSCREEN,
TRUE);
+ /* COGL_WINSYS_FEATURE_SWAP_THROTTLE is always true for this renderer
+ * because we have the call to wait_for_pending_flips on every frame.
+ */
+ COGL_FLAGS_SET (cogl_context->winsys_features,
+ COGL_WINSYS_FEATURE_SWAP_THROTTLE,
+ TRUE);
+
#ifdef HAVE_EGL_DEVICE
if (renderer_gpu_data->mode == META_RENDERER_NATIVE_MODE_EGL_DEVICE)
COGL_FLAGS_SET (cogl_context->features,
@@ -2717,8 +2724,12 @@ meta_renderer_native_create_onscreen (MetaRendererNative *renderer_native,
}
onscreen = cogl_onscreen_new (context, width, height);
- cogl_onscreen_set_swap_throttled (onscreen,
- _clutter_get_sync_to_vblank ());
+
+ /* We have wait_for_pending_flips hardcoded, so throttling always. */
+ cogl_onscreen_set_swap_throttled (onscreen, TRUE);
+ if (!_clutter_get_sync_to_vblank ())
+ g_warning ("Request to disable sync-to-vblank is being ignored. "
+ "MetaRendererNative does not support disabling it.");
if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (onscreen), error))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]