sna: Decrease latency for 1x1 GetImage by using an inplace mapping

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-06-16 17:54:21 +01:00
parent 2c2a8d3780
commit 79d468925b
1 changed files with 6 additions and 2 deletions

View File

@ -11982,8 +11982,9 @@ sna_get_image(DrawablePtr drawable,
char *dst)
{
RegionRec region;
unsigned int flags;
DBG(("%s (%d, %d, %d, %d)\n", __FUNCTION__, x, y, w, h));
DBG(("%s (%d, %d)x(%d, %d)\n", __FUNCTION__, x, y, w, h));
region.extents.x1 = x + drawable->x;
region.extents.y1 = y + drawable->y;
@ -11991,7 +11992,10 @@ sna_get_image(DrawablePtr drawable,
region.extents.y2 = region.extents.y1 + h;
region.data = NULL;
if (!sna_drawable_move_region_to_cpu(drawable, &region, MOVE_READ))
flags = MOVE_READ;
if ((w | h) == 1)
flags |= MOVE_INPLACE_HINT;
if (!sna_drawable_move_region_to_cpu(drawable, &region, flags))
return;
if (format == ZPixmap &&