On 11.03.2016 10:17, Dave Airlie wrote: > From: Dave Airlie <[email protected]> > > 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 > > Signed-off-by: Dave Airlie <[email protected]> > --- > glamor/glamor_image.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/glamor/glamor_image.c b/glamor/glamor_image.c > index 3158749..a190d3e 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)) > + 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); > } >
Instead of bailing if the box isn't fully contained in gc->pCompositeClip, how about looping over the rects of the intersection of the two? -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
