mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-29 18:10:23 +01:00
st/xorg: Flesh out EXA PrepareComposite hook a little.
Check that the formats are supported, and don't crash with source-only pictures.
This commit is contained in:
parent
b97547027e
commit
ac2e0ddcd8
1 changed files with 28 additions and 2 deletions
|
|
@ -438,17 +438,43 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture,
|
|||
ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
|
||||
modesettingPtr ms = modesettingPTR(pScrn);
|
||||
struct exa_context *exa = ms->exa;
|
||||
struct exa_pixmap_priv *priv;
|
||||
|
||||
debug_printf("ExaPrepareComposite\n");
|
||||
|
||||
priv = exaGetPixmapDriverPrivate(pDst);
|
||||
if (!priv || !priv->tex ||
|
||||
!exa->scrn->is_format_supported(exa->scrn, priv->tex->format,
|
||||
priv->tex->target,
|
||||
PIPE_TEXTURE_USAGE_RENDER_TARGET, 0))
|
||||
return FALSE;
|
||||
|
||||
if (pSrc) {
|
||||
priv = exaGetPixmapDriverPrivate(pSrc);
|
||||
if (!priv || !priv->tex ||
|
||||
!exa->scrn->is_format_supported(exa->scrn, priv->tex->format,
|
||||
priv->tex->target,
|
||||
PIPE_TEXTURE_USAGE_SAMPLER, 0))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (pMask) {
|
||||
priv = exaGetPixmapDriverPrivate(pMask);
|
||||
if (!priv || !priv->tex ||
|
||||
!exa->scrn->is_format_supported(exa->scrn, priv->tex->format,
|
||||
priv->tex->target,
|
||||
PIPE_TEXTURE_USAGE_SAMPLER, 0))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if DISABLE_ACCEL
|
||||
(void) exa;
|
||||
return FALSE;
|
||||
#else
|
||||
return xorg_composite_bind_state(exa, op, pSrcPicture, pMaskPicture,
|
||||
pDstPicture,
|
||||
exaGetPixmapDriverPrivate(pSrc),
|
||||
exaGetPixmapDriverPrivate(pMask),
|
||||
pSrc ? exaGetPixmapDriverPrivate(pSrc) : NULL,
|
||||
pMask ? exaGetPixmapDriverPrivate(pMask) : NULL,
|
||||
exaGetPixmapDriverPrivate(pDst));
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue