Hi,

I got software fallbacks to work with Savage IX ;-), more or less. It's
scribbling all over the screen, and what it draws depends on the
background. Furthermore, the way it scribbles stuff over the screen
depends on whether I have DisableTile set to true of false. Looks like
frame buffer access is not linear in either case and other stuff is
probably not setup correctly. Alex, could you take a look, please. I'm
lost here.

I'm attaching a patch with my 3D driver changes for SavageIX. It'll most
likely break other savages and it draws everything as software fallbacks.
Try running glxgears on a desktop with the standard X background (black
and white mesh). It draws some stuff over the white pixels, but the
black pixels stay black. With DisableTile set to false you can almost
recognize the gears.

Regards,
  Felix

P.S.: drawing everything as software fallbacks doesn't always work on my
ProSavage. With glxgears and some xscreensaver hacks I tried the window
stays black. In flightgear some polys are missing (the runway) and the
propeller disk is drawn inside the cockpit in some frames (zbuffer
problem?). With ng-glx the output is ok, though. I havn't found out
what's wrong yet.
--- ./savagespan.c.~1.1.4.4.~   2003-12-28 17:42:33.000000000 +0100
+++ ./savagespan.c      2004-01-17 22:51:54.000000000 +0100
@@ -45,7 +45,8 @@
                             dPriv->x * cpp +           \
                             dPriv->y * pitch);         \
    GLuint p = SAVAGE_CONTEXT( ctx )->MonoColor;         \
-   (void) read_buf; (void) buf; (void) p
+   /*GLuint dummy = *(int *)(NULL);*/                       \
+   (void) read_buf; (void) buf; (void) p/*; (void)dummy*/
 
 #define LOCAL_DEPTH_VARS                               \
    __DRIdrawablePrivate *dPriv = imesa->mesa_drawable; \
--- ./savage_bci.h.~1.1.4.2.~   2003-12-29 02:02:07.000000000 +0100
+++ ./savage_bci.h      2004-01-17 18:45:04.000000000 +0100
@@ -670,8 +670,8 @@
 
 /*frank 2001/11/20 */
 #define MAXLOOP 0xFFFFFF
-/*#define MAXFIFO 0x7F00*/
-#define MAXFIFO 0x1FF00
+#define MAXFIFO 0x7F00
+/*#define MAXFIFO 0x1FF00*/
 
 /* get eventtag from shadow status */
 /* here we use eventTag1 because eventTag0 is used by HWXvMC*/
@@ -704,15 +704,16 @@
 }while(0);
 
 #define ALT_STATUS_WORD0 (* (volatile GLuint *)(imesa->MMIO_BASE+0x48c60))
+#define STATUS_WORD0  (* (volatile GLuint *)(imesa->MMIO_BASE+0x48c00))
 
 #define PAGE_PENDING(result) do{\
-result=((ALT_STATUS_WORD0 & 0x08000000)?GL_TRUE:GL_FALSE);\
+result=((STATUS_WORD0 & 0x08000000)?GL_TRUE:GL_FALSE);\
 }while(0)
 
 #define WAIT_FOR_FIFO(count) do{\
 int loop = 0; \
 int slots = MAXFIFO-count; \
-while(((ALT_STATUS_WORD0 &0x001fffff)>slots)&&(loop++<MAXLOOP)); \
+while(((STATUS_WORD0 &0x001ffff)>slots)&&(loop++<MAXLOOP)); \
 }while(0)
 
 
@@ -724,7 +725,7 @@
    }\
  else\
    { \
-     while(((ALT_STATUS_WORD0 &0x00ffffff)!=0x00E00000L)&&(loop++<MAXLOOP));\
+     while(((STATUS_WORD0 &0x0061ffff)!=0x00600000L)&&(loop++<MAXLOOP));\
    }\
 }while(0)
 
@@ -733,7 +734,7 @@
 if (imesa->shadowStatus)\
  while((((*imesa->shadowPointer) & 0x0E000000L)!=0x0E000000L)&&(loop++<MAXLOOP));\
 else\
