diff options
authorChris Wilson <>2011-08-31 23:29:00 +0100
committerChris Wilson <>2011-08-31 23:58:39 +0100
commit9a563ea03b6ad87d41bc091c5819e6c462100450 (patch)
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 <> Signed-off-by: Chris Wilson <>
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
@@ -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;
if (priv->cpu_bo)
kgem_bo_sync(&sna->kgem, priv->cpu_bo, true);