summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-02-20 13:38:11 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-02-20 13:38:11 +0000
commitb68b76cf54a322e80685f1ec93538cd6c5813ea4 (patch)
treedc3652cbe5f11662cce6737c76bdfe8ad560e5f2
parentbbb6794a3b97b1fcf72c8712ab0ec591683b128b (diff)
sna: Move sync'ing of CPU bo after allocation to first write
The idea was that we could afford to allocate an active CPU bo for copying to from using the GPU and later sync just before we need to write to the shadow pixels. Having the sync inside the allocation function potentially causes an unwanted stall. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index ab44cf35..aab85d85 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -321,10 +321,8 @@ sna_pixmap_alloc_cpu(struct sna *sna,
if (priv->ptr == NULL) {
kgem_bo_destroy(&sna->kgem, priv->cpu_bo);
priv->cpu_bo = NULL;
- } else {
- kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo);
+ } else
priv->stride = priv->cpu_bo->pitch;
- }
}
}
@@ -2599,6 +2597,11 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
DBG(("%s: applying clear [%08x]\n",
__FUNCTION__, priv->clear_color));
+ if (priv->cpu_bo) {
+ DBG(("%s: syncing CPU bo\n", __FUNCTION__));
+ kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo);
+ }
+
pixman_fill(pixmap->devPrivate.ptr,
pixmap->devKind/sizeof(uint32_t),
pixmap->drawable.bitsPerPixel,