More FIFO fixes.

This commit is contained in:
Ben Skeggs
2006-11-19 15:45:36 +00:00
parent 08a0946fcc
commit b3fd1556f9
2 changed files with 8 additions and 2 deletions
@@ -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;
}
+3 -2
View File
@@ -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)