gffbreg.h revision 1.4 1 1.4 rin /* $NetBSD: gffbreg.h,v 1.4 2020/04/16 21:56:42 rin Exp $ */
2 1.1 macallan
3 1.1 macallan /*
4 1.3 macallan * Copyright (c) 2013 Michael Lorenz
5 1.1 macallan * All rights reserved.
6 1.1 macallan *
7 1.1 macallan * Redistribution and use in source and binary forms, with or without
8 1.1 macallan * modification, are permitted provided that the following conditions
9 1.1 macallan * are met:
10 1.1 macallan * 1. Redistributions of source code must retain the above copyright
11 1.1 macallan * notice, this list of conditions and the following disclaimer.
12 1.1 macallan * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 macallan * notice, this list of conditions and the following disclaimer in the
14 1.1 macallan * documentation and/or other materials provided with the distribution.
15 1.1 macallan *
16 1.1 macallan * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.1 macallan * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 1.1 macallan * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 1.1 macallan * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 1.1 macallan * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 1.1 macallan * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 1.1 macallan * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 1.1 macallan * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 1.1 macallan * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 1.1 macallan * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 1.1 macallan */
27 1.1 macallan
28 1.1 macallan /*
29 1.1 macallan * A console driver for nvidia geforce graphics controllers
30 1.1 macallan * tested on macppc only so far
31 1.1 macallan * register definitions are mostly from the xf86-video-nv driver
32 1.1 macallan */
33 1.1 macallan
34 1.1 macallan #ifndef GFFBREG_H
35 1.1 macallan #define GFFBREG_H
36 1.1 macallan
37 1.1 macallan #define GFFB_RAMDAC0 0x00680000
38 1.1 macallan #define GFFB_RAMDAC1 0x00682000
39 1.1 macallan
40 1.1 macallan #define GFFB_PCIO0 0x00601000
41 1.1 macallan #define GFFB_PCIO1 0x00603000
42 1.1 macallan
43 1.1 macallan /* VGA registers live here, one set for each head */
44 1.1 macallan #define GFFB_PDIO0 0x00681000
45 1.1 macallan #define GFFB_PDIO1 0x00683000
46 1.1 macallan
47 1.1 macallan #define GFFB_CRTC0 0x00600000
48 1.1 macallan #define GFFB_CRTC1 0x00602000
49 1.1 macallan
50 1.2 macallan #define GFFB_FIFO 0x00800000
51 1.2 macallan #define GFFB_FIFO_PUT 0x00800040 /* command list stop */
52 1.2 macallan #define GFFB_FIFO_GET 0x00800044 /* command list pointer */
53 1.2 macallan
54 1.2 macallan #define GFFB_PGRAPH 0x00400000
55 1.2 macallan #define GFFB_BUSY 0x00400700
56 1.2 macallan
57 1.2 macallan #define GFFB_PFB 0x00100000
58 1.2 macallan #define GFFB_VRAM 0x0010020c /* vram size in 0xfff00000 */
59 1.2 macallan
60 1.2 macallan #define GFFB_PRAMIN 0x00710000
61 1.2 macallan #define GFFB_CMDSTART 0x00712098 /* ??? */
62 1.2 macallan
63 1.2 macallan #define GFFB_PMC 0x00000000
64 1.2 macallan #define GFFB_PFIFO 0x00002000
65 1.2 macallan #define GFFB_PEXTDEV 0x00101000
66 1.2 macallan #define GFFB_PTIMER 0x00009000
67 1.2 macallan
68 1.1 macallan /* CRTC registers */
69 1.1 macallan #define GFFB_DISPLAYSTART 0x800
70 1.1 macallan
71 1.1 macallan /* VGA registers */
72 1.1 macallan #define GFFB_PEL_MASK 0x3c6
73 1.1 macallan #define GFFB_PEL_IR 0x3c7
74 1.1 macallan #define GFFB_PEL_IW 0x3c8
75 1.1 macallan #define GFFB_PEL_D 0x3c9
76 1.1 macallan
77 1.2 macallan /* engine command definitions from xf86_video_nv/nv_dma.h */
78 1.2 macallan
79 1.2 macallan /*
80 1.2 macallan * Copyright (c) 2003 NVIDIA, Corporation
81 1.2 macallan *
82 1.2 macallan * Permission is hereby granted, free of charge, to any person obtaining a
83 1.2 macallan * copy of this software and associated documentation files (the
84 1.2 macallan * "Software"), to deal in the Software without restriction, including
85 1.2 macallan * without limitation the rights to use, copy, modify, merge, publish,
86 1.2 macallan * distribute, sublicense, and/or sell copies of the Software, and to
87 1.2 macallan * permit persons to whom the Software is furnished to do so, subject to
88 1.2 macallan * the following conditions:
89 1.2 macallan *
90 1.2 macallan * The above copyright notice and this permission notice shall be included
91 1.2 macallan * in all copies or substantial portions of the Software.
92 1.2 macallan *
93 1.2 macallan * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
94 1.2 macallan * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
95 1.2 macallan * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
96 1.2 macallan * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
97 1.2 macallan * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
98 1.2 macallan * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
99 1.2 macallan * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
100 1.2 macallan */
101 1.2 macallan
102 1.2 macallan #define SURFACE_FORMAT 0x00000300
103 1.2 macallan #define SURFACE_FORMAT_DEPTH8 0x00000001
104 1.2 macallan #define SURFACE_FORMAT_DEPTH15 0x00000002
105 1.2 macallan #define SURFACE_FORMAT_DEPTH16 0x00000004
106 1.2 macallan #define SURFACE_FORMAT_DEPTH24 0x00000006
107 1.2 macallan #define SURFACE_PITCH 0x00000304
108 1.2 macallan #define SURFACE_PITCH_SRC 15:0
109 1.2 macallan #define SURFACE_PITCH_DST 31:16
110 1.2 macallan #define SURFACE_OFFSET_SRC 0x00000308
111 1.2 macallan #define SURFACE_OFFSET_DST 0x0000030C
112 1.2 macallan
113 1.2 macallan #define ROP_SET 0x00002300
114 1.2 macallan
115 1.2 macallan #define PATTERN_FORMAT 0x00004300
116 1.2 macallan #define PATTERN_FORMAT_DEPTH8 0x00000003
117 1.2 macallan #define PATTERN_FORMAT_DEPTH16 0x00000001
118 1.2 macallan #define PATTERN_FORMAT_DEPTH24 0x00000003
119 1.2 macallan #define PATTERN_COLOR_0 0x00004310
120 1.2 macallan #define PATTERN_COLOR_1 0x00004314
121 1.2 macallan #define PATTERN_PATTERN_0 0x00004318
122 1.2 macallan #define PATTERN_PATTERN_1 0x0000431C
123 1.2 macallan
124 1.2 macallan #define CLIP_POINT 0x00006300
125 1.2 macallan #define CLIP_POINT_X 15:0
126 1.2 macallan #define CLIP_POINT_Y 31:16
127 1.2 macallan #define CLIP_SIZE 0x00006304
128 1.2 macallan #define CLIP_SIZE_WIDTH 15:0
129 1.2 macallan #define CLIP_SIZE_HEIGHT 31:16
130 1.2 macallan
131 1.2 macallan #define LINE_FORMAT 0x00008300
132 1.2 macallan #define LINE_FORMAT_DEPTH8 0x00000003
133 1.2 macallan #define LINE_FORMAT_DEPTH16 0x00000001
134 1.2 macallan #define LINE_FORMAT_DEPTH24 0x00000003
135 1.2 macallan #define LINE_COLOR 0x00008304
136 1.2 macallan #define LINE_MAX_LINES 16
137 1.2 macallan #define LINE_LINES(i) 0x00008400\
138 1.2 macallan +(i)*8
139 1.2 macallan #define LINE_LINES_POINT0_X 15:0
140 1.2 macallan #define LINE_LINES_POINT0_Y 31:16
141 1.2 macallan #define LINE_LINES_POINT1_X 47:32
142 1.2 macallan #define LINE_LINES_POINT1_Y 63:48
143 1.2 macallan
144 1.2 macallan #define BLIT_POINT_SRC 0x0000A300
145 1.2 macallan #define BLIT_POINT_SRC_X 15:0
146 1.2 macallan #define BLIT_POINT_SRC_Y 31:16
147 1.2 macallan #define BLIT_POINT_DST 0x0000A304
148 1.2 macallan #define BLIT_POINT_DST_X 15:0
149 1.2 macallan #define BLIT_POINT_DST_Y 31:16
150 1.2 macallan #define BLIT_SIZE 0x0000A308
151 1.2 macallan #define BLIT_SIZE_WIDTH 15:0
152 1.2 macallan #define BLIT_SIZE_HEIGHT 31:16
153 1.2 macallan
154 1.2 macallan #define RECT_FORMAT 0x0000C300
155 1.2 macallan #define RECT_FORMAT_DEPTH8 0x00000003
156 1.2 macallan #define RECT_FORMAT_DEPTH16 0x00000001
157 1.2 macallan #define RECT_FORMAT_DEPTH24 0x00000003
158 1.2 macallan #define RECT_SOLID_COLOR 0x0000C3FC
159 1.2 macallan #define RECT_SOLID_RECTS_MAX_RECTS 32
160 1.2 macallan #define RECT_SOLID_RECTS(i) 0x0000C400\
161 1.2 macallan +(i)*8
162 1.2 macallan #define RECT_SOLID_RECTS_Y 15:0
163 1.2 macallan #define RECT_SOLID_RECTS_X 31:16
164 1.2 macallan #define RECT_SOLID_RECTS_HEIGHT 47:32
165 1.2 macallan #define RECT_SOLID_RECTS_WIDTH 63:48
166 1.2 macallan
167 1.2 macallan #define RECT_EXPAND_ONE_COLOR_CLIP 0x0000C7EC
168 1.2 macallan #define RECT_EXPAND_ONE_COLOR_CLIP_POINT0_X 15:0
169 1.2 macallan #define RECT_EXPAND_ONE_COLOR_CLIP_POINT0_Y 31:16
170 1.2 macallan #define RECT_EXPAND_ONE_COLOR_CLIP_POINT1_X 47:32
171 1.2 macallan #define RECT_EXPAND_ONE_COLOR_CLIP_POINT1_Y 63:48
172 1.2 macallan #define RECT_EXPAND_ONE_COLOR_COLOR 0x0000C7F4
173 1.2 macallan #define RECT_EXPAND_ONE_COLOR_SIZE 0x0000C7F8
174 1.2 macallan #define RECT_EXPAND_ONE_COLOR_SIZE_WIDTH 15:0
175 1.2 macallan #define RECT_EXPAND_ONE_COLOR_SIZE_HEIGHT 31:16
176 1.2 macallan #define RECT_EXPAND_ONE_COLOR_POINT 0x0000C7FC
177 1.2 macallan #define RECT_EXPAND_ONE_COLOR_POINT_X 15:0
178 1.2 macallan #define RECT_EXPAND_ONE_COLOR_POINT_Y 31:16
179 1.2 macallan #define RECT_EXPAND_ONE_COLOR_DATA_MAX_DWORDS 128
180 1.2 macallan #define RECT_EXPAND_ONE_COLOR_DATA(i) 0x0000C800\
181 1.2 macallan +(i)*4
182 1.2 macallan
183 1.2 macallan #define RECT_EXPAND_TWO_COLOR_CLIP 0x0000CBE4
184 1.2 macallan #define RECT_EXPAND_TWO_COLOR_CLIP_POINT0_X 15:0
185 1.2 macallan #define RECT_EXPAND_TWO_COLOR_CLIP_POINT0_Y 31:16
186 1.2 macallan #define RECT_EXPAND_TWO_COLOR_CLIP_POINT1_X 47:32
187 1.2 macallan #define RECT_EXPAND_TWO_COLOR_CLIP_POINT1_Y 63:48
188 1.2 macallan #define RECT_EXPAND_TWO_COLOR_COLOR_0 0x0000CBEC
189 1.2 macallan #define RECT_EXPAND_TWO_COLOR_COLOR_1 0x0000CBF0
190 1.2 macallan #define RECT_EXPAND_TWO_COLOR_SIZE_IN 0x0000CBF4
191 1.2 macallan #define RECT_EXPAND_TWO_COLOR_SIZE_IN_WIDTH 15:0
192 1.2 macallan #define RECT_EXPAND_TWO_COLOR_SIZE_IN_HEIGHT 31:16
193 1.2 macallan #define RECT_EXPAND_TWO_COLOR_SIZE_OUT 0x0000CBF8
194 1.2 macallan #define RECT_EXPAND_TWO_COLOR_SIZE_OUT_WIDTH 15:0
195 1.2 macallan #define RECT_EXPAND_TWO_COLOR_SIZE_OUT_HEIGHT 31:16
196 1.2 macallan #define RECT_EXPAND_TWO_COLOR_POINT 0x0000CBFC
197 1.2 macallan #define RECT_EXPAND_TWO_COLOR_POINT_X 15:0
198 1.2 macallan #define RECT_EXPAND_TWO_COLOR_POINT_Y 31:16
199 1.2 macallan #define RECT_EXPAND_TWO_COLOR_DATA_MAX_DWORDS 128
200 1.2 macallan #define RECT_EXPAND_TWO_COLOR_DATA(i) 0x0000CC00\
201 1.2 macallan +(i)*4
202 1.2 macallan
203 1.2 macallan #define STRETCH_BLIT_FORMAT 0x0000E300
204 1.2 macallan #define STRETCH_BLIT_FORMAT_DEPTH8 0x00000004
205 1.2 macallan #define STRETCH_BLIT_FORMAT_DEPTH16 0x00000007
206 1.2 macallan #define STRETCH_BLIT_FORMAT_DEPTH24 0x00000004
207 1.2 macallan #define STRETCH_BLIT_FORMAT_A8R8G8B8 0x00000003
208 1.2 macallan #define STRETCH_BLIT_FORMAT_X8R8G8B8 0x00000004
209 1.2 macallan #define STRETCH_BLIT_FORMAT_YUYV 0x00000005
210 1.2 macallan #define STRETCH_BLIT_FORMAT_UYVY 0x00000006
211 1.2 macallan /* STRETCH_BLIT_OPERATION is only supported on TNT2 and newer */
212 1.2 macallan #define STRETCH_BLIT_OPERATION 0x0000E304
213 1.2 macallan #define STRETCH_BLIT_OPERATION_ROP 0x00000001
214 1.2 macallan #define STRETCH_BLIT_OPERATION_COPY 0x00000003
215 1.2 macallan #define STRETCH_BLIT_OPERATION_BLEND 0x00000002
216 1.2 macallan #define STRETCH_BLIT_CLIP_POINT 0x0000E308
217 1.2 macallan #define STRETCH_BLIT_CLIP_POINT_X 15:0
218 1.2 macallan #define STRETCH_BLIT_CLIP_POINT_Y 31:16
219 1.2 macallan #define STRETCH_BLIT_CLIP_POINT 0x0000E308
220 1.2 macallan #define STRETCH_BLIT_CLIP_SIZE 0x0000E30C
221 1.2 macallan #define STRETCH_BLIT_CLIP_SIZE_WIDTH 15:0
222 1.2 macallan #define STRETCH_BLIT_CLIP_SIZE_HEIGHT 31:16
223 1.2 macallan #define STRETCH_BLIT_DST_POINT 0x0000E310
224 1.2 macallan #define STRETCH_BLIT_DST_POINT_X 15:0
225 1.2 macallan #define STRETCH_BLIT_DST_POINT_Y 31:16
226 1.2 macallan #define STRETCH_BLIT_DST_SIZE 0x0000E314
227 1.2 macallan #define STRETCH_BLIT_DST_SIZE_WIDTH 15:0
228 1.2 macallan #define STRETCH_BLIT_DST_SIZE_HEIGHT 31:16
229 1.2 macallan #define STRETCH_BLIT_DU_DX 0x0000E318
230 1.2 macallan #define STRETCH_BLIT_DV_DY 0x0000E31C
231 1.2 macallan #define STRETCH_BLIT_SRC_SIZE 0x0000E400
232 1.2 macallan #define STRETCH_BLIT_SRC_SIZE_WIDTH 15:0
233 1.2 macallan #define STRETCH_BLIT_SRC_SIZE_HEIGHT 31:16
234 1.2 macallan #define STRETCH_BLIT_SRC_FORMAT 0x0000E404
235 1.2 macallan #define STRETCH_BLIT_SRC_FORMAT_PITCH 15:0
236 1.2 macallan #define STRETCH_BLIT_SRC_FORMAT_ORIGIN 23:16
237 1.2 macallan #define STRETCH_BLIT_SRC_FORMAT_ORIGIN_CENTER 0x00000001
238 1.2 macallan #define STRETCH_BLIT_SRC_FORMAT_ORIGIN_CORNER 0x00000002
239 1.2 macallan #define STRETCH_BLIT_SRC_FORMAT_FILTER 31:24
240 1.2 macallan #define STRETCH_BLIT_SRC_FORMAT_FILTER_POINT_SAMPLE 0x00000000
241 1.2 macallan #define STRETCH_BLIT_SRC_FORMAT_FILTER_BILINEAR 0x00000001
242 1.2 macallan #define STRETCH_BLIT_SRC_OFFSET 0x0000E408
243 1.2 macallan #define STRETCH_BLIT_SRC_POINT 0x0000E40C
244 1.2 macallan #define STRETCH_BLIT_SRC_POINT_U 15:0
245 1.2 macallan #define STRETCH_BLIT_SRC_POINT_V 31:16
246 1.2 macallan
247 1.2 macallan
248 1.3 macallan #endif /* GFFBREG_H */
249