neo_macros.h revision 692f60a7
1692f60a7Smrg/**********************************************************************
2692f60a7SmrgCopyright 1998, 1999 by Precision Insight, Inc., Cedar Park, Texas.
3692f60a7Smrg
4692f60a7Smrg                        All Rights Reserved
5692f60a7Smrg
6692f60a7SmrgPermission to use, copy, modify, distribute, and sell this software and
7692f60a7Smrgits documentation for any purpose is hereby granted without fee,
8692f60a7Smrgprovided that the above copyright notice appear in all copies and that
9692f60a7Smrgboth that copyright notice and this permission notice appear in
10692f60a7Smrgsupporting documentation, and that the name of Precision Insight not be
11692f60a7Smrgused in advertising or publicity pertaining to distribution of the
12692f60a7Smrgsoftware without specific, written prior permission.  Precision Insight
13692f60a7Smrgand its suppliers make no representations about the suitability of this
14692f60a7Smrgsoftware for any purpose.  It is provided "as is" without express or
15692f60a7Smrgimplied warranty.
16692f60a7Smrg
17692f60a7SmrgPRECISION INSIGHT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
18692f60a7SmrgINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
19692f60a7SmrgEVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
20692f60a7SmrgSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
21692f60a7SmrgRESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
22692f60a7SmrgCONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
23692f60a7SmrgCONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24692f60a7Smrg**********************************************************************/
25692f60a7Smrg/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_macros.h,v 1.1 1999/04/17 07:06:27 dawes Exp $ */
26692f60a7Smrg
27692f60a7Smrg/*
28692f60a7Smrg * The original Precision Insight driver for
29692f60a7Smrg * XFree86 v.3.3 has been sponsored by Red Hat.
30692f60a7Smrg *
31692f60a7Smrg * Authors:
32692f60a7Smrg *   Jens Owen (jens@tungstengraphics.com)
33692f60a7Smrg *   Kevin E. Martin (kevin@precisioninsight.com)
34692f60a7Smrg *
35692f60a7Smrg * Port to Xfree86 v.4.0
36692f60a7Smrg *   1998, 1999 by Egbert Eich (Egbert.Eich@Physik.TU-Darmstadt.DE)
37692f60a7Smrg */
38692f60a7Smrg
39692f60a7Smrg#define WAIT_FB_FIFO_EMPTY() {                                              \
40692f60a7Smrg            while( INREG(NEOREG_BLTSTAT) & NEO_BS0_FIFO_PEND);              \
41692f60a7Smrg        }
42692f60a7Smrg
43692f60a7Smrg#define WAIT_BLT_DONE() {                                                   \
44692f60a7Smrg            while( INREG(NEOREG_BLTSTAT) & NEO_BS0_BLT_BUSY);               \
45692f60a7Smrg        }
46692f60a7Smrg
47692f60a7Smrg#define WAIT_ENGINE_IDLE() {                                                \
48692f60a7Smrg	    WAIT_BLT_DONE();                                                \
49692f60a7Smrg        }
50692f60a7Smrg
51692f60a7Smrg#ifdef NOT_DONE
52692f60a7Smrg#define WAIT_FIFO(n) {                                                      \
53692f60a7Smrg	    while( NeoFifoCount < (n)) {                                    \
54692f60a7Smrg		NeoFifoCount = (INREG(NEOREG_BLTSTAT) >> 8);                \
55692f60a7Smrg	    }                                                               \
56692f60a7Smrg	    NeoFifoCount -= (n);                                            \
57692f60a7Smrg        }
58692f60a7Smrg#else
59692f60a7Smrg#define WAIT_FIFO(n) {                                                      \
60692f60a7Smrg	    WAIT_ENGINE_IDLE();                                             \
61692f60a7Smrg        }
62692f60a7Smrg#endif
63692f60a7Smrg
64