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

Chris Wilson ickle at kemper.freedesktop.org
Fri Sep 26 13:04:37 PDT 2014


 src/sna/sna_display.c |    4 +++-
 src/sna/sna_driver.c  |   14 +++++---------
 2 files changed, 8 insertions(+), 10 deletions(-)

New commits:
commit f785035d5bd42a778d4be0bf3ff8678bd7a7e503
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Sep 26 21:01:43 2014 +0100

    sna: Allow move-to-gpu to fail during ScreenCreateResources
    
    Before we attach the Screen Pixmap to the scanout, we will have to
    create a GPU bo and apply any fixups as required. Therefore failing to
    pre-emptively move it during ScreenCreateResource is not fatal and the
    failure can be simply ignored.
    
    Suggested-by: Egbert Eich <eich at freedesktop.org>
    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 0aa7557..1407e2b 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1625,7 +1625,9 @@ void sna_copy_fbcon(struct sna *sna)
 	assert((sna->flags & SNA_IS_HOSTED) == 0);
 
 	priv = sna_pixmap(sna->front);
-	assert(priv && priv->gpu_bo);
+	assert(priv);
+	if (priv->gpu_bo == NULL)
+		return;
 
 	/* Scan the connectors for a framebuffer and assume that is the fbcon */
 	VG_CLEAR(fbcon);
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 7eed214..14b9c31 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -248,15 +248,11 @@ static Bool sna_create_screen_resources(ScreenPtr screen)
 		return FALSE;
 	}
 
-	if (!sna_pixmap_force_to_gpu(new_front, MOVE_READ)) {
-		xf86DrvMsg(screen->myNum, X_ERROR,
-			   "[intel] Failed to allocate video resources for front buffer %dx%d at depth %d\n",
-			   screen->width,
-			   screen->height,
-			   screen->rootDepth);
-		screen->DestroyPixmap(new_front);
-		return FALSE;
-	}
+	/* Prefer to use the GPU for rendering into the eventual scanout
+	 * bo so that we do not unduly stall when it is time to attach
+	 * it to the CRTCs.
+	 */
+	sna_pixmap_force_to_gpu(new_front, MOVE_READ | __MOVE_SCANOUT);
 
 	screen->SetScreenPixmap(new_front);
 	assert(screen->GetScreenPixmap(screen) == new_front);


More information about the xorg-commit mailing list