summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-08-31 22:29:00 (GMT)
committerChris Wilson <chris@chris-wilson.co.uk>2011-08-31 22:58:39 (GMT)
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 7edff77..41da573 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -994,6 +994,10 @@ sna_put_image_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
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)) {
@@ -1010,6 +1014,7 @@ sna_put_image_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
return true;
}
+#endif
if (priv->cpu_bo)
kgem_bo_sync(&sna->kgem, priv->cpu_bo, true);