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>
This commit is contained in:
Chris Wilson 2012-07-22 20:07:38 +01:00
parent 8acaf2693e
commit b315e0ebb7
1 changed files with 18 additions and 8 deletions

View File

@ -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(&region, 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, &region,
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, &region,
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, &region))
goto out;
if (!sna_drawable_move_region_to_cpu(drawable, &region,
drawable_gc_flags(drawable, gc, false)))
if (!sna_drawable_move_region_to_cpu(drawable, &region, hint))
goto out_gc;
DBG(("%s: fbPutImage(%d, %d, %d, %d)\n",