- Add two new XAA hooks, SetupForCPUToScreenTexture2 and
SetupForCPUToScreenAlphaTexture2. These add a dstFormat argument after the previous format argument, which the driver needs to use to properly set up the destination format. Two new arrays are added for the list of destination formats supported that correspond to the previous format arrays for sources. - Make Render acceleration only occur when the new hook for that acceleration type is supplied and the dst format list is set, along with the src format list being set. Without knowing the destination format, the Render acceleration couldn't properly support all the destinations it might encounter. - Bump XAA module minor version. - Update the Radeon Render acceleration to use the new hooks when the XAA module is sufficiently new. Fix a bug in the src/dst alpha booleans for ops, and use them to set blend_cntl to support destinations without alpha. Add missing PICT_a1r5g5b5 texture format, and add list terminator. (!)
This commit is contained in:
parent
9c1d52a69d
commit
751fd11a9a
|
@ -1278,6 +1278,10 @@ typedef struct _XAAInfoRec {
|
||||||
GlyphPtr *glyphs
|
GlyphPtr *glyphs
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* The old SetupForCPUToScreenAlphaTexture function is no longer used because
|
||||||
|
* it doesn't pass in enough information to write a conforming
|
||||||
|
* implementation. See SetupForCPUToScreenAlphaTexture2.
|
||||||
|
*/
|
||||||
Bool (*SetupForCPUToScreenAlphaTexture) (
|
Bool (*SetupForCPUToScreenAlphaTexture) (
|
||||||
ScrnInfoPtr pScrn,
|
ScrnInfoPtr pScrn,
|
||||||
int op,
|
int op,
|
||||||
|
@ -1304,6 +1308,10 @@ typedef struct _XAAInfoRec {
|
||||||
int CPUToScreenAlphaTextureFlags;
|
int CPUToScreenAlphaTextureFlags;
|
||||||
CARD32 * CPUToScreenAlphaTextureFormats;
|
CARD32 * CPUToScreenAlphaTextureFormats;
|
||||||
|
|
||||||
|
/* The old SetupForCPUToScreenTexture function is no longer used because
|
||||||
|
* it doesn't pass in enough information to write a conforming
|
||||||
|
* implementation. See SetupForCPUToScreenTexture2.
|
||||||
|
*/
|
||||||
Bool (*SetupForCPUToScreenTexture) (
|
Bool (*SetupForCPUToScreenTexture) (
|
||||||
ScrnInfoPtr pScrn,
|
ScrnInfoPtr pScrn,
|
||||||
int op,
|
int op,
|
||||||
|
@ -1333,6 +1341,38 @@ typedef struct _XAAInfoRec {
|
||||||
BoxRec SolidLineLimits;
|
BoxRec SolidLineLimits;
|
||||||
BoxRec DashedLineLimits;
|
BoxRec DashedLineLimits;
|
||||||
|
|
||||||
|
#ifdef RENDER
|
||||||
|
/* These were added for X.Org 6.8.0 */
|
||||||
|
Bool (*SetupForCPUToScreenAlphaTexture2) (
|
||||||
|
ScrnInfoPtr pScrn,
|
||||||
|
int op,
|
||||||
|
CARD16 red,
|
||||||
|
CARD16 green,
|
||||||
|
CARD16 blue,
|
||||||
|
CARD16 alpha,
|
||||||
|
CARD32 maskFormat,
|
||||||
|
CARD32 dstFormat,
|
||||||
|
CARD8 *alphaPtr,
|
||||||
|
int alphaPitch,
|
||||||
|
int width,
|
||||||
|
int height,
|
||||||
|
int flags
|
||||||
|
);
|
||||||
|
CARD32 *CPUToScreenAlphaTextureDstFormats;
|
||||||
|
|
||||||
|
Bool (*SetupForCPUToScreenTexture2) (
|
||||||
|
ScrnInfoPtr pScrn,
|
||||||
|
int op,
|
||||||
|
CARD32 srcFormat,
|
||||||
|
CARD32 dstFormat,
|
||||||
|
CARD8 *texPtr,
|
||||||
|
int texPitch,
|
||||||
|
int width,
|
||||||
|
int height,
|
||||||
|
int flags
|
||||||
|
);
|
||||||
|
CARD32 *CPUToScreenTextureDstFormats;
|
||||||
|
#endif /* RENDER */
|
||||||
} XAAInfoRec, *XAAInfoRecPtr;
|
} XAAInfoRec, *XAAInfoRecPtr;
|
||||||
|
|
||||||
#define SET_SYNC_FLAG(infoRec) (infoRec)->NeedToSync = TRUE
|
#define SET_SYNC_FLAG(infoRec) (infoRec)->NeedToSync = TRUE
|
||||||
|
|
|
@ -102,7 +102,7 @@ static XF86ModuleVersionInfo xaaVersRec =
|
||||||
MODINFOSTRING1,
|
MODINFOSTRING1,
|
||||||
MODINFOSTRING2,
|
MODINFOSTRING2,
|
||||||
XORG_VERSION_CURRENT,
|
XORG_VERSION_CURRENT,
|
||||||
1, 1, 0,
|
1, 2, 0,
|
||||||
ABI_CLASS_VIDEODRV, /* requires the video driver ABI */
|
ABI_CLASS_VIDEODRV, /* requires the video driver ABI */
|
||||||
ABI_VIDEODRV_VERSION,
|
ABI_VIDEODRV_VERSION,
|
||||||
MOD_CLASS_NONE,
|
MOD_CLASS_NONE,
|
||||||
|
@ -1269,10 +1269,12 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
|
||||||
#ifdef RENDER
|
#ifdef RENDER
|
||||||
{
|
{
|
||||||
Bool haveTexture = infoRec->CPUToScreenTextureFormats &&
|
Bool haveTexture = infoRec->CPUToScreenTextureFormats &&
|
||||||
infoRec->SetupForCPUToScreenTexture &&
|
infoRec->CPUToScreenTextureDstFormats &&
|
||||||
|
infoRec->SetupForCPUToScreenTexture2 &&
|
||||||
infoRec->SubsequentCPUToScreenTexture;
|
infoRec->SubsequentCPUToScreenTexture;
|
||||||
Bool haveAlphaTexture = infoRec->CPUToScreenAlphaTextureFormats &&
|
Bool haveAlphaTexture = infoRec->CPUToScreenAlphaTextureFormats &&
|
||||||
infoRec->SetupForCPUToScreenAlphaTexture &&
|
infoRec->CPUToScreenAlphaTextureDstFormats &&
|
||||||
|
infoRec->SetupForCPUToScreenAlphaTexture2 &&
|
||||||
infoRec->SubsequentCPUToScreenAlphaTexture;
|
infoRec->SubsequentCPUToScreenAlphaTexture;
|
||||||
|
|
||||||
if(!infoRec->Composite && (haveTexture || haveAlphaTexture))
|
if(!infoRec->Composite && (haveTexture || haveAlphaTexture))
|
||||||
|
|
|
@ -190,7 +190,7 @@ XAADoComposite (
|
||||||
ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
|
||||||
RegionRec region;
|
RegionRec region;
|
||||||
CARD32 *formats;
|
CARD32 *formats, *dstformats;
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
BoxPtr pbox;
|
BoxPtr pbox;
|
||||||
int nbox, w, h;
|
int nbox, w, h;
|
||||||
|
@ -279,7 +279,9 @@ XAADoComposite (
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(formats = infoRec->CPUToScreenAlphaTextureFormats))
|
formats = infoRec->CPUToScreenAlphaTextureFormats;
|
||||||
|
dstformats = infoRec->CPUToScreenAlphaTextureDstFormats;
|
||||||
|
if(!formats || !dstformats)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
w = pMask->pDrawable->width;
|
w = pMask->pDrawable->width;
|
||||||
|
@ -304,6 +306,11 @@ XAADoComposite (
|
||||||
if(!(*formats)) return FALSE;
|
if(!(*formats)) return FALSE;
|
||||||
formats++;
|
formats++;
|
||||||
}
|
}
|
||||||
|
while(*dstformats != pDst->format) {
|
||||||
|
if(!(*dstformats))
|
||||||
|
return FALSE;
|
||||||
|
dstformats++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst,
|
if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst,
|
||||||
xSrc, ySrc, xMask, yMask, xDst, yDst,
|
xSrc, ySrc, xMask, yMask, xDst, yDst,
|
||||||
|
@ -318,8 +325,9 @@ XAADoComposite (
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(infoRec->SetupForCPUToScreenAlphaTexture)(infoRec->pScrn,
|
if(!(infoRec->SetupForCPUToScreenAlphaTexture2)(infoRec->pScrn,
|
||||||
op, red, green, blue, alpha, pMask->format,
|
op, red, green, blue, alpha, pMask->format,
|
||||||
|
pDst->format,
|
||||||
((PixmapPtr)(pMask->pDrawable))->devPrivate.ptr,
|
((PixmapPtr)(pMask->pDrawable))->devPrivate.ptr,
|
||||||
((PixmapPtr)(pMask->pDrawable))->devKind,
|
((PixmapPtr)(pMask->pDrawable))->devKind,
|
||||||
w, h, flags))
|
w, h, flags))
|
||||||
|
@ -343,8 +351,10 @@ XAADoComposite (
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
REGION_UNINIT(pScreen, ®ion);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(!(formats = infoRec->CPUToScreenTextureFormats))
|
formats = infoRec->CPUToScreenTextureFormats;
|
||||||
|
dstformats = infoRec->CPUToScreenTextureDstFormats;
|
||||||
|
if(!formats || !dstformats)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
w = pSrc->pDrawable->width;
|
w = pSrc->pDrawable->width;
|
||||||
|
@ -361,11 +371,15 @@ XAADoComposite (
|
||||||
flags |= XAA_RENDER_REPEAT;
|
flags |= XAA_RENDER_REPEAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
while(*formats != pSrc->format) {
|
while(*formats != pSrc->format) {
|
||||||
if(!(*formats)) return FALSE;
|
if(!(*formats)) return FALSE;
|
||||||
formats++;
|
formats++;
|
||||||
}
|
}
|
||||||
|
while(*dstformats != pDst->format) {
|
||||||
|
if(!(*dstformats))
|
||||||
|
return FALSE;
|
||||||
|
dstformats++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst,
|
if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst,
|
||||||
xSrc, ySrc, xMask, yMask, xDst, yDst,
|
xSrc, ySrc, xMask, yMask, xDst, yDst,
|
||||||
|
@ -380,8 +394,8 @@ XAADoComposite (
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(infoRec->SetupForCPUToScreenTexture)(infoRec->pScrn,
|
if(!(infoRec->SetupForCPUToScreenTexture2)(infoRec->pScrn,
|
||||||
op, pSrc->format,
|
op, pSrc->format, pDst->format,
|
||||||
((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr,
|
((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr,
|
||||||
((PixmapPtr)(pSrc->pDrawable))->devKind,
|
((PixmapPtr)(pSrc->pDrawable))->devKind,
|
||||||
w, h, flags))
|
w, h, flags))
|
||||||
|
|
Loading…
Reference in New Issue