summaryrefslogtreecommitdiff
path: root/src/i830_dga.c
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@tungstengraphics.com>2006-08-08 15:28:14 -0700
committerEric Anholt <anholt@FreeBSD.org>2006-08-08 15:28:56 -0700
commitc3b3d479788fcea7e543f29acf83c85b8b148fbe (patch)
treea8df7e4c74d5cb065a96ba1d349d63167b2f6783 /src/i830_dga.c
parentbc12208f6e145ec29c3ebe38ae04dc2ebca1b4cc (diff)
Intel bug #35: Fix accelerator syncing with DGA.
Fixes glitches seen with Mark Vojkovich's "texture" demo.
Diffstat (limited to 'src/i830_dga.c')
-rw-r--r--src/i830_dga.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/i830_dga.c b/src/i830_dga.c
index 1129fa31..1a6e4e69 100644
--- a/src/i830_dga.c
+++ b/src/i830_dga.c
@@ -253,12 +253,25 @@ static void
I830_Sync(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
+ int flags = MI_WRITE_DIRTY_STATE | MI_INVALIDATE_MAP_CACHE;
MARKER();
- if (pI830->AccelInfoRec) {
- (*pI830->AccelInfoRec->Sync) (pScrn);
- }
+ if (pI830->noAccel)
+ return;
+
+ if (IS_I965G(pI830))
+ flags = 0;
+
+ BEGIN_LP_RING(2);
+ OUT_RING(MI_FLUSH | flags);
+ OUT_RING(MI_NOOP); /* pad to quadword */
+ ADVANCE_LP_RING();
+
+ I830WaitLpRing(pScrn, pI830->LpRing->mem.Size - 8, 0);
+
+ pI830->LpRing->space = pI830->LpRing->mem.Size - 8;
+ pI830->nextColorExpandBuf = 0;
}
static void