diff options
author | Dave Airlie <airlied@redhat.com> | 2016-03-10 11:49:26 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2020-02-04 16:05:52 +1000 |
commit | f79c02dc63f4c2f32f912ef21a74c3887d4e0aeb (patch) | |
tree | c53995445d954221f737da231217343df42636a2 | |
parent | 1967af293370dcb35dd32595ebbc0a5e5e7e6e84 (diff) |
glamor: use write only for putimage in some cases (v2)fix-zaphod-error
Ilia pointed out that xlock -mode wator is slow, this speeds it
up by avoiding the ReadPixels on every frame.
The current criteria for putimage is
a) ALU copy operation
b) planemask all set
c) region is contained inside pCompositeClip
v2: check for rgnIN (Peter Harris)
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | glamor/glamor_image.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/glamor/glamor_image.c b/glamor/glamor_image.c index 453ef79ba..bf77a9e89 100644 --- a/glamor/glamor_image.c +++ b/glamor/glamor_image.c @@ -88,7 +88,19 @@ static void glamor_put_image_bail(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, int w, int h, int leftPad, int format, char *bits) { - if (glamor_prepare_access_box(drawable, GLAMOR_ACCESS_RW, x, y, w, h)) + int access = GLAMOR_ACCESS_RW; + + if (gc->alu == GXcopy && glamor_pm_is_solid(gc->depth, gc->planemask)) { + BoxRec box; + box.x1 = x; + box.y1 = y; + box.x2 = x + w; + box.y2 = y + h; + + if (RegionContainsRect(gc->pCompositeClip, &box) == rgnIN) + access = GLAMOR_ACCESS_WO; + } + if (glamor_prepare_access_box(drawable, access, x, y, w, h)) fbPutImage(drawable, gc, depth, x, y, w, h, leftPad, format, bits); glamor_finish_access(drawable); } |