Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/backends/native/meta-kms-impl-simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,13 @@ retry_page_flips (gpointer user_data)
if (ret == -EBUSY)
{
float refresh_rate;
gint64 retry_interval;

refresh_rate = get_cached_crtc_refresh_rate (impl_simple, crtc);
retry_page_flip_data->retry_time_us +=
(uint64_t) (G_USEC_PER_SEC / refresh_rate);
/* On high-refresh displays, retry sooner than a full cycle
* to recover faster from transient EBUSY. */
retry_interval = (gint64) (G_USEC_PER_SEC / refresh_rate) / 2;
retry_page_flip_data->retry_time_us += MAX (retry_interval, 500);
l = l_next;
continue;
}
Expand Down
4 changes: 4 additions & 0 deletions src/compositor/compositor-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
/* Wait 2ms after vblank before starting to draw next frame */
#define META_SYNC_DELAY 2

/* On Wayland the KMS page-flip event already synchronizes rendering;
* a fixed delay consumes too much budget on 120 Hz+. */
#define META_SYNC_DELAY_WAYLAND 0

typedef struct _MetaLaters MetaLaters;

struct _MetaCompositorClass
Expand Down
5 changes: 4 additions & 1 deletion src/compositor/compositor.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,10 @@ meta_compositor_do_manage (MetaCompositor *compositor,
g_signal_connect_after (priv->stage, "after-paint",
G_CALLBACK (after_stage_paint), compositor);

clutter_stage_set_sync_delay (CLUTTER_STAGE (priv->stage), META_SYNC_DELAY);
if (meta_is_wayland_compositor ())
clutter_stage_set_sync_delay (CLUTTER_STAGE (priv->stage), META_SYNC_DELAY_WAYLAND);
else
clutter_stage_set_sync_delay (CLUTTER_STAGE (priv->stage), META_SYNC_DELAY);

priv->window_group = meta_window_group_new (display);
priv->top_window_group = meta_window_group_new (display);
Expand Down