diff options
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_fifo.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_fifo.h | 5 |
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 8d2e88b1f3..9fac6a48df 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 58fb378c39..c5e5d6934f 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) |