-while(((ALT_STATUS_WORD0 &0x00E00000)!=0x00E00000L)&&(loop++<MAXLOOP)); \
+while(((STATUS_WORD0 &0x00E00000)!=0x00E00000L)&&(loop++<MAXLOOP)); \
 }while(0)
 
 
--- ./savage_xmesa.c.~1.1.4.2.~ 2003-12-29 02:01:13.000000000 +0100
+++ ./savage_xmesa.c    2004-01-18 00:58:19.000000000 +0100
@@ -661,6 +661,7 @@
       
       imesa->driReadable = driReadPriv;
       imesa->driDrawable = driDrawPriv;
+      imesa->mesa_drawable = driDrawPriv;
       imesa->dirty = ~0;
       
       _mesa_make_current2(imesa->glCtx,
--- ./savagedma.h.~1.1.4.2.~    2003-12-29 02:28:37.000000000 +0100
+++ ./savagedma.h       2004-01-17 17:00:09.000000000 +0100
@@ -27,7 +27,7 @@
 #define SAVAGEDMA
 
 /* Whether use DMA to transfer the 3d commands and data */
-#define SAVAGE_CMD_DMA 1
+#define SAVAGE_CMD_DMA 0
 
 #define DMA_BUFFER_SIZE (4*1024*1024) /*4M*/
 #define MAX_DMA_BUFFER_SIZE (16*1024*1024)
--- ./savageioctl.c.~1.1.4.5.~  2004-01-11 12:08:16.000000000 +0100
+++ ./savageioctl.c     2004-01-18 00:18:44.000000000 +0100
@@ -200,7 +200,6 @@
     
     else
     {  /* Use bitblt copy from back to front buffer*/
-        
         for (i = 0 ; i < nbox; i++, pbox++)
         {
             unsigned int w = pbox->x2 - pbox->x1;
@@ -366,7 +365,6 @@
    }
    }
    UNLOCK_HARDWARE( imesa );
-   
 
 }
 
--- ./savagecontext.h.~1.1.4.3.~        2004-01-16 00:09:41.000000000 +0100
+++ ./savagecontext.h   2004-01-17 23:14:10.000000000 +0100
@@ -57,6 +57,7 @@
 #define SAVAGE_FALLBACK_STENCIL        0x80
 
 #define SAVAGE_FALLBACK_RENDERMODE     0x100
+#define SAVAGE_FALLBACK_DISABLE        0x200
 
 
 #define HW_STENCIL 1
--- ./savagetris.c.~1.1.4.3.~   2004-01-16 00:09:42.000000000 +0100
+++ ./savagetris.c      2004-01-18 00:32:26.000000000 +0100
@@ -205,7 +205,7 @@
    imesa->DrawPrimitiveCmd &=
        ~(SAVAGE_HW_TRIANGLE_TYPE | SAVAGE_HW_TRIANGLE_CONT);
    WRITE_CMD(vb, SAVAGE_DRAW_PRIMITIVE(6, imesa->DrawPrimitiveCmd, 0),GLuint);
- 
+
    vb = savage_send_one_vertex(imesa, v0, vb, 0, vertsize);
    vb = savage_send_one_vertex(imesa, v1, vb, 0, vertsize);
    vb = savage_send_one_vertex(imesa, v3, vb, 0, vertsize);
@@ -652,6 +652,8 @@
 {
    savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
 
+   FALLBACK (ctx, SAVAGE_FALLBACK_DISABLE, GL_TRUE);
+
    if (imesa->new_state)
       savageDDUpdateHwState( ctx );
 
@@ -666,6 +668,8 @@
    }
 
    _tnl_run_pipeline( ctx );
+
+   FALLBACK (ctx, SAVAGE_FALLBACK_DISABLE, GL_FALSE);
 }
 
 /**********************************************************************/

Reply via email to