From af36a4ab78cc0e2a85fa40d442bfb92df75dd217 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 1 Apr 2018 13:13:19 +0100 Subject: [PATCH] sna: Defer submission of the next shadow frame until halfway through Do not immediately post the next shadow flip on completion of the current flips, but instead queue a timer for half way through the next vblank so that try to we keep the additional input-output lag to less than a frame. Signed-off-by: Chris Wilson --- src/sna/sna_display.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index e7bf6cab..becc6061 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -8894,8 +8894,10 @@ static void shadow_flip_handler(struct drm_event_vblank *e, { struct sna *sna = data; - if (!sna->mode.shadow_wait) - sna_mode_redisplay(sna); + sna->timer_active |= 1 << FLUSH_TIMER; + sna->timer_expire[FLUSH_TIMER] = + e->tv_sec * 1000 + e->tv_usec / 1000 + + sna->vblank_interval / 2; } void sna_shadow_set_crtc(struct sna *sna,