On Sun, 18 Jan 2004 16:16:13 +0100
Felix Kühling <[EMAIL PROTECTED]> wrote:

[snip]
> I found it. :) Comparison with the Utah driver helped once more. I'm
> attaching two new patches, one for the 2D driver, one for the 3D driver.
> They are against the latest savage-2-0-0-branch. With them fallbacks
> work, except, waiting for idle doesn't seem to work quite right yet.
> E.g. some polygons flicker in gears.

Fixed this one too. I attached an updated patch for the 3D part for
savage IX. It's against the unpatched branch. This is as far as I'm
going to get this weekend.

A more detailed look at the 3D register definitions of Savage4 and
SavageIX revealed that they differ a lot. It's going to take a rewrite
of savagestate.c to get something that works with both chips and doesn't
look too messy. I'm going to work on it as time permits. Usually that
ends up being more time than I was going to spend in the first place
;-). But it may take a few weeks anyway.

Regards,
  Felix
--- ./savage_bci.h.~1.1.4.2.~   2003-12-29 02:02:07.000000000 +0100
+++ ./savage_bci.h      2004-01-18 22:28:56.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 &0x000fffff)!=0x000e0000L)&&(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)
 
 
--- ./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)
--- ./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 16:02:22.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