Mesa compiles now in dri/nouveau (without compiler warnings).

1. Do the same as Ben Skeggs did with commit "nouveau: fix for latest libdrm" 
on Gallium
2. "chan->pushbuf->remaining" is now "chan->end - chan->cur" (see libdrm commit 
"nouveau: interface changes for 0.0.16 DRM")
3. Compiled successfully for openSUSE 11.2 and Factory (i586 and x86_64)
4. Tested with my GeForce2 GTS (NV15)
4.1 glxinfo tells that it is accelerated
4.2 glxinfo ~1000 FPS (without screen corruption)
4.3 kubrick has screen corruption (gray cubies and horizontal lines) and makes 
system so slow that I must press reset button. I do not know whether it was 
before because my main card is a GeForce 5600FX (NV31) and I installed my NV15 
only a few minutes for testing this patch...

Please commit it if it is proper...
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c b/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c
index 664632f..fc5f77b 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c
@@ -32,7 +32,6 @@ nouveau_bo_marker_emit(GLcontext *ctx, struct nouveau_bo_marker *m,
 		       uint32_t flags)
 {
 	struct nouveau_channel *chan = context_chan(ctx);
-	struct nouveau_pushbuf *push = chan->pushbuf;
 	uint32_t packet;

 	if (m->gr->bound == NOUVEAU_GROBJ_UNBOUND)
@@ -41,11 +40,10 @@ nouveau_bo_marker_emit(GLcontext *ctx, struct nouveau_bo_marker *m,
 	if (MARK_RING(chan, 2, 2))
 		return GL_FALSE;

-	push->remaining -= 2;
 	packet = (m->gr->subc << 13) | (1 << 18) | m->mthd;

 	if (flags) {
-		if (nouveau_pushbuf_emit_reloc(chan, push->cur++, m->bo,
+		if (nouveau_pushbuf_emit_reloc(chan, chan->cur++, m->bo,
 					       packet, 0, flags |
 					       (m->flags & (NOUVEAU_BO_VRAM |
 							    NOUVEAU_BO_GART |
@@ -53,10 +51,10 @@ nouveau_bo_marker_emit(GLcontext *ctx, struct nouveau_bo_marker *m,
 					       0, 0))
 			goto fail;
 	} else {
-		*(push->cur++) = packet;
+		*(chan->cur++) = packet;
 	}

-	if (nouveau_pushbuf_emit_reloc(chan, push->cur++, m->bo, m->data,
+	if (nouveau_pushbuf_emit_reloc(chan, chan->cur++, m->bo, m->data,
 				       m->data2, flags | m->flags,
 				       m->vor, m->tor))
 		goto fail;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_swtnl_t.c b/src/mesa/drivers/dri/nouveau/nouveau_swtnl_t.c
index 8fa922f..9abaa90 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_swtnl_t.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_swtnl_t.c
@@ -210,7 +210,7 @@ swtnl_flush_vertices(GLcontext *ctx)
 	swtnl_bind_vertices(ctx);

 	while (count) {
-		push = get_max_vertices(ctx, NULL, chan->pushbuf->remaining);
+		push = get_max_vertices(ctx, NULL, chan->end - chan->cur);
 		push = MIN2(push / 12 * 12, count);
 		count -= push;

diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
index ba1192a..35a7c43 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
@@ -319,7 +319,7 @@ vbo_draw_vbo(GLcontext *ctx, const struct gl_client_array **arrays,
 					  min_index, max_index);
 		}

-		if (count > get_max_vertices(ctx, ib, chan->pushbuf->remaining))
+		if (count > get_max_vertices(ctx, ib, chan->end - chan->cur))
 			WAIT_RING(chan, PUSHBUF_DWORDS);

 		BATCH_BEGIN(nvgl_primitive(prims[i].mode));
@@ -355,7 +355,7 @@ vbo_draw_imm(GLcontext *ctx, const struct gl_client_array **arrays,
 			end = start + prims[i].count;

 		if (prims[i].count > get_max_vertices(ctx, ib,
-						      chan->pushbuf->remaining))
+						      chan->end - chan->cur))
 			WAIT_RING(chan, PUSHBUF_DWORDS);

 		BATCH_BEGIN(nvgl_primitive(prims[i].mode));
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to