浏览代码

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>
tags/mesa_7_7
Thomas Hellstrom 15 年前
父节点
当前提交
f44f6473e6
共有 1 个文件被更改,包括 22 次插入9 次删除
  1. 22
    9
      src/gallium/state_trackers/xorg/xorg_exa.c

+ 22
- 9
src/gallium/state_trackers/xorg/xorg_exa.c 查看文件

@@ -343,6 +343,9 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg)
#if DEBUG_PRINT
debug_printf("ExaPrepareSolid(0x%x)\n", fg);
#endif
if (!exa->accel)
return FALSE;

if (!exa->pipe)
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));
}

return exa->accel && xorg_solid_bind_state(exa, priv, fg);
return xorg_solid_bind_state(exa, priv, fg);
}

static void
@@ -417,6 +420,10 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
#if DEBUG_PRINT
debug_printf("ExaPrepareCopy\n");
#endif

if (!exa->accel)
return FALSE;

if (!exa->pipe)
XORG_FALLBACK("accle not enabled");

@@ -490,7 +497,7 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
}


return exa->accel;
return TRUE;
}

static void
@@ -598,15 +605,19 @@ ExaCheckComposite(int op,
ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
modesettingPtr ms = modesettingPTR(pScrn);
struct exa_context *exa = ms->exa;
boolean accelerated = xorg_composite_accelerated(op,
pSrcPicture,
pMaskPicture,
pDstPicture);

#if DEBUG_PRINT
debug_printf("ExaCheckComposite(%d, %p, %p, %p) = %d\n",
op, pSrcPicture, pMaskPicture, pDstPicture, accelerated);
#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_pixmap_priv *priv;

if (!exa->accel)
return FALSE;

#if DEBUG_PRINT
debug_printf("ExaPrepareComposite(%d, src=0x%p, mask=0x%p, dst=0x%p)\n",
op, pSrcPicture, pMaskPicture, pDstPicture);
@@ -678,8 +692,7 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture,
render_format_name(pMaskPicture->format));
}

return exa->accel &&
xorg_composite_bind_state(exa, op, pSrcPicture, pMaskPicture,
return xorg_composite_bind_state(exa, op, pSrcPicture, pMaskPicture,
pDstPicture,
pSrc ? exaGetPixmapDriverPrivate(pSrc) : NULL,
pMask ? exaGetPixmapDriverPrivate(pMask) : NULL,

正在加载...
取消
保存