[xserver patch] Optimize shadowUpdatePacked()
Ian Romanick
idr at freedesktop.org
Mon Mar 22 11:46:38 PDT 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Adrian Bunk wrote:
> From: Ilpo Ruotsalainen <ilpo.ruotsalainen at movial.com>
>
> http://bugs.freedesktop.org/show_bug.cgi?id=26973
>
> Signed-off-by: Adrian Bunk <adrian.bunk at movial.com>
>
> ---
>
> We already ship this patch in the ARM Linux Internet Platform, and it
> looks like a good candidate for upstream inclusion.
>
> The "#define PickBit" can be deleted, but that's unrelated.
>
> miext/shadow/shpacked.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/miext/shadow/shpacked.c b/miext/shadow/shpacked.c
> index 6736162..f95adf9 100644
> --- a/miext/shadow/shpacked.c
> +++ b/miext/shadow/shpacked.c
> @@ -102,8 +102,7 @@ shadowUpdatePacked (ScreenPtr pScreen,
> width -= i;
> scr += i;
> #define PickBit(a,i) (((a) >> (i)) & 1)
> - while (i--)
> - *win++ = *sha++;
> + memcpy(win, sha, i * sizeof(FbBits));
> }
> shaLine += shaStride;
> y++;
Are the values of "win" and "sha" used later in the code? Are the
regions of memory accessed by "win" and "sha" known to not overlap in a
way that works with the current code but might break with memcpy?
Those are the only two possible issues that I could see from this change.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkunuwwACgkQX1gOwKyEAw9d8wCgggd1YphBD+UTWkpp4zJGWnSH
gtoAnia/p3e2zW85+Ohm2QnMDrrfGA9Y
=uExZ
-----END PGP SIGNATURE-----
More information about the xorg-devel
mailing list