summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-12-28 14:49:38 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-12-28 14:50:44 +0000
commit548d284b8cf8cc2b311efe3287e0ae956738189a (patch)
tree248b1d64c561f151af8233453a46aee3e4836fc0
parent583efd4ba067a0a4319e43ebc18dd81ed9c8db0a (diff)
sna: Skip copying fbcon if we are already on the scanout
If we are already the scanout, then there is little point copying to ourselves... Should be paranoia. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 2f8e6dff..c66bb47d 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -886,6 +886,9 @@ void sna_copy_fbcon(struct sna *sna)
DBG(("%s\n", __FUNCTION__));
+ priv = sna_pixmap(sna->front);
+ assert(priv && priv->gpu_bo);
+
/* Scan the connectors for a framebuffer and assume that is the fbcon */
VG_CLEAR(fbcon);
fbcon.fb_id = 0;
@@ -912,6 +915,11 @@ void sna_copy_fbcon(struct sna *sna)
return;
}
+ if (fbcon.fb_id == priv->gpu_bo->delta) {
+ DBG(("%s: fb already installed as scanout\n", __FUNCTION__));
+ return;
+ }
+
/* Wrap the fbcon in a pixmap so that we select the right formats
* in the render copy in case we need to preserve the fbcon
* across a depth change upon starting X.
@@ -933,9 +941,6 @@ void sna_copy_fbcon(struct sna *sna)
DBG(("%s: fbcon handle=%d\n", __FUNCTION__, bo->handle));
- priv = sna_pixmap(sna->front);
- assert(priv && priv->gpu_bo);
-
sx = dx = 0;
if (box.x2 < (uint16_t)fbcon.width)
sx = (fbcon.width - box.x2) / 2;