summaryrefslogtreecommitdiff
path: root/src/atimach64accel.c
diff options
context:
space:
mode:
authorMarc Aurele La France <tsi@xfree86.org>2006-07-29 01:00:56 +0300
committerGeorge Sapountzis <gsap7@yahoo.gr>2006-07-29 01:00:56 +0300
commit7800407a2db4b7307192bf3b43fffb9c4748b9c0 (patch)
tree97c90ce49f10f520f1d76672fded9e31578d417d /src/atimach64accel.c
parent49b11c540d37152eee4907ab30353ede01e4fb56 (diff)
Bug #807: invalidate read-back cache.
Fix corruption when scaling 1-pixel wide pixmaps, in which case the first CPU read of the framebuffer will return stale data. This bug always manifests itself in mach64 EXA (to be committed soon), with this patch mach64 EXA passes rendercheck.
Diffstat (limited to 'src/atimach64accel.c')
-rw-r--r--src/atimach64accel.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/atimach64accel.c b/src/atimach64accel.c
index 932c8c11..a0a9e176 100644
--- a/src/atimach64accel.c
+++ b/src/atimach64accel.c
@@ -245,16 +245,32 @@ ATIMach64Sync
}
}
+ if (pATI->pXAAInfo)
+ pATI->pXAAInfo->NeedToSync = FALSE;
+
+ if (pATI->Chip >= ATI_CHIP_264VTB)
+ {
+ /*
+ * Flush the read-back cache (by turning on INVALIDATE_RB_CACHE),
+ * otherwise the host might get stale data when reading through the
+ * aperture.
+ */
+ outr(MEM_BUF_CNTL, pATI->NewHW.mem_buf_cntl);
+ }
+
/*
+ * Note:
+ * Before actually invalidating the read-back cache, the mach64 driver
+ * was using the trick below which is buggy. The code is left here for
+ * reference, DRI uses this trick and needs updating.
+ *
* For VTB's and later, the first CPU read of the framebuffer will return
* zeroes, so do it here. This appears to be due to some kind of engine
* caching of framebuffer data I haven't found any way of disabling, or
* otherwise circumventing. Thanks to Mark Vojkovich for the suggestion.
+ *
+ * pATI = *(volatile ATIPtr *)pATI->pMemory;
*/
- if (pATI->pXAAInfo)
- pATI->pXAAInfo->NeedToSync = FALSE;
-
- pATI = *(volatile ATIPtr *)pATI->pMemory;
}
static __inline__ void