[PATCH] shadow: Optimize shadowUpdatePacked(). (#26973)

Adam Jackson ajax at redhat.com
Wed Sep 22 07:19:56 PDT 2010


On Tue, 2010-09-21 at 10:29 -0400, Matt Turner wrote:
> On Sat, Sep 11, 2010 at 5:55 PM, Matt Turner <mattst88 at gmail.com> wrote:
> > diff --git a/miext/shadow/shpacked.c b/miext/shadow/shpacked.c
> > index 20d2ea1..06606bc 100644
> > --- a/miext/shadow/shpacked.c
> > +++ b/miext/shadow/shpacked.c
> > @@ -102,8 +102,8 @@ shadowUpdatePacked (ScreenPtr           pScreen,
> >                width -= i;
> >                scr += i;
> >  #define PickBit(a,i)   (((a) >> (i)) & 1)
> > -               while (i--)
> > -                   *win++ = *sha++;
> > +               memcpy(win, sha, i * sizeof(FbBits));
> > +               sha += i;
> >            }
> >            shaLine += shaStride;
> >            y++;
> > --
> > 1.7.1
> 
> So, do we want this patch?
> 
> It seems like it does deobfuscate the code a bit, and memcpy is going
> to be more efficient than byte-by-byte copies.

I think this is okay as long as we have the invariant that the shadow
and the shadowed are not allowed to have aliased storage.  Which seems
entirely reasonable, so, yeah, we should take this.

In related news, we never fixed this:

http://lists.freedesktop.org/archives/xorg/2010-February/049026.html

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100922/0aa562b1/attachment.pgp>


More information about the xorg-devel mailing list