summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2006-11-19 15:45:36 +0000
committerBen Skeggs <[email protected]>2006-11-19 15:45:36 +0000
commitb3fd1556f9e94d6d6f6d3933c404fc37aec7b1a3 (patch)
treec403110a86e41e185fb5112f89eb886eb52760d2
parent08a0946fcc51a0980d1d7a06e11d72ef71efafcf (diff)
More FIFO fixes.
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_fifo.c5
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_fifo.h5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fifo.c b/src/mesa/drivers/dri/nouveau/nouveau_fifo.c
index 8d2e88b1f34..9fac6a48dfc 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fifo.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fifo.c
@@ -112,6 +112,7 @@ void nouveauWaitForIdle(nouveauContextPtr nmesa)
GLboolean nouveauFifoInit(nouveauContextPtr nmesa)
{
drm_nouveau_fifo_alloc_t fifo_init;
+ int i;
#ifdef NOUVEAU_RING_DEBUG
return GL_TRUE;
@@ -140,6 +141,10 @@ GLboolean nouveauFifoInit(nouveauContextPtr nmesa)
nmesa->fifo.max = (fifo_init.cmdbuf_size >> 2) - 1;
nmesa->fifo.free = nmesa->fifo.max - nmesa->fifo.current;
+ for (i=0; i<RING_SKIPS; i++)
+ OUT_RING(0);
+ nmesa->fifo.free -= RING_SKIPS;
+
MESSAGE("Fifo init ok. Using context %d\n", fifo_init.channel);
return GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fifo.h b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
index 58fb378c39a..c5e5d6934fe 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
@@ -100,9 +100,10 @@ extern void WAIT_RING(nouveauContextPtr nmesa,u_int32_t size);
}while(0)
#define BEGIN_RING_SIZE(subchannel,tag,size) do { \
- if (nmesa->fifo.free<size) \
+ if (nmesa->fifo.free <= (size)) \
WAIT_RING(nmesa,(size)); \
- OUT_RING( (size<<18) | ((subchannel) << 13) | (tag)); \
+ OUT_RING( ((size)<<18) | ((subchannel) << 13) | (tag)); \
+ nmesa->fifo.free -= ((size) + 1); \
}while(0)
#define RING_AVAILABLE() (nmesa->fifo.free-1)