xserver/hw/kdrive/neomagic ChangeLog, 1.1, 1.2 neo_draw.c, 1.2, 1.3 neomagic.c, 1.6, 1.7 neomagic.h, 1.5, 1.6

Franco Catrin L. xserver-commit at pdx.freedesktop.org
Sat Apr 10 17:16:00 PDT 2004


Committed by: fcatrin

Update of /cvs/xserver/xserver/hw/kdrive/neomagic
In directory pdx:/tmp/cvs-serv8713

Modified Files:
	ChangeLog neo_draw.c neomagic.c neomagic.h 
Log Message:
Finnally got MMIO working all timecat ChangeLog cat ChangeLog cat ChangeLog  :-D

Index: ChangeLog
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/neomagic/ChangeLog,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/ChangeLog	6 Apr 2004 18:09:44 -0000	1.1
+++ b/ChangeLog	11 Apr 2004 00:15:57 -0000	1.2
@@ -1,3 +1,6 @@
+2004-04-10 Franco Catrin L. <fcatrin at tuxpan.com>
+        * MMIO enabled after switching to new VT
+	
 2004-04-06 Franco Catrin L. <fcatrin at tuxpan.com>
         * Returned to a working state.  Brent will
 	  continue working on a backend in a separate CVS branch

Index: neo_draw.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/neomagic/neo_draw.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- a/neo_draw.c	4 Apr 2004 07:30:07 -0000	1.2
+++ b/neo_draw.c	11 Apr 2004 00:15:57 -0000	1.3
@@ -39,24 +39,27 @@
 #include "miline.h"
 #include "picturestr.h"
 
-static inline void neoWaitIdle(NeoCardInfo *neoc)
+NeoMMIO       *mmio;
+NeoScreenInfo *screen;
+NeoCardInfo   *card;
+CARD32        fgColor;
+
+static  void neoWaitIdle(NeoCardInfo *neoc)
 {
     // if MMIO is not working it may halt the machine
-    int i = 0;
-    while ((neoc->mmio->bltStat & 1) && ++i<10000);
-    if (i>=10000) DBGOUT("Wait Idle timeout");
+	DBGOUT("Waiting for idle...\n");
+	DBGOUT("blStat %lx=%lx\n", &mmio->bltStat, mmio->bltStat);
+    unsigned int i = 0;
+    while ((mmio->bltStat & 1) && ++i<100000);
+    if (i>=100000) DBGOUT("Wait Idle timeout\n");
+	else DBGOUT("*** Wait Idle ok\n");
 }
 
-static inline void neoWaitFifo(NeoCardInfo *neoc, int requested_fifo_space)
+static  void neoWaitFifo(NeoCardInfo *neoc, int requested_fifo_space)
 {
     neoWaitIdle( neoc );
 }
 
-NeoMMIO       *mmio;
-NeoScreenInfo *screen;
-NeoCardInfo   *card;
-CARD32        fgColor;
-
 static Bool neoPrepareSolid(PixmapPtr pPixmap,
                             int alu,
                             Pixel pm,
@@ -68,15 +71,12 @@
         return FALSE;
     } else {
         fgColor = fg;
-        neoWaitIdle(card);
         /* set blt control */
-        mmio->bltCntl =
-            NEO_BC0_SRC_IS_FG    |
+/*            NEO_BC0_SRC_IS_FG    |
             NEO_BC3_SRC_XY_ADDR |
-            NEO_BC3_DST_XY_ADDR |
-            NEO_BC3_SKIP_MAPPING |  0x0c0000;
+            NEO_BC3_DST_XY_ADDR | 
+            NEO_BC3_SKIP_MAPPING |  0x0c0000; */
 
-        mmio->fgColor = fgColor;
         return TRUE;
     }
 }
@@ -98,12 +98,23 @@
         h = -h;
     }
 
-    neoWaitIdle(card);
+	int pitch = 16;
+	
+	neoWaitIdle(card);
+	mmio->bltStat = NEO_MODE1_DEPTH16 << 16;
+ 	mmio->pitch = (pitch << 16) | (pitch & 0xffff);
+	
+	neoWaitIdle(card);
+	mmio->fgColor = fgColor;
+	mmio->bltCntl =
+			NEO_BC3_FIFO_EN      |
+			NEO_BC0_SRC_IS_FG    |
+			NEO_BC3_SKIP_MAPPING | 0x0c0000;		
     mmio->dstStart = (y <<16) | (x & 0xffff);
 
     mmio->xyExt    = (h << 16) | (w & 0xffff);
     DBGOUT("Solid (%i, %i) - (%i, %i).  Color %li\n", x, y, w, h, fgColor);
-    DBGOUT("Offset %lx. Extent %lx\n",mmio->dstStart, mmio->xyExt);
+    // DBGOUT("Offset %lx. Extent %lx\n",mmio->dstStart, mmio->xyExt);
 }
 
 

Index: neomagic.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/neomagic/neomagic.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- a/neomagic.c	6 Apr 2004 18:09:44 -0000	1.6
+++ b/neomagic.c	11 Apr 2004 00:15:57 -0000	1.7
@@ -75,8 +75,6 @@
 
     ErrorF("Using Neomagic card: %s\n", neoc->chip->name);
 
-    iopl(3);
-
     neoMapReg(card, neoc);
 
     card->driver = neoc;
@@ -170,6 +168,7 @@
 static void neoLock(NeoCardInfo *neoc){
     CARD8 cr11;
     neoSetIndex(neoc, 0x3ce,  0x09, 0x00);
+    neoSetIndex(neoc, 0x3ce,  0x11, 0x0); // disable MMIO and linear mode
     cr11 = neoGetIndex(neoc, 0x3d4, 0x11);
     neoSetIndex(neoc, 0x3d4, 0x11, cr11 | 0x80);
 }
@@ -179,6 +178,7 @@
     cr11 = neoGetIndex(neoc, 0x3d4, 0x11);
     neoSetIndex(neoc, 0x3d4, 0x11, cr11 & 0x7F);
     neoSetIndex(neoc, 0x3ce,  0x09, 0x26);
+    neoSetIndex(neoc, 0x3ce,  0x11, 0xc0); // enable MMIO and linear mode
 }
 
 

Index: neomagic.h
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/neomagic/neomagic.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- a/neomagic.h	6 Apr 2004 18:09:44 -0000	1.5
+++ b/neomagic.h	11 Apr 2004 00:15:57 -0000	1.6
@@ -79,6 +79,18 @@
 #define NEO_BC3_BLT_ON_ADDR     0x10000000
 #define NEO_BC3_SKIP_MAPPING    0x80000000
 
+#define NEO_MODE1_DEPTH8        0x0100
+#define NEO_MODE1_DEPTH16       0x0200
+#define NEO_MODE1_DEPTH24       0x0300
+#define NEO_MODE1_X_320         0x0400
+#define NEO_MODE1_X_640         0x0800
+#define NEO_MODE1_X_800         0x0c00
+#define NEO_MODE1_X_1024        0x1000
+#define NEO_MODE1_X_1152        0x1400
+#define NEO_MODE1_X_1280        0x1800
+#define NEO_MODE1_X_1600        0x1c00
+#define NEO_MODE1_BLT_ON_ADDR   0x2000
+
 typedef volatile CARD8    VOL8;
 typedef volatile CARD16    VOL16;
 typedef volatile CARD32    VOL32;




More information about the xserver-commit mailing list