[PATCH:xf86-video-mach64] Mach64PixelARGB should use exaGetPixmapFirstPixel when EXA is in use

Michel Dänzer michel at daenzer.net
Fri Dec 7 01:34:50 PST 2012


On Don, 2012-12-06 at 16:57 -0800, Alan Coopersmith wrote: 
> Fixes crash attempting to read a pixel from a NULL pPixmap->devPrivate.ptr
> 
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
>  src/atimach64render.c |   33 +++++++++++++++++++++------------
>  1 file changed, 21 insertions(+), 12 deletions(-)
> 
> Mostly just cut-and-paste and guess-and-hope, but it seems to work and stops
> the crash for me.
> 
> diff --git a/src/atimach64render.c b/src/atimach64render.c
> index 4862cd4..1328cca 100644
> --- a/src/atimach64render.c
> +++ b/src/atimach64render.c
> @@ -208,22 +208,31 @@ Mach64PixelARGB(PixmapPtr pPixmap, CARD32 format, CARD32 *argb)
>      CARD32 pixel;
>      CARD8  comp;
>      int    bits, shift;
> +#ifdef USE_EXA
> +    ScrnInfoPtr pScreenInfo = xf86ScreenToScrn(pPixmap->drawable.pScreen);
> +    ATIPtr pATI = ATIPTR(pScreenInfo);
> +#endif
>  
>      /* Ensure that texture drawing has completed. */
>      exaWaitSync(pPixmap->drawable.pScreen);

This call shouldn't be necessary anymore.

Also, this whole file is only compiled for EXA, so you don't need to
check for EXA or keep any non-EXA code paths.


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the xorg-devel mailing list