1301ea0f4Smrg
2301ea0f4Smrg/**************************************************************************
3301ea0f4Smrg
4301ea0f4SmrgCopyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
5301ea0f4SmrgAll Rights Reserved.
6301ea0f4Smrg
7301ea0f4SmrgPermission is hereby granted, free of charge, to any person obtaining a
8301ea0f4Smrgcopy of this software and associated documentation files (the
9301ea0f4Smrg"Software"), to deal in the Software without restriction, including
10301ea0f4Smrgwithout limitation the rights to use, copy, modify, merge, publish,
11301ea0f4Smrgdistribute, sub license, and/or sell copies of the Software, and to
12301ea0f4Smrgpermit persons to whom the Software is furnished to do so, subject to
13301ea0f4Smrgthe following conditions:
14301ea0f4Smrg
15301ea0f4SmrgThe above copyright notice and this permission notice (including the
16301ea0f4Smrgnext paragraph) shall be included in all copies or substantial portions
17301ea0f4Smrgof the Software.
18301ea0f4Smrg
19301ea0f4SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20301ea0f4SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21301ea0f4SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22301ea0f4SmrgIN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
23301ea0f4SmrgANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24301ea0f4SmrgTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25301ea0f4SmrgSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26301ea0f4Smrg
27301ea0f4Smrg**************************************************************************/
28301ea0f4Smrg
29301ea0f4Smrg/*
30301ea0f4Smrg * Authors:
31301ea0f4Smrg *   Kevin E. Martin <kevin@precisioninsight.com>
32301ea0f4Smrg *
33301ea0f4Smrg */
34301ea0f4Smrg
35301ea0f4Smrg#include "xf86fbman.h"
36301ea0f4Smrg
37301ea0f4Smrg
38301ea0f4Smrg#define	WAIT_ENGINE_IDLE_PIO() {					\
39301ea0f4Smrg	    outb(XRX, BITBLT_CNTL);					\
40301ea0f4Smrg	    while (inb(XRX+1) & BITBLT_STATUS)				\
41301ea0f4Smrg		outb(XRX, BITBLT_CNTL);					\
42301ea0f4Smrg	}
43301ea0f4Smrg
44301ea0f4Smrg#define	WAIT_ENGINE_IDLE_MMIO() {					\
45301ea0f4Smrg	    moutb(XRX, BITBLT_CNTL);					\
46301ea0f4Smrg	    while (minb(XRX+1) & BITBLT_STATUS)				\
47301ea0f4Smrg		moutb(XRX, BITBLT_CNTL);				\
48301ea0f4Smrg	}
49301ea0f4Smrg
50301ea0f4Smrg#define WAIT_BLT_IDLE() {						\
51301ea0f4Smrg	    while (INREG(BITBLT_CONTROL) & BLTR_STATUS);		\
52301ea0f4Smrg	}
53301ea0f4Smrg
54301ea0f4Smrg#define WAIT_LP_FIFO(n) {						\
55301ea0f4Smrg	    while (INREG8(LP_FIFO_COUNT) > 15-(n));			\
56301ea0f4Smrg	}
57301ea0f4Smrg
58301ea0f4Smrg#define WAIT_HP_FIFO(n) {						\
59301ea0f4Smrg	    while (INREG8(HP_FIFO_COUNT) > 15-(n));			\
60301ea0f4Smrg	}
61