[PATCH 4/4] exa: a few small pitch related changes

Michel Dänzer michel at daenzer.net
Fri Nov 27 02:32:55 PST 2009


On Mon, 2009-11-23 at 22:17 +0100, Maarten Maathuis wrote: 
> - Setting pitch before exaCopyDirty* is not needed.

Hmm, I thought it was at least at some point, that's why I added
those... But your patch seems to work fine for me with mixed pixmaps, so
the parts specific to those seem fine.


> diff --git a/exa/exa.c b/exa/exa.c
> index 023288c..16f39f6 100644
> --- a/exa/exa.c
> +++ b/exa/exa.c
> @@ -323,10 +323,17 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
>  
>      has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
>  
> -    if (has_gpu_copy && pExaPixmap->fb_ptr)
> +    if (has_gpu_copy) {
> +	/* This can be NULL, but the driver prepareAccess call should
> +	 * take care of that. */
>  	pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr;
> -    else
> +	pPixmap->devKind = pExaPixmap->fb_pitch;
> +    } else {
> +	/* For mixed pixmaps this can be NULL, but that will be fixed
> +	 * later in exaPrepareAccessReg_mixed(). */
>  	pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
> +	pPixmap->devKind = pExaPixmap->sys_pitch;
> +    }

However, I'm a little concerned about this part, as it also affects the
other schemes. E.g. a classic driver may not have a PrepareAccess hook
at all.


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


More information about the xorg-devel mailing list