neo_macros.h revision 54569438
1/********************************************************************** 2Copyright 1998, 1999 by Precision Insight, Inc., Cedar Park, Texas. 3 4 All Rights Reserved 5 6Permission to use, copy, modify, distribute, and sell this software and 7its documentation for any purpose is hereby granted without fee, 8provided that the above copyright notice appear in all copies and that 9both that copyright notice and this permission notice appear in 10supporting documentation, and that the name of Precision Insight not be 11used in advertising or publicity pertaining to distribution of the 12software without specific, written prior permission. Precision Insight 13and its suppliers make no representations about the suitability of this 14software for any purpose. It is provided "as is" without express or 15implied warranty. 16 17PRECISION INSIGHT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 18INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 19EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY 20SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER 21RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF 22CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 23CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 24**********************************************************************/ 25 26/* 27 * The original Precision Insight driver for 28 * XFree86 v.3.3 has been sponsored by Red Hat. 29 * 30 * Authors: 31 * Jens Owen (jens@tungstengraphics.com) 32 * Kevin E. Martin (kevin@precisioninsight.com) 33 * 34 * Port to Xfree86 v.4.0 35 * 1998, 1999 by Egbert Eich (Egbert.Eich@Physik.TU-Darmstadt.DE) 36 */ 37 38#define WAIT_FB_FIFO_EMPTY() { \ 39 while( INREG(NEOREG_BLTSTAT) & NEO_BS0_FIFO_PEND); \ 40 } 41 42#define WAIT_BLT_DONE() { \ 43 while( INREG(NEOREG_BLTSTAT) & NEO_BS0_BLT_BUSY); \ 44 } 45 46#define WAIT_ENGINE_IDLE() { \ 47 WAIT_BLT_DONE(); \ 48 } 49 50#ifdef NOT_DONE 51#define WAIT_FIFO(n) { \ 52 while( NeoFifoCount < (n)) { \ 53 NeoFifoCount = (INREG(NEOREG_BLTSTAT) >> 8); \ 54 } \ 55 NeoFifoCount -= (n); \ 56 } 57#else 58#define WAIT_FIFO(n) { \ 59 WAIT_ENGINE_IDLE(); \ 60 } 61#endif 62 63