From f9451aaa39e1d77b08d2201f5c4a44ab834f2237 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 5 Jan 2012 14:22:21 +0000 Subject: [PATCH] sna: Mark the upload as having acquired the GTT mapping In order for the entire PutImage to be performed inplace, we need to maintain the tendency to keep doing inplace operations. This hint is provided by tracking whether or not the last operation used the GTT mapping. However, that hint was not being provided by zpixmap_blt. Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 396dd9c5..b14d2e96 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1901,6 +1901,14 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region, sna_damage_add(&priv->gpu_damage, region); } + /* And mark as having a valid GTT mapping for future uploads */ + pixmap->devPrivate.ptr = + kgem_bo_map(&sna->kgem, priv->gpu_bo, PROT_WRITE); + if (pixmap->devPrivate.ptr) { + priv->mapped = 1; + pixmap->devKind = priv->gpu_bo->pitch; + } + return true; }