[patch] exa: fix pitch handling in ModifyPixmapHeader

Tilman Sauerbeck tilman at code-monkey.de
Thu Apr 17 07:34:10 PDT 2008


Zhenyu Wang [2008-04-17 17:23]:

Hi,

> ---
> diff --git a/exa/exa.c b/exa/exa.c
> index 81dc3e2..3369c3a 100644
> --- a/exa/exa.c
> +++ b/exa/exa.c
> @@ -386,6 +386,9 @@ exaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
>      if (pExaPixmap) {
>  	pExaPixmap->sys_ptr = pPixData;
>  
> +	if (pExaPixmap->fb_pitch == 0)
> +	    pExaPixmap->fb_pitch = devKind;
> +
>          exaSetAccelBlock(pExaScr, pExaPixmap,
>                           width, height, bitsPerPixel);
>      }

Shouldn't we set fb_pitch even if the current value isn't zero?
Shouldn't we also set sys_pitch = devKind?

As far as I understand that code, resizing a pixmap to be bigger may
result in a larger pitch, so not updating it might leave us with a bogus
value in the ExaPixmapPriv.

Regards,
Tilman

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20080417/a9b72251/attachment.pgp>


More information about the xorg mailing list