4
* Copyright © 2003 Anders Carlsson
6
* Permission to use, copy, modify, distribute, and sell this software and its
7
* documentation for any purpose is hereby granted without fee, provided that
8
* the above copyright notice appear in all copies and that both that
9
* copyright notice and this permission notice appear in supporting
10
* documentation, and that the name of Anders Carlsson not be used in
11
* advertising or publicity pertaining to distribution of the software without
12
* specific, written prior permission. Anders Carlsson makes no
13
* representations about the suitability of this software for any purpose. It
14
* is provided "as is" without express or implied warranty.
16
* ANDERS CARLSSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18
* EVENT SHALL ANDERS CARLSSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22
* PERFORMANCE OF THIS SOFTWARE.
30
#define R128_REG_BASE(c) ((c)->attr.address[1])
31
#define R128_REG_SIZE(c) (0x4000)
33
#define R128_OUT32(mmio, a, v) (*(VOL32 *) ((mmio) + (a)) = (v))
34
#define R128_IN32(mmio, a) (*(VOL32 *) ((mmio) + (a)))
36
#define R128_REG_GUI_STAT 0x1740
37
#define R128_REG_DEFAULT_OFFSET 0x16e0
38
#define R128_REG_DEFAULT_PITCH 0x16e4
39
#define R128_REG_DP_GUI_MASTER_CNTL 0x146c
40
#define R128_REG_DP_BRUSH_FRGD_CLR 0x147c
41
#define R128_REG_DP_WRITE_MASK 0x16cc
42
#define R128_REG_DP_CNTL 0x16c0
43
#define R128_REG_DST_WIDTH_HEIGHT 0x1598
44
#define R128_REG_DST_Y_X 0x1438
45
#define R128_REG_PC_NGUI_CTLSTAT 0x0184
46
#define R128_REG_DST_HEIGHT_WIDTH 0x143c
47
#define R128_REG_SRC_Y_X 0x1434
48
#define R128_DEFAULT_SC_BOTTOM_RIGHT 0x16e8
49
#define R128_AUX_SC_CNTL 0x1660
50
#define R128_SC_TOP_LEFT 0x16ec
51
#define R128_SC_BOTTOM_RIGHT 0x16f0
53
#define R128_GMC_DST_DATATYPE_SHIFT 8
54
#define R128_GMC_CLR_CMP_CNTL_DIS (1 << 28)
55
#define R128_GMC_AUX_CLIP_DIS (1 << 29)
56
#define R128_GMC_BRUSH_SOLID_COLOR (13 << 4)
57
#define R128_GMC_SRC_DATATYPE_COLOR (3 << 12)
58
#define R128_GMC_ROP3_SHIFT 16
59
#define R128_DST_X_LEFT_TO_RIGHT (1 << 0)
60
#define R128_DST_Y_TOP_TO_BOTTOM (1 << 1)
61
#define R128_GUI_ACTIVE (1 << 31)
62
#define R128_PC_BUSY (1 << 31)
63
#define R128_DP_SRC_SOURCE_MEMORY (2 << 24)
64
#define R128_DEFAULT_SC_RIGHT_MAX (0x1fff << 0)
65
#define R128_DEFAULT_SC_BOTTOM_MAX (0x1fff << 16)
67
typedef volatile CARD8 VOL8;
68
typedef volatile CARD16 VOL16;
69
typedef volatile CARD32 VOL32;
71
typedef struct _r128CardInfo {
77
#define getR128CardInfo(kd) ((R128CardInfo *) ((kd)->card->driver))
78
#define r128CardInfo(kd) R128CardInfo *r128c = getR128CardInfo(kd)
80
typedef struct _r128ScreenInfo {
81
VesaScreenPrivRec vesa;
91
int dp_gui_master_cntl;
94
#define getR128ScreenInfo(kd) ((R128ScreenInfo *) ((kd)->screen->driver))
95
#define r128ScreenInfo(kd) R128ScreenInfo *r128s = getR128ScreenInfo(kd)
98
r128MapReg (KdCardInfo *card, R128CardInfo *r128c);
101
r128UnmapReg (KdCardInfo *card, R128CardInfo *r128c);
104
r128SetMMIO (KdCardInfo *card, R128CardInfo *r128c);
107
r128ResetMMIO (KdCardInfo *card, R128CardInfo *r128c);
110
r128DrawSetup (ScreenPtr pScreen);
113
r128DrawInit (ScreenPtr pScreen);
116
r128DrawEnable (ScreenPtr pScreen);
119
r128DrawDisable (ScreenPtr pScreen);
122
r128DrawFini (ScreenPtr pScreen);
124
extern KdCardFuncs r128Funcs;
126
#endif /* _R128_H_ */