- 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:
Eric Anholt 2004-08-04 10:05:37 +00:00
parent 9c1d52a69d
commit 751fd11a9a
3 changed files with 68 additions and 12 deletions

View File

@ -1278,6 +1278,10 @@ typedef struct _XAAInfoRec {
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) (
ScrnInfoPtr pScrn,
int op,
@ -1304,6 +1308,10 @@ typedef struct _XAAInfoRec {
int CPUToScreenAlphaTextureFlags;
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) (
ScrnInfoPtr pScrn,
int op,
@ -1333,6 +1341,38 @@ typedef struct _XAAInfoRec {
BoxRec SolidLineLimits;
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;
#define SET_SYNC_FLAG(infoRec) (infoRec)->NeedToSync = TRUE

View File

@ -102,7 +102,7 @@ static XF86ModuleVersionInfo xaaVersRec =
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
1, 1, 0,
1, 2, 0,
ABI_CLASS_VIDEODRV, /* requires the video driver ABI */
ABI_VIDEODRV_VERSION,
MOD_CLASS_NONE,
@ -1269,10 +1269,12 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
#ifdef RENDER
{
Bool haveTexture = infoRec->CPUToScreenTextureFormats &&
infoRec->SetupForCPUToScreenTexture &&
infoRec->CPUToScreenTextureDstFormats &&
infoRec->SetupForCPUToScreenTexture2 &&
infoRec->SubsequentCPUToScreenTexture;
Bool haveAlphaTexture = infoRec->CPUToScreenAlphaTextureFormats &&
infoRec->SetupForCPUToScreenAlphaTexture &&
infoRec->CPUToScreenAlphaTextureDstFormats &&
infoRec->SetupForCPUToScreenAlphaTexture2 &&
infoRec->SubsequentCPUToScreenAlphaTexture;
if(!infoRec->Composite && (haveTexture || haveAlphaTexture))

View File

@ -190,7 +190,7 @@ XAADoComposite (
ScreenPtr pScreen = pDst->pDrawable->pScreen;
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
RegionRec region;
CARD32 *formats;
CARD32 *formats, *dstformats;
int flags = 0;
BoxPtr pbox;
int nbox, w, h;
@ -279,7 +279,9 @@ XAADoComposite (
return TRUE;
}
if(!(formats = infoRec->CPUToScreenAlphaTextureFormats))
formats = infoRec->CPUToScreenAlphaTextureFormats;
dstformats = infoRec->CPUToScreenAlphaTextureDstFormats;
if(!formats || !dstformats)
return FALSE;
w = pMask->pDrawable->width;
@ -304,6 +306,11 @@ XAADoComposite (
if(!(*formats)) return FALSE;
formats++;
}
while(*dstformats != pDst->format) {
if(!(*dstformats))
return FALSE;
dstformats++;
}
if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
xSrc, ySrc, xMask, yMask, xDst, yDst,
@ -318,8 +325,9 @@ XAADoComposite (
return TRUE;
}
if(!(infoRec->SetupForCPUToScreenAlphaTexture)(infoRec->pScrn,
op, red, green, blue, alpha, pMask->format,
if(!(infoRec->SetupForCPUToScreenAlphaTexture2)(infoRec->pScrn,
op, red, green, blue, alpha, pMask->format,
pDst->format,
((PixmapPtr)(pMask->pDrawable))->devPrivate.ptr,
((PixmapPtr)(pMask->pDrawable))->devKind,
w, h, flags))
@ -343,8 +351,10 @@ XAADoComposite (
REGION_UNINIT(pScreen, &region);
return TRUE;
}
} else {
if(!(formats = infoRec->CPUToScreenTextureFormats))
} else {
formats = infoRec->CPUToScreenTextureFormats;
dstformats = infoRec->CPUToScreenTextureDstFormats;
if(!formats || !dstformats)
return FALSE;
w = pSrc->pDrawable->width;
@ -361,11 +371,15 @@ XAADoComposite (
flags |= XAA_RENDER_REPEAT;
}
while(*formats != pSrc->format) {
if(!(*formats)) return FALSE;
formats++;
}
while(*dstformats != pDst->format) {
if(!(*dstformats))
return FALSE;
dstformats++;
}
if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
xSrc, ySrc, xMask, yMask, xDst, yDst,
@ -380,8 +394,8 @@ XAADoComposite (
return TRUE;
}
if(!(infoRec->SetupForCPUToScreenTexture)(infoRec->pScrn,
op, pSrc->format,
if(!(infoRec->SetupForCPUToScreenTexture2)(infoRec->pScrn,
op, pSrc->format, pDst->format,
((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr,
((PixmapPtr)(pSrc->pDrawable))->devKind,
w, h, flags))