[PATCH 3/3] exa/mixed: pixmaps that succeed prepare access have no need for a cpu copy

Michel Dänzer michel at daenzer.net
Thu Dec 3 00:27:12 PST 2009


On Wed, 2009-12-02 at 20:24 +0100, Maarten Maathuis wrote: 
> - When they have a gpu copy ofcource.
> - Use the presence of a cpu copy as a hint to fall back instead of UTS'ing in
> exaHWCopyNtoN.
> 
> Signed-off-by: Maarten Maathuis <madman2003 at gmail.com>

Thanks for tackling this!


> diff --git a/exa/exa_accel.c b/exa/exa_accel.c
> index 1d88acb..e17021e 100644
> --- a/exa/exa_accel.c
> +++ b/exa/exa_accel.c
> @@ -508,9 +508,13 @@ exaHWCopyNtoN (DrawablePtr    pSrcDrawable,
>  	 *
>  	 * Not taking this path for mixed pixmaps: It could only save one CPU
>  	 * copy between cached memory and risks causing a more expensive
> -	 * DownloadFromScreen later on.
> +	 * DownloadFromScreen later on. This applies only to the situation where
> +	 * the driver prefers DFS, in that case PrepareAccess is failed.
> +	 * In situations where a gpu pixmap is directly accessable, pDamage and
> +	 * sys_ptr is NULL.

This whole paragraph could be simplified to something like

	 * Only taking this path for directly accessible pixmaps.

> -	} else if (!(pExaScr->info->flags & EXA_MIXED_PIXMAPS)) {
> +	} else if (!(pExaScr->info->flags & EXA_MIXED_PIXMAPS) ||
> +		!pDstExaPixmap->pDamage) {

And this to

	} else if (!pDstExaPixmap->pDamage) {

(Or at the very least, the indentation of the added line would need to
be fixed)


> diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c
> index 274fde3..5970de6 100644
> --- a/exa/exa_migration_mixed.c
> +++ b/exa/exa_migration_mixed.c
> @@ -202,6 +203,22 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
>  	pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
>  	pPixmap->devKind = pExaPixmap->sys_pitch;
>  	pExaPixmap->use_gpu_copy = FALSE;
> +    /* We have a gpu pixmap that can be accessed, we don't need the cpu copy
> +     * anymore. Drivers that prefer DFS, should fail prepare access. */
> +    } else if (pExaPixmap->pDamage && exaPixmapHasGpuCopy(pPixmap)) {
> +	    ExaScreenPriv(pPixmap->drawable.pScreen);
> +
> +	    /* Copy back any deferred content if needed. */
> +	    if (pExaScr->deferred_mixed_pixmap &&
> +		    pExaScr->deferred_mixed_pixmap == pPixmap)
> +		    exaMoveInPixmap_mixed(pPixmap);

Wrong indentation.


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


More information about the xorg-devel mailing list