summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-09-26 21:01:43 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-09-26 21:01:43 +0100
commitf785035d5bd42a778d4be0bf3ff8678bd7a7e503 (patch)
tree0f73608053b64f993c74b0e57147625e0a402768
parentabc9b3f5753d602da296d50c8769cefb88ec473d (diff)
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@freedesktop.org> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c4
-rw-r--r--src/sna/sna_driver.c14
2 files changed, 8 insertions, 10 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 0aa7557f..1407e2b8 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 7eed2143..14b9c318 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);