summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-07-04 10:43:35 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-07-04 10:44:04 +0100
commit821ef20b27f84cc26aec266b0f616a7f39ba9e3d (patch)
tree01c978ba26e4f5688c21529b0c2e2a497dbde0f7
parentc6407f7380829f822a462100d26bc531aed0fd6f (diff)
sna: Promote tile pixmaps to GPU when reused
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 0475f1eb..9191fe2f 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -11938,6 +11938,7 @@ static struct kgem_bo *
sna_pixmap_get_source_bo(PixmapPtr pixmap)
{
struct sna_pixmap *priv = sna_pixmap(pixmap);
+ unsigned flags;
BoxRec box;
box.x1 = box.y1 = 0;
@@ -11968,7 +11969,18 @@ sna_pixmap_get_source_bo(PixmapPtr pixmap)
return kgem_bo_reference(priv->cpu_bo);
}
- if (!sna_pixmap_move_to_gpu(pixmap, MOVE_READ | MOVE_ASYNC_HINT)) {
+ flags = MOVE_READ | MOVE_ASYNC_HINT;
+ if (priv->gpu_bo && priv->gpu_bo->proxy) {
+ struct kgem_bo *bo = priv->gpu_bo;
+ if (bo->rq == NULL && (bo->snoop || bo->pitch >= 4096))
+ flags |= __MOVE_FORCE;
+ }
+ if (priv->gpu_bo == NULL) {
+ if (++priv->source_count > SOURCE_BIAS)
+ flags |= __MOVE_FORCE;
+ }
+
+ if (!sna_pixmap_move_to_gpu(pixmap, flags)) {
struct kgem_bo *upload;
if (!sna_pixmap_move_to_cpu(pixmap, MOVE_READ))