[PATCH] Fix DFS corruption.

Pauli Nieminen suokkos at gmail.com
Tue Sep 8 05:10:47 PDT 2009


Bliting data while some of engines is still running or 2D engine as dirty
cache may cause pixmap or font glyph corruption.

Fix is to wait for 3D engine to be idle. Then we have to also flush 2D engine
in case if cache has outdated data for system memory where we are going to blit.
While it would be better only to flush when necessary it is very hard to know
when it is required. So we do flush every time because it is better to be safe
than sorry.
---
 src/radeon_exa_funcs.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c
index c74b9d9..88b63ae 100644
--- a/src/radeon_exa_funcs.c
+++ b/src/radeon_exa_funcs.c
@@ -410,12 +410,18 @@ RADEONBlitChunk(ScrnInfoPtr pScrn, struct radeon_bo *src_bo,
     ACCEL_PREAMBLE();
 
     if (src_bo && dst_bo) {
-        BEGIN_ACCEL_RELOC(6, 2);
+        BEGIN_ACCEL_RELOC(9, 2);
     } else if (src_bo && dst_bo == NULL) {
-        BEGIN_ACCEL_RELOC(6, 1);
+        BEGIN_ACCEL_RELOC(9, 1);
     } else {
-        BEGIN_ACCEL(6);
+        BEGIN_ACCEL(9);
     }
+    OUT_ACCEL_REG(RADEON_WAIT_UNTIL,
+                  RADEON_WAIT_3D_IDLECLEAN);
+    OUT_ACCEL_REG(RADEON_DSTCACHE_CTLSTAT, RADEON_RB2D_DC_FLUSH_ALL);
+    OUT_ACCEL_REG(RADEON_WAIT_UNTIL,
+                  RADEON_WAIT_2D_IDLECLEAN);
+
     OUT_ACCEL_REG(RADEON_DP_GUI_MASTER_CNTL,
 		  RADEON_GMC_DST_PITCH_OFFSET_CNTL |
 		  RADEON_GMC_SRC_PITCH_OFFSET_CNTL |
-- 
1.6.3.3



More information about the xorg-driver-ati mailing list