summaryrefslogtreecommitdiff
path: root/src/radeon_exa.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2008-07-16 03:14:06 -0400
committerPierre Ossman <pierre@ossman.eu>2008-12-04 21:49:52 +0100
commit4d98acbca2e630056bf56cdcd0e23007fded2ced (patch)
treea574724160c84f68601072fb25e7507653da3ce6 /src/radeon_exa.c
parent82d67b70d0fb747cf7b1eb0b64244ae56cb84572 (diff)
First pass at tear-free accel
if the dest pixmap is the front buffer, stall the pipe until the vline is outside the active area. For EXA, pick crtc based on the larger mode area; ideally we'd have one pixmap per crtc. For Xv, use dst window area to determine crtc.
Diffstat (limited to 'src/radeon_exa.c')
-rw-r--r--src/radeon_exa.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index 04c097b2..c4bc1bb1 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -192,6 +192,33 @@ Bool RADEONGetPixmapOffsetPitch(PixmapPtr pPix, uint32_t *pitch_offset)
return RADEONGetOffsetPitch(pPix, bpp, pitch_offset, offset, pitch);
}
+/*
+ * Used for vblank render stalling.
+ * Ideally we'd have one pixmap per crtc.
+ * syncing per-blit is unrealistic so,
+ * we sync to whichever crtc has a larger area.
+ */
+int RADEONBiggerCrtcArea(PixmapPtr pPix)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ int c, crtc_num = -1, area = 0;
+
+ for (c = 0; c < xf86_config->num_crtc; c++) {
+ xf86CrtcPtr crtc = xf86_config->crtc[c];
+
+ if (!crtc->enabled)
+ continue;
+
+ if ((crtc->mode.HDisplay * crtc->mode.VDisplay) > area) {
+ area = crtc->mode.HDisplay * crtc->mode.VDisplay;
+ crtc_num = c;
+ }
+ }
+
+ return crtc_num;
+}
+
#if X_BYTE_ORDER == X_BIG_ENDIAN
static unsigned long swapper_surfaces[3];