summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-08-31 23:29:00 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-08-31 23:58:39 +0100
commit9a563ea03b6ad87d41bc091c5819e6c462100450 (patch)
tree93811655cfe4456247978dc652a5339dc0c0ff9a
parent32fc0c896e0dfd06617c12beda1ccacedf69fb4a (diff)
sna: Use the shadow buffer for PutImage
This is optimising for the x11perf putimage benchmark, but nevertheless, uploading the PutImage directly into the uncached scanout is between 2-20x slower than making a temporary copy in the shaodw buffer and doing a deferred update. Most of the overhead is in the kernel, and should be addressed there (rather than worked around) and a portion is due to the overdraw in the benchmark (which is not likely to be realistic, but then again neither should PutImage be!). The argument for uploading inplace when possible is that given that the buffer already exists on the GPU implies that is likely to be used again in future by the GPU and so we will be uploading it at some point. Deferring that upload incurs an extra copy. The putimage benchmark does not actually use the pixel data and so that extra cost is not being measured. Reported-by: Michael Larabel <Michael@phoronix.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 7edff77d..41da5737 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -991,12 +991,16 @@ sna_put_image_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
return sna_put_image_upload_blt(drawable, gc, region,
x, y, w, h, bits, stride);
if (gc->alu != GXcopy)
return false;
+ /* XXX performing the upload inplace is currently about 20x slower
+ * for putimage10 on gen6 -- mostly due to slow page faulting in kernel.
+ */
+#if 0
if (priv->gpu_bo->rq == NULL &&
sna_put_image_upload_blt(drawable, gc, region,
x, y, w, h, bits, stride)) {
if (region_subsumes_drawable(region, &pixmap->drawable)) {
sna_damage_destroy(&priv->cpu_damage);
sna_damage_all(&priv->gpu_damage,
@@ -1007,12 +1011,13 @@ sna_put_image_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
sna_damage_subtract(&priv->cpu_damage, region);
sna_damage_add(&priv->gpu_damage, region);
}
return true;
}
+#endif
if (priv->cpu_bo)
kgem_bo_sync(&sna->kgem, priv->cpu_bo, true);
if (region_subsumes_drawable(region, &pixmap->drawable)) {
sna_damage_destroy(&priv->gpu_damage);