2
* Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
3
* Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
5
* Permission is hereby granted, free of charge, to any person obtaining a
6
* copy of this software and associated documentation files (the "Software"),
7
* to deal in the Software without restriction, including without limitation
8
* the rights to use, copy, modify, merge, publish, distribute, sub license,
9
* and/or sell copies of the Software, and to permit persons to whom the
10
* Software is furnished to do so, subject to the following conditions:
12
* The above copyright notice and this permission notice (including the
13
* next paragraph) shall be included in all copies or substantial portions
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19
* VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
* DEALINGS IN THE SOFTWARE.
25
/*************************************************************************
28
* Content: The defines of Via registers
30
************************************************************************/
35
/* defines for VIA 2D registers */
36
#define VIA_REG_GECMD 0x000
37
#define VIA_REG_GEMODE 0x004
38
#define VIA_REG_GESTATUS 0x004 /* as same as VIA_REG_GEMODE */
39
#define VIA_REG_SRCPOS 0x008
40
#define VIA_REG_DSTPOS 0x00C
41
#define VIA_REG_LINE_K1K2 0x008
42
#define VIA_REG_LINE_XY 0x00C
43
#define VIA_REG_DIMENSION 0x010 /* width and height */
44
#define VIA_REG_PATADDR 0x014
45
#define VIA_REG_FGCOLOR 0x018
46
#define VIA_REG_DSTCOLORKEY 0x018 /* as same as VIA_REG_FG */
47
#define VIA_REG_BGCOLOR 0x01C
48
#define VIA_REG_SRCCOLORKEY 0x01C /* as same as VIA_REG_BG */
49
#define VIA_REG_CLIPTL 0x020 /* top and left of clipping */
50
#define VIA_REG_CLIPBR 0x024 /* bottom and right of clipping */
51
#define VIA_REG_OFFSET 0x028
52
#define VIA_REG_LINE_ERROR 0x028
53
#define VIA_REG_KEYCONTROL 0x02C /* color key control */
54
#define VIA_REG_SRCBASE 0x030
55
#define VIA_REG_DSTBASE 0x034
56
#define VIA_REG_PITCH 0x038 /* pitch of src and dst */
57
#define VIA_REG_MONOPAT0 0x03C
58
#define VIA_REG_MONOPAT1 0x040
59
#define VIA_REG_COLORPAT 0x100 /* from 0x100 to 0x1ff */
63
/* defines for VIA video registers */
64
#define VIA_REG_INTERRUPT 0x200
65
#define VIA_REG_CRTCSTART 0x214
68
/* defines for VIA HW cursor registers */
69
#define VIA_REG_CURSOR_MODE 0x2D0
70
#define VIA_REG_CURSOR_POS 0x2D4
71
#define VIA_REG_CURSOR_ORG 0x2D8
72
#define VIA_REG_CURSOR_BG 0x2DC
73
#define VIA_REG_CURSOR_FG 0x2E0
76
/* defines for VIA 3D registers */
77
#define VIA_REG_STATUS 0x400
78
#define VIA_REG_TRANSET 0x43C
79
#define VIA_REG_TRANSPACE 0x440
81
/* VIA_REG_STATUS(0x400): Engine Status */
82
#define VIA_CMD_RGTR_BUSY 0x00000080 /* Command Regulator is busy */
83
#define VIA_2D_ENG_BUSY 0x00000001 /* 2D Engine is busy */
84
#define VIA_3D_ENG_BUSY 0x00000002 /* 3D Engine is busy */
85
#define VIA_VR_QUEUE_BUSY 0x00020000 /* Virtual Queue is busy */
86
#define VIA_BUSY (VIA_CMD_RGTR_BUSY|VIA_2D_ENG_BUSY|VIA_3D_ENG_BUSY)
89
/* VIA_REG_GECMD(0x00): 2D Engine Command */
90
#define VIA_GEC_NOOP 0x00000000
91
#define VIA_GEC_BLT 0x00000001
92
#define VIA_GEC_LINE 0x00000005
94
#define VIA_GEC_SRC_XY 0x00000000
95
#define VIA_GEC_SRC_LINEAR 0x00000010
96
#define VIA_GEC_DST_XY 0x00000000
97
#define VIA_GEC_DST_LINRAT 0x00000020
99
#define VIA_GEC_SRC_FB 0x00000000
100
#define VIA_GEC_SRC_SYS 0x00000040
101
#define VIA_GEC_DST_FB 0x00000000
102
#define VIA_GEC_DST_SYS 0x00000080
104
#define VIA_GEC_SRC_MONO 0x00000100 /* source is mono */
105
#define VIA_GEC_PAT_MONO 0x00000200 /* pattern is mono */
107
#define VIA_GEC_MSRC_OPAQUE 0x00000000 /* mono src is opaque */
108
#define VIA_GEC_MSRC_TRANS 0x00000400 /* mono src is transparent */
110
#define VIA_GEC_PAT_FB 0x00000000 /* pattern is in frame buffer */
111
#define VIA_GEC_PAT_REG 0x00000800 /* pattern is from reg setting */
113
#define VIA_GEC_CLIP_DISABLE 0x00000000
114
#define VIA_GEC_CLIP_ENABLE 0x00001000
116
#define VIA_GEC_FIXCOLOR_PAT 0x00002000
118
#define VIA_GEC_INCX 0x00000000
119
#define VIA_GEC_DECY 0x00004000
120
#define VIA_GEC_INCY 0x00000000
121
#define VIA_GEC_DECX 0x00008000
123
#define VIA_GEC_MPAT_OPAQUE 0x00000000 /* mono pattern is opaque */
124
#define VIA_GEC_MPAT_TRANS 0x00010000 /* mono pattern is transparent */
126
#define VIA_GEC_MONO_UNPACK 0x00000000
127
#define VIA_GEC_MONO_PACK 0x00020000
128
#define VIA_GEC_MONO_DWORD 0x00000000
129
#define VIA_GEC_MONO_WORD 0x00040000
130
#define VIA_GEC_MONO_BYTE 0x00080000
132
#define VIA_GEC_LASTPIXEL_ON 0x00000000
133
#define VIA_GEC_LASTPIXEL_OFF 0x00100000
134
#define VIA_GEC_X_MAJOR 0x00000000
135
#define VIA_GEC_Y_MAJOR 0x00200000
136
#define VIA_GEC_QUICK_START 0x00800000
139
/* VIA_REG_GEMODE(0x04): GE mode */
140
#define VIA_GEM_8bpp 0x00000000
141
#define VIA_GEM_16bpp 0x00000100
142
#define VIA_GEM_32bpp 0x00000300
144
#define VIA_GEM_640 0x00000000 /* 640*480 */
145
#define VIA_GEM_800 0x00000400 /* 800*600 */
146
#define VIA_GEM_1024 0x00000800 /* 1024*768 */
147
#define VIA_GEM_1280 0x00000C00 /* 1280*1024 */
148
#define VIA_GEM_1600 0x00001000 /* 1600*1200 */
149
#define VIA_GEM_2048 0x00001400 /* 2048*1536 */
151
/* VIA_REG_PITCH(0x38): Pitch Setting */
152
#define VIA_PITCH_ENABLE 0x80000000
154
#endif /* _VIA_REGS_H_ */