aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2006-11-17 04:50:37 +0000
committerBen Skeggs <[email protected]>2006-11-17 04:50:37 +0000
commit10172f7485367182a5745a2114ed7e90830682f8 (patch)
tree263ecb2026b64b05a1612120f40fc3b445512844 /src/mesa/drivers/dri/nouveau/nouveau_fifo.h
parent9daf0812a15ed7df0e3a329019290faed58d21ef (diff)
Adapt FIFO code to deal with cases where the base GET/PUT value isn't 0.
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_fifo.h')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_fifo.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fifo.h b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
index 0edb083388f..c1e9fd5dc53 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
@@ -38,6 +38,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NV_FIFO_READ(reg) *(volatile u_int32_t *)(nmesa->fifo.mmio + (reg))
#define NV_FIFO_WRITE(reg,value) *(volatile u_int32_t *)(nmesa->fifo.mmio + (reg)) = value;
+#define NV_FIFO_READ_GET() ((NV_FIFO_READ(NV03_FIFO_REGS_DMAGET) - nmesa->fifo.put_base) >> 2)
+#define NV_FIFO_WRITE_PUT(val) NV_FIFO_WRITE(NV03_FIFO_REGS_DMAPUT, ((val)<<2) + nmesa->fifo.put_base)
/*
* Ring/fifo interface
@@ -107,11 +109,11 @@ extern void WAIT_RING(nouveauContextPtr nmesa,u_int32_t size);
#define RING_AHEAD() ((nmesa->fifo.put<=nmesa->fifo.current)?(nmesa->fifo.current-nmesa->fifo.put):nmesa->fifo.max-nmesa->fifo.put+nmesa->fifo.current)
-#define FIRE_RING() do { \
- if (nmesa->fifo.current!=nmesa->fifo.put) {\
- nmesa->fifo.put=nmesa->fifo.current;\
- NV_FIFO_WRITE(NV03_FIFO_REGS_DMAPUT,nmesa->fifo.put);\
- }\
+#define FIRE_RING() do { \
+ if (nmesa->fifo.current!=nmesa->fifo.put) { \
+ nmesa->fifo.put=nmesa->fifo.current; \
+ NV_FIFO_WRITE_PUT(nmesa->fifo.put); \
+ } \
}while(0)
extern void nouveauWaitForIdle(nouveauContextPtr nmesa);