MFC: fixes crashes on r600 with cairo 0.10.

Tested by espie@ and brad@

commit 78fcbf577ad6eba6399cc39f74b7ce5f9c8e265e
Author: Michel Daenzer <daenzer@vmware.com>
Date:   Thu Sep 3 14:55:05 2009 +0200

    EXA: Check for solid/gradient pictures the same way for all generations.

    In particular, also catch them for >= R300.

commit 87d7235790866f9c19ef08972d5237f09d940cd9
Author: Alex Deucher <alexdeucher@gmail.com>
Date:   Thu Nov 5 10:23:03 2009 -0500

    EXA: fallback if no pMaskPicture->pDrawable

    A solid or gradient mask could be used for blending
    the source picture onto the destination picture.

    Fixes fdo bug 24838
This commit is contained in:
matthieu 2010-10-17 10:31:04 +00:00
parent 66fbac58e1
commit dd9a6776e6
2 changed files with 32 additions and 6 deletions

View File

@ -1311,6 +1311,9 @@ static Bool R600CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskP
if (op >= (int) (sizeof(R600BlendOp) / sizeof(R600BlendOp[0]))) if (op >= (int) (sizeof(R600BlendOp) / sizeof(R600BlendOp[0])))
RADEON_FALLBACK(("Unsupported Composite op 0x%x\n", op)); RADEON_FALLBACK(("Unsupported Composite op 0x%x\n", op));
if (!pSrcPicture->pDrawable)
RADEON_FALLBACK(("Solid or gradient pictures not supported yet\n"));
pSrcPixmap = RADEONGetDrawablePixmap(pSrcPicture->pDrawable); pSrcPixmap = RADEONGetDrawablePixmap(pSrcPicture->pDrawable);
max_tex_w = 8192; max_tex_w = 8192;
@ -1335,7 +1338,12 @@ static Bool R600CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskP
} }
if (pMaskPicture) { if (pMaskPicture) {
PixmapPtr pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable); PixmapPtr pMaskPixmap;
if (!pMaskPicture->pDrawable)
RADEON_FALLBACK(("Solid or gradient pictures not supported yet\n"));
pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable);
if (pMaskPixmap->drawable.width >= max_tex_w || if (pMaskPixmap->drawable.width >= max_tex_w ||
pMaskPixmap->drawable.height >= max_tex_h) { pMaskPixmap->drawable.height >= max_tex_h) {

View File

@ -478,7 +478,7 @@ static Bool R100CheckComposite(int op, PicturePtr pSrcPicture,
RADEON_FALLBACK(("Unsupported Composite op 0x%x\n", op)); RADEON_FALLBACK(("Unsupported Composite op 0x%x\n", op));
if (!pSrcPicture->pDrawable) if (!pSrcPicture->pDrawable)
return FALSE; RADEON_FALLBACK(("Solid or gradient pictures not supported yet\n"));
/* r100 limit should be 2048, there are issues with 2048 /* r100 limit should be 2048, there are issues with 2048
* see 197a62704742a4a19736c2637ac92d1dc5ab34ed * see 197a62704742a4a19736c2637ac92d1dc5ab34ed
@ -503,7 +503,12 @@ static Bool R100CheckComposite(int op, PicturePtr pSrcPicture,
} }
if (pMaskPicture) { if (pMaskPicture) {
PixmapPtr pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable); PixmapPtr pMaskPixmap;
if (!pMaskPicture->pDrawable)
RADEON_FALLBACK(("Solid or gradient pictures not supported yet\n"));
pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable);
if (pMaskPixmap->drawable.width > 2047 || if (pMaskPixmap->drawable.width > 2047 ||
pMaskPixmap->drawable.height > 2047) { pMaskPixmap->drawable.height > 2047) {
@ -804,7 +809,7 @@ static Bool R200CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskP
TRACE; TRACE;
if (!pSrcPicture->pDrawable) if (!pSrcPicture->pDrawable)
return FALSE; RADEON_FALLBACK(("Solid or gradient pictures not supported yet\n"));
/* r200 limit should be 2048, there are issues with 2048 /* r200 limit should be 2048, there are issues with 2048
* see bug 19269 * see bug 19269
@ -829,7 +834,12 @@ static Bool R200CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskP
} }
if (pMaskPicture) { if (pMaskPicture) {
PixmapPtr pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable); PixmapPtr pMaskPixmap;
if (!pMaskPicture->pDrawable)
RADEON_FALLBACK(("Solid or gradient pictures not supported yet\n"));
pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable);
if (pMaskPixmap->drawable.width > 2047 || if (pMaskPixmap->drawable.width > 2047 ||
pMaskPixmap->drawable.height > 2047) { pMaskPixmap->drawable.height > 2047) {
@ -1178,6 +1188,9 @@ static Bool R300CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskP
if (op >= sizeof(RadeonBlendOp) / sizeof(RadeonBlendOp[0])) if (op >= sizeof(RadeonBlendOp) / sizeof(RadeonBlendOp[0]))
RADEON_FALLBACK(("Unsupported Composite op 0x%x\n", op)); RADEON_FALLBACK(("Unsupported Composite op 0x%x\n", op));
if (!pSrcPicture->pDrawable)
RADEON_FALLBACK(("Solid or gradient pictures not supported yet\n"));
pSrcPixmap = RADEONGetDrawablePixmap(pSrcPicture->pDrawable); pSrcPixmap = RADEONGetDrawablePixmap(pSrcPicture->pDrawable);
if (IS_R500_3D) { if (IS_R500_3D) {
@ -1209,7 +1222,12 @@ static Bool R300CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskP
} }
if (pMaskPicture) { if (pMaskPicture) {
PixmapPtr pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable); PixmapPtr pMaskPixmap;
if (!pMaskPicture->pDrawable)
RADEON_FALLBACK(("Solid or gradient pictures not supported yet\n"));
pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable);
if (pMaskPixmap->drawable.width > max_tex_w || if (pMaskPixmap->drawable.width > max_tex_w ||
pMaskPixmap->drawable.height > max_tex_h) { pMaskPixmap->drawable.height > max_tex_h) {