diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-05-22 10:56:47 +0200 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2007-05-22 10:56:47 +0200 |
commit | 975da595f032c145ad74079ff8edeaead779dc7b (patch) | |
tree | bcd7c26f46e40ed8dbdc8cd3bdd8a0bf2def434b | |
parent | 8275151baac22c34149cef0b7d922771d24abc3e (diff) |
radeon: Provide new DRI texOffsetStart hook when available with EXA.
-rw-r--r-- | src/radeon.h | 1 | ||||
-rw-r--r-- | src/radeon_dri.c | 16 | ||||
-rw-r--r-- | src/radeon_exa.c | 17 |
3 files changed, 34 insertions, 0 deletions
diff --git a/src/radeon.h b/src/radeon.h index 8c399cd0..3ea44f3a 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -851,6 +851,7 @@ extern Bool RADEONAccelInit(ScreenPtr pScreen); extern Bool RADEONSetupMemEXA (ScreenPtr pScreen); extern Bool RADEONDrawInitMMIO(ScreenPtr pScreen); #ifdef XF86DRI +extern unsigned long long RADEONTexOffsetStart(PixmapPtr pPix); extern Bool RADEONGetDatatypeBpp(int bpp, CARD32 *type); extern Bool RADEONGetPixmapOffsetPitch(PixmapPtr pPix, CARD32 *pitch_offset); diff --git a/src/radeon_dri.c b/src/radeon_dri.c index 24e31ab5..39393f54 100644 --- a/src/radeon_dri.c +++ b/src/radeon_dri.c @@ -1475,6 +1475,22 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen) pDRIInfo->createDummyCtx = TRUE; pDRIInfo->createDummyCtxPriv = FALSE; +#ifdef USE_EXA + if (info->useEXA) { +#if DRIINFO_MAJOR_VERSION == 5 && DRIINFO_MINOR_VERSION >= 3 + int major, minor, patch; + + DRIQueryVersion(&major, &minor, &patch); + + if (minor >= 3) +#endif +#if DRIINFO_MAJOR_VERSION > 5 || \ + (DRIINFO_MAJOR_VERSION == 5 && DRIINFO_MINOR_VERSION >= 3) + pDRIInfo->texOffsetStart = RADEONTexOffsetStart; +#endif + } +#endif + if (!DRIScreenInit(pScreen, pDRIInfo, &info->drmFD)) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[dri] DRIScreenInit failed. Disabling DRI.\n"); diff --git a/src/radeon_exa.c b/src/radeon_exa.c index f9bcaceb..d074f08a 100644 --- a/src/radeon_exa.c +++ b/src/radeon_exa.c @@ -496,3 +496,20 @@ Bool RADEONSetupMemEXA (ScreenPtr pScreen) return TRUE; } + +#ifdef XF86DRI + +#ifndef ExaOffscreenMarkUsed +extern void ExaOffscreenMarkUsed(PixmapPtr); +#endif + +unsigned long long +RADEONTexOffsetStart(PixmapPtr pPix) +{ + exaMoveInPixmap(pPix); + ExaOffscreenMarkUsed(pPix); + + return RADEONPTR(xf86Screens[pPix->drawable.pScreen->myNum])->fbLocation + + exaGetPixmapOffset(pPix); +} +#endif |