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>
This commit is contained in:
parent
bbb6794a3b
commit
b68b76cf54
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue