st/xorg Fail early if we don't intend to accelerate.

Saves a number of unneeded computations and log noise.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
This commit is contained in:
Thomas Hellstrom 2009-12-08 12:48:56 +01:00
parent 189ee75abb
commit f44f6473e6

View file

@ -343,6 +343,9 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg)
#if DEBUG_PRINT #if DEBUG_PRINT
debug_printf("ExaPrepareSolid(0x%x)\n", fg); debug_printf("ExaPrepareSolid(0x%x)\n", fg);
#endif #endif
if (!exa->accel)
return FALSE;
if (!exa->pipe) if (!exa->pipe)
XORG_FALLBACK("accle not enabled"); XORG_FALLBACK("accle not enabled");
@ -361,7 +364,7 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg)
XORG_FALLBACK("format %s", pf_name(priv->tex->format)); XORG_FALLBACK("format %s", pf_name(priv->tex->format));
} }
return exa->accel && xorg_solid_bind_state(exa, priv, fg); return xorg_solid_bind_state(exa, priv, fg);
} }
static void static void
@ -417,6 +420,10 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
#if DEBUG_PRINT #if DEBUG_PRINT
debug_printf("ExaPrepareCopy\n"); debug_printf("ExaPrepareCopy\n");
#endif #endif
if (!exa->accel)
return FALSE;
if (!exa->pipe) if (!exa->pipe)
XORG_FALLBACK("accle not enabled"); XORG_FALLBACK("accle not enabled");
@ -490,7 +497,7 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
} }
return exa->accel; return TRUE;
} }
static void static void
@ -598,15 +605,19 @@ ExaCheckComposite(int op,
ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
modesettingPtr ms = modesettingPTR(pScrn); modesettingPtr ms = modesettingPTR(pScrn);
struct exa_context *exa = ms->exa; struct exa_context *exa = ms->exa;
boolean accelerated = xorg_composite_accelerated(op,
pSrcPicture,
pMaskPicture,
pDstPicture);
#if DEBUG_PRINT #if DEBUG_PRINT
debug_printf("ExaCheckComposite(%d, %p, %p, %p) = %d\n", debug_printf("ExaCheckComposite(%d, %p, %p, %p) = %d\n",
op, pSrcPicture, pMaskPicture, pDstPicture, accelerated); op, pSrcPicture, pMaskPicture, pDstPicture, accelerated);
#endif #endif
return exa->accel && accelerated;
if (!exa->accel)
return FALSE;
return xorg_composite_accelerated(op,
pSrcPicture,
pMaskPicture,
pDstPicture);
} }
@ -620,6 +631,9 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture,
struct exa_context *exa = ms->exa; struct exa_context *exa = ms->exa;
struct exa_pixmap_priv *priv; struct exa_pixmap_priv *priv;
if (!exa->accel)
return FALSE;
#if DEBUG_PRINT #if DEBUG_PRINT
debug_printf("ExaPrepareComposite(%d, src=0x%p, mask=0x%p, dst=0x%p)\n", debug_printf("ExaPrepareComposite(%d, src=0x%p, mask=0x%p, dst=0x%p)\n",
op, pSrcPicture, pMaskPicture, pDstPicture); op, pSrcPicture, pMaskPicture, pDstPicture);
@ -678,8 +692,7 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture,
render_format_name(pMaskPicture->format)); render_format_name(pMaskPicture->format));
} }
return exa->accel && return xorg_composite_bind_state(exa, op, pSrcPicture, pMaskPicture,
xorg_composite_bind_state(exa, op, pSrcPicture, pMaskPicture,
pDstPicture, pDstPicture,
pSrc ? exaGetPixmapDriverPrivate(pSrc) : NULL, pSrc ? exaGetPixmapDriverPrivate(pSrc) : NULL,
pMask ? exaGetPixmapDriverPrivate(pMask) : NULL, pMask ? exaGetPixmapDriverPrivate(pMask) : NULL,