[PATCH] Make EXA more robust in absense of Copy and Solid hooks

Eric Anholt eric at anholt.net
Mon May 28 09:51:23 PDT 2007


On Sun, 2007-05-27 at 22:17 -0400, Bernardo Innocenti wrote:
> In a few places, the generic EXA layer assumed that the
> driver provides acceleration callbacks for the Copy and
> Solid operations.  I ran into this by disabling the
> hooks to debug a driver.

The documentation of those hooks states that they are required to be
present.  If you want to disable your acceleration, you just return
false from the hook.

> Signed-off-by: Bernardo Innocenti <bernie at codewiz.org>
> ---
>  exa/exa_accel.c |   11 +++++++++--
>  1 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/exa/exa_accel.c b/exa/exa_accel.c
> index bf63f2c..1b9f6a6 100644
> --- a/exa/exa_accel.c
> +++ b/exa/exa_accel.c
> @@ -410,6 +410,9 @@ exaCopyNtoN (DrawablePtr    pSrcDrawable,
>  	exaDoMigration (pixmaps, 2, TRUE);
>      }
>  
> +    if (!pExaScr->info->PrepareCopy)
> +	fallback = TRUE;
> +
>      /* Mixed directions must be handled specially if the card is lame */
>      if (!fallback && (pExaScr->info->flags & EXA_TWO_BITBLT_DIRECTIONS) &&
>  	reverse != upsidedown) {
> @@ -1092,8 +1095,9 @@ exaFillRegionSolid (DrawablePtr	pDrawable,
>      pixmaps[0].as_dst = TRUE;
>      pixmaps[0].as_src = FALSE;
>      pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable);
> - 
> -    if (pPixmap->drawable.width > pExaScr->info->maxX ||
> +
> +    if (!pExaScr->info->Solid ||
> +	pPixmap->drawable.width  > pExaScr->info->maxX ||
>  	pPixmap->drawable.height > pExaScr->info->maxY)
>      {
>  	goto fallback;
> @@ -1186,6 +1190,9 @@ exaFillRegionTiled (DrawablePtr	pDrawable,
>      if (!exaPixmapIsOffscreen(pTile))
>  	goto fallback;
>  
> +    if (!pExaScr->info->PrepareCopy)
> +	goto fallback;
> +
>      if ((*pExaScr->info->PrepareCopy) (exaGetOffscreenPixmap((DrawablePtr)pTile,
>  							     &tileXoff, &tileYoff),
>  				       pPixmap, 0, 0, alu, planemask))
> -- 
> 1.5.0.6
> 
-- 
Eric Anholt                             anholt at FreeBSD.org
eric at anholt.net                         eric.anholt at intel.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20070528/8a8749ca/attachment.pgp>


More information about the xorg mailing list