From 79d468925bb012806e097337e4e5930818c6ab46 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 16 Jun 2012 17:54:21 +0100 Subject: [PATCH] sna: Decrease latency for 1x1 GetImage by using an inplace mapping Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 3c17d752..85db9193 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -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, ®ion, MOVE_READ)) + flags = MOVE_READ; + if ((w | h) == 1) + flags |= MOVE_INPLACE_HINT; + if (!sna_drawable_move_region_to_cpu(drawable, ®ion, flags)) return; if (format == ZPixmap &&