mesa: Branch 'master' - 4 commits

Stephane Marchesin marcheu at kemper.freedesktop.org
Sat Mar 10 00:26:23 UTC 2007


 src/mesa/drivers/dri/nouveau/nouveau_fifo.c |    4 ++++
 src/mesa/drivers/dri/nouveau/nouveau_fifo.h |   20 ++++++++++++++++++--
 src/mesa/drivers/dri/nouveau/nv04_state.c   |   28 +++++++++++++++-------------
 src/mesa/drivers/dri/nouveau/nv04_swtcl.c   |    2 +-
 4 files changed, 38 insertions(+), 16 deletions(-)

New commits:
diff-tree 4f12b37a56b0f90d7beb248c5d3bee7600c24c14 (from 581a5940339af8b2cdd7497228d22fcf47269592)
Author: Stephane Marchesin <marchesin at icps.u-strasbg.fr>
Date:   Sat Mar 10 01:25:51 2007 +0100

    nouveau: fix the nv04 swtcl code.

diff --git a/src/mesa/drivers/dri/nouveau/nv04_swtcl.c b/src/mesa/drivers/dri/nouveau/nv04_swtcl.c
index 9b5332b..a9c9c6e 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_swtcl.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_swtcl.c
@@ -503,7 +503,7 @@ static inline void nv04OutputVertexForma
 	nmesa->vertex_size=_tnl_install_attrs( ctx,
 			nmesa->vertex_attrs, 
 			nmesa->vertex_attr_count,
-			ctx->Viewport._WindowMap.m, 0 );
+			nmesa->viewport.m, 0 );
 }
 
 
diff-tree 581a5940339af8b2cdd7497228d22fcf47269592 (from df1c3ff3ddaeee2dd32f0c3f7c298142c41982ff)
Author: Stephane Marchesin <marchesin at icps.u-strasbg.fr>
Date:   Sat Mar 10 01:24:32 2007 +0100

    nouveau: oops don't debug by default.

diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fifo.h b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
index 0d85a94..23325dc 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
@@ -34,7 +34,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "nouveau_state_cache.h"
 
 //#define NOUVEAU_RING_TRACE
-#define NOUVEAU_RING_DEBUG
+//#define NOUVEAU_RING_DEBUG
 //#define NOUVEAU_STATE_CACHE_DISABLE
 
 #ifndef NOUVEAU_RING_TRACE
diff-tree df1c3ff3ddaeee2dd32f0c3f7c298142c41982ff (from e61f674844afeae7bd5ff17084a46b7215401275)
Author: Stephane Marchesin <marchesin at icps.u-strasbg.fr>
Date:   Sat Mar 10 01:23:40 2007 +0100

    nouveau: some fixes to the nv04 state code.

diff --git a/src/mesa/drivers/dri/nouveau/nv04_state.c b/src/mesa/drivers/dri/nouveau/nv04_state.c
index 4129ecc..25df3d2 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_state.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_state.c
@@ -455,35 +455,37 @@ static GLboolean nv04BindBuffers(nouveau
 		nouveau_renderbuffer *depth)
 {
 	GLuint x, y, w, h;
+	uint32_t depth_pitch=(depth?depth->pitch:0+15)&~15+16;
+	if (depth_pitch<256) depth_pitch=256;
 
 	w = color[0]->mesa.Width;
 	h = color[0]->mesa.Height;
 	x = nmesa->drawX;
 	y = nmesa->drawY;
 
+	BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_FORMAT, 1);
+	if (color[0]->mesa._ActualFormat == GL_RGBA8)
+		OUT_RING(0x108/*A8R8G8B8*/);
+	else
+		OUT_RING(0x103/*R5G6B5*/);
+
 	/* FIXME pitches have to be aligned ! */
 	BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_PITCH, 2);
-	OUT_RING(color[0]->pitch|(depth?(depth->pitch<<16):0));
+	OUT_RING(color[0]->pitch|(depth_pitch<<16));
 	OUT_RING(color[0]->offset);
-
 	if (depth) {
 		BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_OFFSET_ZETA, 1);
 		OUT_RING(depth->offset);
 	}
 
-	BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_CLIP_HORIZONTAL, 2);
-	OUT_RING((w<<16)|x);
-	OUT_RING((h<<16)|y);
+//	BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_CLIP_HORIZONTAL, 2);
+//	OUT_RING((w<<16)|x);
+//	OUT_RING((h<<16)|y);
 
