Merge branch 'master' of git+ssh://znh@git.freedesktop.org/git/mesa/mesa
[mesa.git] / src / mesa / drivers / dri / ffb / ffb_fifo.h
1 /* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_fifo.h,v 1.2 2002/02/22 21:32:58 dawes Exp $ */
2
3 #ifndef _FFB_FIFO_H
4 #define _FFB_FIFO_H
5
6 #define FFBFifo(__fmesa, __n) \
7 do { ffbScreenPrivate *__fScrn = (__fmesa)->ffbScreen; \
8 int __cur_slots = __fScrn->fifo_cache; \
9 if ((__cur_slots - (__n)) < 0) { \
10 ffb_fbcPtr __ffb = __fmesa->regs; \
11 do { __cur_slots = (((int)__ffb->ucsr & FFB_UCSR_FIFO_MASK) - 4); \
12 } while ((__cur_slots - (__n)) < 0); \
13 } (__fScrn)->fifo_cache = (__cur_slots - (__n)); \
14 } while(0)
15
16 #define FFBWait(__fmesa, __ffb) \
17 do { ffbScreenPrivate *__fScrn = (__fmesa)->ffbScreen; \
18 if (__fScrn->rp_active) { \
19 unsigned int __regval = (__ffb)->ucsr; \
20 while((__regval & FFB_UCSR_ALL_BUSY) != 0) { \
21 __regval = (__ffb)->ucsr; \
22 } \
23 __fScrn->fifo_cache = ((int)(__regval & FFB_UCSR_FIFO_MASK)) - 4; \
24 __fScrn->rp_active = 0; \
25 } \
26 } while(0)
27
28 #endif /* !(_FFB_FIFO_H) */