xf86-video-ati: Branch 'master' - 2 commits
Michel Daenzer
daenzer at kemper.freedesktop.org
Sun Oct 15 18:06:39 EEST 2006
configure.ac | 6 ++++++
src/radeon_dri.c | 49 +++++++++++++++++--------------------------------
src/radeon_driver.c | 10 ++++++++++
src/radeon_video.c | 15 +++++++++++++--
4 files changed, 46 insertions(+), 34 deletions(-)
New commits:
diff-tree 2933140b5f1f8a6e270460d8918a14943bd0f174 (from 4edbfb9eb952f9b3f5f597749192c17baf15cdce)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date: Sun Oct 15 17:05:02 2006 +0200
radeon: Use xf86XVFillKeyHelperDrawable() when available.
diff --git a/configure.ac b/configure.ac
index e52bcd9..4599429 100644
--- a/configure.ac
+++ b/configure.ac
@@ -219,6 +219,12 @@ if test "x$have_exa_h" = xyes; then
AC_DEFINE(USE_EXA, 1, [Build support for Exa])
fi
fi
+
+AC_CHECK_DECL(xf86XVFillKeyHelperDrawable,
+ [AC_DEFINE(HAVE_XV_DRAWABLE_HELPER, 1, [Have xf86XVFillKeyHelperDrawable prototype])],
+ [],
+ [#include <xf86xv.h>])
+
CPPFLAGS="$SAVE_CPPFLAGS"
AM_CONDITIONAL(USE_EXA, test "x$USE_EXA" = xyes)
diff --git a/src/radeon_video.c b/src/radeon_video.c
index b03f8de..d4e1f0a 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -2696,6 +2696,17 @@ RADEONDisplayVideo(
}
+static void
+RADEONFillKeyHelper(DrawablePtr pDraw, CARD32 colorKey, RegionPtr clipBoxes)
+{
+#if HAVE_XV_DRAWABLE_HELPER
+ xf86XVFillKeyHelperDrawable(pDraw, colorKey, clipBoxes);
+#else
+ xf86XVFillKeyHelper(pDraw->pScreen, colorKey, clipBoxes);
+#endif
+}
+
+
static int
RADEONPutImage(
ScrnInfoPtr pScrn,
@@ -2870,7 +2881,7 @@ RADEONPutImage(
REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes);
/* draw these */
if(pPriv->autopaint_colorkey)
- xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes);
+ RADEONFillKeyHelper(pDraw, pPriv->colorKey, clipBoxes);
}
RADEONDisplayVideo(pScrn, pPriv, id, offset, offset, offset, offset, width, height, dstPitch,
@@ -3416,7 +3427,7 @@ RADEONPutVideo(
REGION_COPY(pScreen, &pPriv->clip, clipBoxes);
/* draw these */
if(pPriv->autopaint_colorkey)
- xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes);
+ RADEONFillKeyHelper(pDraw, pPriv->colorKey, clipBoxes);
}
RADEONDisplayVideo(pScrn, pPriv, id, offset1+top*srcPitch, offset2+top*srcPitch, offset3+top*srcPitch, offset4+top*srcPitch, width, height, dstPitch*mult/2,
diff-tree 4edbfb9eb952f9b3f5f597749192c17baf15cdce (from c9c2ac2b42398f5bfad909f3289e2545bb7b3888)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date: Sun Oct 15 17:03:13 2006 +0200
radeon: Track screen damage all the time for page flipping.
This way we don't ever have to forcedly synchronize the pages so we hopefully
never clobber one page's contents when we shouldn't.
diff --git a/src/radeon_dri.c b/src/radeon_dri.c
index 4f39e5c..be8e74f 100644
--- a/src/radeon_dri.c
+++ b/src/radeon_dri.c
@@ -402,7 +402,24 @@ static void RADEONEnterServer(ScreenPtr
if (info->ChipFamily>=CHIP_FAMILY_R300)
drmCommandNone(info->drmFD, DRM_RADEON_CP_IDLE);
+#ifdef DAMAGE
+ if (!info->pDamage && info->allowPageFlip) {
+ PixmapPtr pPix = pScreen->GetScreenPixmap(pScreen);
+ info->pDamage = DamageCreate(NULL, NULL, DamageReportNone, TRUE,
+ pScreen, pPix);
+
+ if (info->pDamage == NULL) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "No screen damage record, page flipping disabled\n");
+ info->allowPageFlip = 0;
+ } else {
+ DamageRegister(&pPix->drawable, info->pDamage);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Damage tracking initialized for page flipping\n");
+ }
+ }
+#endif
}
/* Called when the X server goes to sleep to allow the X server's
@@ -1890,30 +1907,9 @@ static void RADEONEnablePageFlip(ScreenP
RADEONInfoPtr info = RADEONPTR(pScrn);
if (info->allowPageFlip) {
- BoxRec box = { .x1 = 0, .y1 = 0, .x2 = pScrn->virtualX - 1,
- .y2 = pScrn->virtualY - 1 };
RADEONSAREAPrivPtr pSAREAPriv = DRIGetSAREAPrivate(pScreen);
- if (!info->pDamage) {
- PixmapPtr pPix = pScreen->GetScreenPixmap(pScreen);
-
- /* Have damage run only while there is 3d active.
- */
- info->pDamage = DamageCreate(NULL, NULL, DamageReportNone, TRUE,
- pScreen, pPix);
-
- if (info->pDamage == NULL) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "No screen damage record, page flipping disabled\n");
- info->allowPageFlip = 0;
- return;
- }
-
- DamageRegister(&pPix->drawable, info->pDamage);
- }
-
pSAREAPriv->pfAllowPageFlip = 1;
- RADEONDRIRefreshArea(pScrn, 1, &box);
}
#endif
}
@@ -1925,17 +1921,6 @@ static void RADEONDisablePageFlip(Screen
* -- DRM needs to cope with Front-to-Back swapbuffers.
*/
RADEONSAREAPrivPtr pSAREAPriv = DRIGetSAREAPrivate(pScreen);
-#ifdef DAMAGE
- RADEONInfoPtr info = RADEONPTR(xf86Screens[pScreen->myNum]);
-
- if (info->pDamage) {
- PixmapPtr pPix = pScreen->GetScreenPixmap(pScreen);
-
- DamageUnregister(&pPix->drawable, info->pDamage);
- DamageDestroy(info->pDamage);
- info->pDamage = NULL;
- }
-#endif
pSAREAPriv->pfAllowPageFlip = 0;
}
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 07a9349..0a0d382 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -7563,6 +7563,16 @@ static Bool RADEONCloseScreen(int scrnIn
info->accelOn = FALSE;
#ifdef XF86DRI
+#ifdef DAMAGE
+ if (info->pDamage) {
+ PixmapPtr pPix = pScreen->GetScreenPixmap(pScreen);
+
+ DamageUnregister(&pPix->drawable, info->pDamage);
+ DamageDestroy(info->pDamage);
+ info->pDamage = NULL;
+ }
+#endif
+
RADEONDRIStop(pScreen);
#endif
More information about the xorg-commit
mailing list