From b3fd1556f9e94d6d6f6d3933c404fc37aec7b1a3 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sun, 19 Nov 2006 15:45:36 +0000 Subject: More FIFO fixes. --- src/mesa/drivers/dri/nouveau/nouveau_fifo.c | 5 +++++ 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; ififo.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.freefifo.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) -- cgit v1.2.3