GLboolean nouveauFifoInit(nouveauContextPtr nmesa)
{
drm_nouveau_fifo_alloc_t fifo_init;
+ int i;
#ifdef NOUVEAU_RING_DEBUG
return GL_TRUE;
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;
}
}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)