summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/ffb/ffb_fifo.h
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@tungstengraphics.com>2003-12-04 13:38:06 +0000
committerAlan Hourihane <alanh@tungstengraphics.com>2003-12-04 13:38:06 +0000
commit13e6a4849c6800eac454fd1010cb2320874f2ed6 (patch)
treec311173244771131a63ba18318be645b4534521c /src/mesa/drivers/dri/ffb/ffb_fifo.h
parent15af25aca0ed6a2390fe9e0d91055cfc01134ce2 (diff)
add SPARC ffb DRI driver
Diffstat (limited to 'src/mesa/drivers/dri/ffb/ffb_fifo.h')
-rw-r--r--src/mesa/drivers/dri/ffb/ffb_fifo.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/ffb/ffb_fifo.h b/src/mesa/drivers/dri/ffb/ffb_fifo.h
new file mode 100644
index 0000000000..886d71b76e
--- /dev/null
+++ b/src/mesa/drivers/dri/ffb/ffb_fifo.h
@@ -0,0 +1,28 @@
+/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_fifo.h,v 1.2 2002/02/22 21:32:58 dawes Exp $ */
+
+#ifndef _FFB_FIFO_H
+#define _FFB_FIFO_H
+
+#define FFBFifo(__fmesa, __n) \
+do { ffbScreenPrivate *__fScrn = (__fmesa)->ffbScreen; \
+ int __cur_slots = __fScrn->fifo_cache; \
+ if ((__cur_slots - (__n)) < 0) { \
+ ffb_fbcPtr __ffb = __fmesa->regs; \
+ do { __cur_slots = (((int)__ffb->ucsr & FFB_UCSR_FIFO_MASK) - 4); \
+ } while ((__cur_slots - (__n)) < 0); \
+ } (__fScrn)->fifo_cache = (__cur_slots - (__n)); \
+} while(0)
+
+#define FFBWait(__fmesa, __ffb) \
+do { ffbScreenPrivate *__fScrn = (__fmesa)->ffbScreen; \
+ if (__fScrn->rp_active) { \
+ unsigned int __regval = (__ffb)->ucsr; \
+ while((__regval & FFB_UCSR_ALL_BUSY) != 0) { \
+ __regval = (__ffb)->ucsr; \
+ } \
+ __fScrn->fifo_cache = ((int)(__regval & FFB_UCSR_FIFO_MASK)) - 4; \
+ __fScrn->rp_active = 0; \
+ } \
+} while(0)
+
+#endif /* !(_FFB_FIFO_H) */