-	/* FIXME not sure... */
-	BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_CLIP_SIZE, 1);
-	OUT_RING((h<<16)|w);
 
-	BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_FORMAT, 1);
-	if (color[0]->mesa._ActualFormat == GL_RGBA8)
-		OUT_RING(108/*A8R8G8B8*/);
-	else
-		OUT_RING(103/*R5G6B5*/);
+	/* FIXME not sure... */
+/*	BEGIN_RING_SIZE(NvSubCtxSurf3D, NV04_CONTEXT_SURFACES_3D_CLIP_SIZE, 1);
+	OUT_RING((h<<16)|w);*/
 
 	return GL_TRUE;
 }
diff-tree e61f674844afeae7bd5ff17084a46b7215401275 (from 30b914e2ca28cd44eed57b34353e641793b38a6d)
Author: Stephane Marchesin <marchesin at icps.u-strasbg.fr>
Date:   Sat Mar 10 01:23:14 2007 +0100

    nouveau: add a fifo size debug check.

diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fifo.c b/src/mesa/drivers/dri/nouveau/nouveau_fifo.c
index 7af9f1e..67b5aa4 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fifo.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fifo.c
@@ -38,6 +38,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "nouveau_object.h"
 #include "nouveau_sync.h"
 
+#ifdef NOUVEAU_RING_DEBUG
+int nouveau_fifo_remaining=0;
+#endif
+
 
 #define RING_SKIPS 8
 
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fifo.h b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
index 490089f..0d85a94 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
@@ -34,7 +34,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "nouveau_state_cache.h"
 
 //#define NOUVEAU_RING_TRACE
-//#define NOUVEAU_RING_DEBUG
+#define NOUVEAU_RING_DEBUG
 //#define NOUVEAU_STATE_CACHE_DISABLE
 
 #ifndef NOUVEAU_RING_TRACE
@@ -74,17 +74,33 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #ifdef NOUVEAU_RING_DEBUG
 
+extern int nouveau_fifo_remaining;
+
 #define OUT_RINGp(ptr,sz) do {                                                  \
 uint32_t* p=(uint32_t*)(ptr);							\
 int i; printf("OUT_RINGp: (size 0x%x dwords)\n",sz); for(i=0;i<sz;i++) printf(" 0x%08x   %f\n", *(p+i), *((float*)(p+i))); 	\
+nouveau_fifo_remaining-=sz;							\
 }while(0)
 
 #define OUT_RING(n) do {                                                        \
     printf("OUT_RINGn: 0x%08x (%s)\n", n, __func__);                            \
+    nouveau_fifo_remaining--;							\
 }while(0)
 
 #define OUT_RINGf(n) do {                                                       \
     printf("OUT_RINGf: %.04f (%s)\n", n, __func__);                             \
+    nouveau_fifo_remaining--;							\
+}while(0)
+
+#define BEGIN_RING_SIZE(subchannel,tag,size) do {					\
+	if (nouveau_fifo_remaining!=0)							\
+		printf("RING ERROR : remaining %d\n",nouveau_fifo_remaining);		\
+	nouveau_state_cache_flush(nmesa);						\
+	if (nmesa->fifo.free <= (size))							\
+		WAIT_RING(nmesa,(size));						\
+	OUT_RING( ((size)<<18) | ((subchannel) << 13) | (tag));				\
+	nmesa->fifo.free -= ((size) + 1);                                               \
+	nouveau_fifo_remaining=size;							\
 }while(0)
 
 #else
@@ -110,8 +126,6 @@ if (NOUVEAU_RING_TRACE) \
 *((float*)(nmesa->fifo.buffer+nmesa->fifo.current++))=(n);			\
 }while(0)
 
-#endif
-
 #define BEGIN_RING_SIZE(subchannel,tag,size) do {					\
 	nouveau_state_cache_flush(nmesa);						\
 	if (nmesa->fifo.free <= (size))							\
@@ -120,6 +134,8 @@ if (NOUVEAU_RING_TRACE) \
 	nmesa->fifo.free -= ((size) + 1);                                               \
 }while(0)
 
+#endif
+
 extern void WAIT_RING(nouveauContextPtr nmesa,u_int32_t size);
 extern void nouveau_state_cache_flush(nouveauContextPtr nmesa);
 extern void nouveau_state_cache_init(nouveauContextPtr nmesa);



More information about the mesa-commit mailing list