[PATCH] exa: Accept scratch pixmaps with offscreen memory as such.

Michel Dänzer michel at daenzer.net
Thu Mar 19 11:23:49 PDT 2009


On Don, 2009-03-19 at 19:10 +0100, Maarten Maathuis wrote:
> 
> -	/* Is this the framebuffer (for classic exa)? */
> -	if (pPixData && pPixData == pExaScr->info->memoryBase) {
> -	    pExaPixmap->fb_ptr = pPixData;
> -	    pExaPixmap->fb_pitch = devKind;
> -	    pExaPixmap->offscreen = TRUE;
> +	/* Classic EXA:
> +	 * - Framebuffer.
> +	 * - Scratch pixmap with offscreen memory.
> +	 */
> +	if (pExaScr->info->memoryBase && pPixData) {

Maybe this block should also be guarded by !EXA_HANDLES_PIXMAPS or
something like that, to prevent it from executing for drivers that
handle pixmap allocation.

> +	    if ((CARD8 *)pPixData >= pExaScr->info->memoryBase &&
> +		(CARD8 *)pPixData < (pExaScr->info->memoryBase + pExaScr->info->memorySize)) {

(pExaScr->info->memoryBase + pExaScr->info->memorySize) could wrap
around to 0, in which case the latter check would always fail.


Also, BTW, please try to keep lines below 80 characters or so.


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


More information about the xorg-devel mailing list