diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-22 20:07:38 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-22 22:41:49 +0100 |
commit | b315e0ebb75d8391ebef7ebe53741a5e33c968bb (patch) | |
tree | c02a9f39566be83dd4db5f7b838ef56cb983939b | |
parent | 8acaf2693e176a92993a498683f121cfe0343fd4 (diff) |
sna: Tweak the fallback hints for XYPixmap PutImage
As the fallback uses a multiple-pass algorithm updating one plane at a
time, we wish to prepare the fallback surface for reads.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index e8810515..5f14f4e5 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -3698,6 +3698,7 @@ sna_put_image(DrawablePtr drawable, GCPtr gc, int depth, struct sna_pixmap *priv = sna_pixmap(pixmap); RegionRec region; int16_t dx, dy; + unsigned hint; DBG(("%s((%d, %d)x(%d, %d), depth=%d, format=%d)\n", __FUNCTION__, x, y, w, h, depth, format)); @@ -3726,39 +3727,47 @@ sna_put_image(DrawablePtr drawable, GCPtr gc, int depth, if (priv == NULL) { DBG(("%s: fallback -- unattached(%d, %d, %d, %d)\n", __FUNCTION__, x, y, w, h)); +hint_and_fallback: + hint = (format == XYPixmap ? + MOVE_READ | MOVE_WRITE : + drawable_gc_flags(drawable, gc, false)); goto fallback; } RegionTranslate(®ion, dx, dy); if (FORCE_FALLBACK) - goto fallback; + goto hint_and_fallback; if (wedged(sna)) - goto fallback; + goto hint_and_fallback; if (!ACCEL_PUT_IMAGE) - goto fallback; + goto hint_and_fallback; switch (format) { case ZPixmap: if (!PM_IS_SOLID(drawable, gc->planemask)) - goto fallback; + goto hint_and_fallback; if (sna_put_zpixmap_blt(drawable, gc, ®ion, x, y, w, h, bits, PixmapBytePad(w, depth))) return; + + hint = drawable_gc_flags(drawable, gc, false); break; case XYBitmap: if (!PM_IS_SOLID(drawable, gc->planemask)) - goto fallback; + goto hint_and_fallback; if (sna_put_xybitmap_blt(drawable, gc, ®ion, x, y, w, h, bits)) return; + + hint = drawable_gc_flags(drawable, gc, false); break; case XYPixmap: @@ -3766,10 +3775,12 @@ sna_put_image(DrawablePtr drawable, GCPtr gc, int depth, x, y, w, h, left, bits)) return; + + hint = MOVE_READ | MOVE_WRITE; break; default: - break; + return; } fallback: @@ -3778,8 +3789,7 @@ fallback: if (!sna_gc_move_to_cpu(gc, drawable, ®ion)) goto out; - if (!sna_drawable_move_region_to_cpu(drawable, ®ion, - drawable_gc_flags(drawable, gc, false))) + if (!sna_drawable_move_region_to_cpu(drawable, ®ion, hint)) goto out_gc; DBG(("%s: fbPutImage(%d, %d, %d, %d)\n", |