First import
[xorg_rtime.git] / xorg-server-1.4 / hw / kdrive / mach64 / mach64draw.h
blobbac11c2a64726a1177a17ccf4ecb945dfd97e39d
1 /*
2 * Copyright © 1999 Keith Packard
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of Keith Packard not be used in
9 * advertising or publicity pertaining to distribution of the software without
10 * specific, written prior permission. Keith Packard makes no
11 * representations about the suitability of this software for any purpose. It
12 * is provided "as is" without express or implied warranty.
14 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20 * PERFORMANCE OF THIS SOFTWARE.
23 #ifndef _TRIDENTDRAW_H_
24 #define _TRIDENTDRAW_H_
26 #define SetupTrident(s) KdScreenPriv(s); \
27 tridentCardInfo(pScreenPriv); \
28 Cop *cop = tridentc->cop
30 #define TridentAlpha (COP_MULTI_ALPHA|COP_ALPHA_WRITE_ENABLE)
32 #define _tridentInit(cop,tridentc) { \
33 if ((cop)->status == 0xffffffff) tridentSetMMIO(tridentc); \
34 (cop)->multi = (tridentc)->cop_depth; \
35 (cop)->multi = (tridentc)->cop_stride; \
36 (cop)->multi = TridentAlpha; \
37 } \
39 #define _tridentSetSolidRect(cop,pix,alu,cmd) {\
40 cop->multi = COP_MULTI_PATTERN; \
41 cop->multi = COP_MULTI_ROP | tridentRop[alu]; \
42 cop->fg = (pix); \
43 cmd = COP_OP_BLT | COP_SCL_OPAQUE | COP_OP_ROP | COP_OP_FG; \
46 #define _tridentRect(cop,x1,y1,x2,y2,cmd) { \
47 (cop)->dst_start_xy = TRI_XY (x1,y1); \
48 (cop)->dst_end_xy = TRI_XY(x2,y2); \
49 _tridentWaitDone(cop); \
50 (cop)->command = (cmd); \
53 #define COP_STATUS_BUSY (COP_STATUS_BE_BUSY | \
54 COP_STATUS_DPE_BUSY | \
55 COP_STATUS_MI_BUSY)
57 #define _tridentWaitDone(cop) { \
58 int __q__ = 500000; \
59 while (__q__-- && (cop)->status & COP_STATUS_BUSY) \
60 ; \
61 if (!__q__) \
62 (cop)->status = 0; \
65 #define _tridentWaitIdleEmpty(cop) _tridentWaitDone(cop)
67 #define sourceInvarient(alu) (((alu) & 3) == (((alu) >> 2) & 3))
69 #endif