On Sat, 17 Jan 2004 17:52:07 -0800 (PST)
Alex Deucher <[EMAIL PROTECTED]> wrote:
>
> --- Felix K_hling <[EMAIL PROTECTED]> wrote:
> > 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.
> >
>
> Nice work Felix! I'll look into it either tomorrow or Monday,
> depending on how busy I am.
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.
This proves that clearing and buffer swapping work. I'll see if I can
fix waiting for idle. The way it's done right now is quite ugly. It
waits for the engine to go idle globally. The Utah driver is much nicer.
It inserts an event in the command queue and waits for that event, so
other applications can't interfere.
>
> Alex
>
Felix
--- ./savage_dri.c.~1.1.6.7.~ 2004-01-16 00:10:01.000000000 +0100
+++ ./savage_dri.c 2004-01-18 15:43:19.000000000 +0100
@@ -1456,6 +1456,10 @@
value |= ((psav->l3DDelta / 4) >> 5) << 24; /* I assume
psav->l3DDelta for 3D */
value |= 3<<30;
}
+
+ OUTREG(0x48C40, value|(pSAVAGEDRI->frontOffset) ); /* front */
+ OUTREG(0x48C44, value|(pSAVAGEDRI->backOffset) ); /* back */
+ OUTREG(0x48C48, value|(pSAVAGEDRI->depthOffset) ); /* depth */
} else {
if(pSAVAGEDRI->cpp == 2)
{
@@ -1465,11 +1469,11 @@
value |= (((pSAVAGEDRI->width + 0x1F) & 0xFFE0) >> 5) << 20;
value |= 3<<30;
}
- }
- OUTREG(0x48C40, value|(pSAVAGEDRI->frontOffset >> 5) ); /* front */
- OUTREG(0x48C44, value|(pSAVAGEDRI->backOffset >> 5) ); /* back */
- OUTREG(0x48C48, value|(pSAVAGEDRI->depthOffset >> 5) ); /* depth */
+ OUTREG(0x48C40, value|(pSAVAGEDRI->frontOffset >> 5) ); /* front */
+ OUTREG(0x48C44, value|(pSAVAGEDRI->backOffset >> 5) ); /* back */
+ OUTREG(0x48C48, value|(pSAVAGEDRI->depthOffset >> 5) ); /* depth */
+ }
}
pSAVAGEDRI->registers.handle = pSAVAGEDRIServer->registers.handle;
? DONE
? Makefile
Index: savage_bci.h
===================================================================
RCS file: /cvs/dri/xc/xc/lib/GL/mesa/src/drv/savage/Attic/savage_bci.h,v
retrieving revision 1.1.4.2
diff -u -r1.1.4.2 savage_bci.h
--- savage_bci.h 29 Dec 2003 01:47:57 -0000 1.1.4.2
+++ savage_bci.h 18 Jan 2004 15:12:48 -0000
@@ -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)
Index: savagecontext.h
===================================================================
RCS file: /cvs/dri/xc/xc/lib/GL/mesa/src/drv/savage/Attic/savagecontext.h,v
retrieving revision 1.1.4.3
diff -u -r1.1.4.3 savagecontext.h
--- savagecontext.h 29 Dec 2003 01:47:57 -0000 1.1.4.3
+++ savagecontext.h 18 Jan 2004 15:12:51 -0000
@@ -57,6 +57,7 @@
#define SAVAGE_FALLBACK_STENCIL 0x80
#define SAVAGE_FALLBACK_RENDERMODE 0x100
+#define SAVAGE_FALLBACK_DISABLE 0x200
#define HW_STENCIL 1
Index: savagedma.h
===================================================================
RCS file: /cvs/dri/xc/xc/lib/GL/mesa/src/drv/savage/Attic/savagedma.h,v
retrieving revision 1.1.4.2
diff -u -r1.1.4.2 savagedma.h
--- savagedma.h 29 Dec 2003 01:47:57 -0000 1.1.4.2
+++ savagedma.h 18 Jan 2004 15:12:51 -0000
@@ -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)
Index: savagetris.c
===================================================================
RCS file: /cvs/dri/xc/xc/lib/GL/mesa/src/drv/savage/Attic/savagetris.c,v
retrieving revision 1.1.4.3
diff -u -r1.1.4.3 savagetris.c
--- savagetris.c 29 Dec 2003 01:47:57 -0000 1.1.4.3
+++ savagetris.c 18 Jan 2004 15:12:52 -0000
@@ -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);
}
/**********************************************************************/