[PATCH trident] trident cyberblade FIFO status check (bug 3304)

Matt Turner mattst88 at gmail.com
Fri Dec 3 13:48:28 PST 2010


From: Laurence Darby <ldarby at tuffmail.com>

---
I verified that it compiled, but I don't have hardware to test.

 src/blade_accel.c |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/src/blade_accel.c b/src/blade_accel.c
index 31d97df..6a624b9 100644
--- a/src/blade_accel.c
+++ b/src/blade_accel.c
@@ -43,6 +43,10 @@
 #include "xaalocal.h"
 
 static void BladeSync(ScrnInfoPtr pScrn);
+static void BladeSync_unsafe(ScrnInfoPtr pScrn);
+
+static int busy;
+
 #if 0
 static void BladeSetupForSolidLine(ScrnInfoPtr pScrn, int color,
 				int rop, unsigned int planemask);
@@ -272,6 +276,16 @@ BladeSync(ScrnInfoPtr pScrn)
     }
 }
 
+
+static void
+BladeSync_unsafe(ScrnInfoPtr pScrn)
+{
+       TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
+       BLADEBUSY(busy);
+       while (busy != 0) { BLADEBUSY(busy); };
+}
+
+
 static void
 BladeSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, 
 				int xdir, int ydir, int rop,
@@ -294,6 +308,7 @@ BladeSetupForScreenToScreenCopy(ScrnInfoPtr pScrn,
 	pTrident->BltScanDirection |= 1<<5;
     }
 #endif
+    BladeSync_unsafe(pScrn);
     BLADE_OUT(0x2148, XAAGetCopyROP(rop));
 }
 
@@ -306,6 +321,7 @@ BladeSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1,
 
     if (pTrident->Clipping) clip = 1;
 
+    BladeSync_unsafe(pScrn);
     BLADE_OUT(0x2144, 0xE0000000 | 1<<19 | 1<<4 | 1<<2 | pTrident->BltScanDirection | clip);
 
     if (pTrident->BltScanDirection) {
@@ -472,6 +488,7 @@ BladeSetupForFillRectSolid(ScrnInfoPtr pScrn, int color,
     TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
 
     REPLICATE(color);
+    BladeSync_unsafe(pScrn);
     BLADE_OUT(0x2160, color);
     BLADE_OUT(0x2148, XAAGetCopyROP(rop));
     pTrident->BltScanDirection = 0;
@@ -489,6 +506,7 @@ BladeSubsequentFillRectSolid(ScrnInfoPtr pScrn, int x, int y, int w, int h)
 {
     TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
 
+    BladeSync_unsafe(pScrn);
     BLADE_OUT(0x2144, 0x20000000 | pTrident->BltScanDirection | 1<<19 | 1<<4 | 2<<2 | (pTrident->Clipping ? 1:0));
     BLADE_OUT(0x2108, y<<16 | x);
     BLADE_OUT(0x210C, ((y+h-1)&0xfff)<<16 | ((x+w-1)&0xfff));
@@ -540,6 +558,7 @@ BladeSetupForCPUToScreenColorExpand(ScrnInfoPtr pScrn,
     TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
 
     pTrident->BltScanDirection = 0;
+    BladeSync_unsafe(pScrn);
     BLADE_OUT(0x2148, XAAGetCopyROP(rop));
     if (bg == -1) {
 	pTrident->BltScanDirection |= 2<<19;
@@ -569,6 +588,7 @@ BladeSubsequentCPUToScreenColorExpand(ScrnInfoPtr pScrn,
     TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
 
     if (skipleft) BladeSetClippingRectangle(pScrn,x+skipleft,y,(x+w-1),(y+h-1));
+    BladeSync_unsafe(pScrn);
     BLADE_OUT(0x2144, 0xE0000000 | pTrident->BltScanDirection | 1<<4 | (skipleft ? 1 : 0));
     BLADE_OUT(0x2108, (y&0xfff)<<16 | (x&0xfff));
     BLADE_OUT(0x210C, ((y+h-1)&0xfff)<<16 | ((x+w-1)&0xfff));
@@ -582,13 +602,14 @@ BladeSetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
 {
     TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
 
-    BladeSync(pScrn);
+    BladeSync_unsafe(pScrn);
     BLADE_OUT(0x2148, XAAGetPatternROP(rop));
 
     if (bg == -1) {
     REPLICATE(fg);
     BLADE_OUT(0x216C, 0x80000000 | 1<<30);
     BLADE_OUT(0x216C, 0x80000000 | 1<<28 | 1<<30);
+    BladeSync_unsafe(pScrn);
     BLADE_OUT(0x2170, patternx);
     BLADE_OUT(0x2170, patterny);
     BLADE_OUT(0x2174, fg);
@@ -600,6 +621,7 @@ BladeSetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
     REPLICATE(bg);
     BLADE_OUT(0x216C, 0x80000000);
     BLADE_OUT(0x216C, 0x80000000 | 1<<28);
+    BladeSync_unsafe(pScrn);
     BLADE_OUT(0x2170, patternx);
     BLADE_OUT(0x2170, patterny);
     BLADE_OUT(0x2174, fg);
@@ -625,6 +647,7 @@ BladeSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn,
     int clip = 0;
 
     if (pTrident->Clipping) clip = 1;
+    BladeSync_unsafe(pScrn);
     BLADE_OUT(0x2144, 0x20000000 | pTrident->BltScanDirection | 7<<12 | 1<<4 | 1<<19 | 2<<2 | clip);
     BLADE_OUT(0x2108, y<<16 | x);
     BLADE_OUT(0x210C, ((y+h-1)&0xfff)<<16 | ((x+w-1)&0xfff));
@@ -679,6 +702,7 @@ static void BladeSetupForImageWrite(
 ){
     TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
 
+    BladeSync_unsafe(pScrn);
     BLADE_OUT(0x2148, XAAGetCopyROP(rop));
     pTrident->BltScanDirection = 0;
 #if 0
@@ -698,6 +722,7 @@ static void BladeSubsequentImageWriteRect(
     TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
 
     if (skipleft) BladeSetClippingRectangle(pScrn,x+skipleft,y,(x+w-1),(y+h-1));
+    BladeSync_unsafe(pScrn);
     BLADE_OUT(0x2144, 0xE0000000 | 1<<19 | 1<<4 | pTrident->BltScanDirection | (skipleft ? 1 : 0));
     BLADE_OUT(0x2108, y<<16 | (x&0xfff));
     BLADE_OUT(0x210C, ((y+h-1)&0xfff)<<16 | ((x+w-1)&0xfff));
-- 
1.7.2.2



More information about the xorg-devel mailing list