xf86-video-intel: 2 commits - src/sna/sna_display.c src/sna/sna_driver.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Apr 2 13:14:51 UTC 2018


 src/sna/sna_display.c |    6 ++++--
 src/sna/sna_driver.c  |   19 +++++++++++++------
 2 files changed, 17 insertions(+), 8 deletions(-)

New commits:
commit af36a4ab78cc0e2a85fa40d442bfb92df75dd217
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Apr 1 13:13:19 2018 +0100

    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 <chris at chris-wilson.co.uk>

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,
commit 8f2d08016a12211205bb227296923cdebfcd3c38
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Apr 1 13:10:44 2018 +0100

    sna: Force posting of shadow updates for NotifyFd
    
    The update for ABI 22 and NotifyFd left behind an important flush for
    shadow rendering.
    
    Fixes: 4ab9145c7748 ("Update to ABI 22 and NotifyFd")
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 2643e6c8..2007e354 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -689,7 +689,6 @@ cleanup:
 	return FALSE;
 }
 
-#if !HAVE_NOTIFY_FD
 static bool has_shadow(struct sna *sna)
 {
 	if (!sna->mode.shadow_enabled)
@@ -702,6 +701,7 @@ static bool has_shadow(struct sna *sna)
 	return sna->mode.flip_active == 0;
 }
 
+#if !HAVE_NOTIFY_FD
 static void
 sna_block_handler(BLOCKHANDLER_ARGS_DECL)
 {
@@ -712,8 +712,9 @@ sna_block_handler(BLOCKHANDLER_ARGS_DECL)
 #endif
 	struct timeval **tv = timeout;
 
-	DBG(("%s (tv=%ld.%06ld)\n", __FUNCTION__,
-	     *tv ? (*tv)->tv_sec : -1, *tv ? (*tv)->tv_usec : 0));
+	DBG(("%s (tv=%ld.%06ld), has_shadow?=%d\n", __FUNCTION__,
+	     *tv ? (*tv)->tv_sec : -1, *tv ? (*tv)->tv_usec : 0,
+	     has_shadow(sna)));
 
 	sna->BlockHandler(BLOCKHANDLER_ARGS);
 
@@ -754,12 +755,18 @@ sna_block_handler(void *data, void *_timeout)
 	int *timeout = _timeout;
 	struct timeval tv, *tvp;
 
-	DBG(("%s (timeout=%d)\n", __FUNCTION__, *timeout));
-	if (*timeout == 0)
-		return;
+	DBG(("%s (timeout=%d, has_shadow=%d)\n", __FUNCTION__,
+	     *timeout, has_shadow(sna)));
 
 	if (*timeout < 0) {
 		tvp = NULL;
+	} else if (*timeout == 0) {
+		if (!has_shadow(sna))
+			return;
+
+		tv.tv_sec = 0;
+		tv.tv_usec = 0;
+		tvp = &tv;
 	} else {
 		tv.tv_sec = *timeout / 1000;
 		tv.tv_usec = (*timeout % 1000) * 1000;


More information about the xorg-commit mailing list