xf86-video-intel: 3 commits - src/sna/sna_display.c src/sna/sna_dri2.c src/sna/sna_driver.c src/sna/sna.h

Chris Wilson ickle at kemper.freedesktop.org
Sat May 28 18:27:20 UTC 2016


 src/sna/sna.h         |    5 +++--
 src/sna/sna_display.c |   17 +++++++++++++----
 src/sna/sna_dri2.c    |    3 +--
 src/sna/sna_driver.c  |    2 +-
 4 files changed, 18 insertions(+), 9 deletions(-)

New commits:
commit 4458f1bf8a5cfbed0c4bbe9d968719c47ee0ea7d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat May 28 19:23:38 2016 +0100

    sna: Restore TearFree operation after switching everything off
    
    We give up on TearFree if we ever see an error whilst page flipping (in
    the hope that we can keep displaying via direct use of the scanout).
    With the advent of MST, this can happen simply by the user unplugging a
    dock causing connectors to disappear and if we flip before we see the
    uevent telling us which outputs are disabled, we get an error.
    
    So, lets try and re-enable TearFree on the next opportunity, when all
    the outputs are off and we can rebuild the shadow buffer.
    
    Reported-by: Martin Jørgensen <mkj at gotu.dk>
    References: https://bugs.freedesktop.org/show_bug.cgi?id=96180
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna.h b/src/sna/sna.h
index 664308f..fdfefe1 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -259,8 +259,9 @@ struct sna {
 #define SNA_NO_VSYNC		0x40
 #define SNA_TRIPLE_BUFFER	0x80
 #define SNA_TEAR_FREE		0x100
-#define SNA_FORCE_SHADOW	0x200
-#define SNA_FLUSH_GTT		0x400
+#define SNA_WANT_TEAR_FREE	0x200
+#define SNA_FORCE_SHADOW	0x400
+#define SNA_FLUSH_GTT		0x800
 #define SNA_PERFORMANCE		0x1000
 #define SNA_POWERSAVE		0x2000
 #define SNA_HAS_FLIP		0x10000
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index ce58cc1..9c1d8fd 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -7076,6 +7076,15 @@ sna_crtc_config_notify(ScreenPtr screen)
 	probe_capabilities(sna);
 	sna_present_update(sna);
 
+	/* Allow TearFree to come back on when everything is off */
+	if (!sna->mode.front_active && sna->flags & SNA_WANT_TEAR_FREE) {
+		if ((sna->flags & SNA_TEAR_FREE) == 0)
+			DBG(("%s: enable TearFree next modeset\n",
+			     __FUNCTION__));
+
+		sna->flags |= SNA_TEAR_FREE;
+	}
+
 	sna->mode.dirty = false;
 }
 
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index b245594..fce64ba 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -481,7 +481,7 @@ static bool setup_tear_free(struct sna *sna)
 		from = X_CONFIG;
 
 	if (enable)
-		sna->flags |= SNA_TEAR_FREE;
+		sna->flags |= SNA_WANT_TEAR_FREE | SNA_TEAR_FREE;
 
 done:
 	xf86DrvMsg(sna->scrn->scrnIndex, from, "TearFree %sabled\n",
commit 46ffdf295d161a70459508ef0643d70af66ed990
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun May 22 18:31:50 2016 +0100

    sna/dri2: Avoid chaining swaps across a mode change
    
    If the pixmap on a drawable changes between swap events, just queue a
    normal vblank event rather than chaining up.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 59877e9..dd4598c 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -2792,9 +2792,8 @@ sna_dri2_immediate_blit(struct sna *sna,
 	     get_private(chain->front)->bo->handle, chain->front->name, get_private(chain->front)->bo->active_scanout,
 	     get_private(chain->back)->bo->handle, chain->back->name, get_private(chain->back)->bo->active_scanout));
 
-	if (chain->type == SWAP_COMPLETE) {
+	if (chain->type == SWAP_COMPLETE && chain->front == info->front) {
 		assert(chain->draw == info->draw);
-		assert(chain->front == info->front);
 		assert(chain->client == info->client);
 		assert(chain->event_complete == info->event_complete);
 		assert(chain->event_data == info->event_data);
commit 2205da072943664ba0685630436cb57fc6342b44
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun May 22 18:20:06 2016 +0100

    sna: Display errno when SETCURSOR fails
    
    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 4ddb20e..ce58cc1 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5819,8 +5819,8 @@ sna_show_cursors(ScrnInfoPtr scrn)
 			sna_crtc->cursor = cursor;
 			sna_crtc->last_cursor_size = cursor->size;
 		} else {
-			ERR(("%s: failed to show cursor on CRTC:%d [pipe=%d], disabling hwcursor\n",
-			     __FUNCTION__, sna_crtc_id(crtc), sna_crtc_pipe(crtc)));
+			ERR(("%s: failed to show cursor on CRTC:%d [pipe=%d], disabling hwcursor: errno=%d\n",
+			     __FUNCTION__, sna_crtc_id(crtc), sna_crtc_pipe(crtc), errno));
 			sna->cursor.disable = true;
 		}
 	}
@@ -6051,8 +6051,8 @@ disable:
 					sna_crtc->last_cursor_size = 0;
 			}
 		} else {
-			ERR(("%s: failed to update cursor on CRTC:%d [pipe=%d], disabling hwcursor\n",
-			     __FUNCTION__, sna_crtc_id(crtc), sna_crtc_pipe(crtc)));
+			ERR(("%s: failed to update cursor on CRTC:%d [pipe=%d], disabling hwcursor: errno=%d\n",
+			     __FUNCTION__, sna_crtc_id(crtc), sna_crtc_pipe(crtc), errno));
 			/* XXX How to force switch back to SW cursor?
 			 * Right now we just want until the next cursor image
 			 * change, which is fairly frequent.


More information about the xorg-commit mailing list