| @@ -1,479 +1,481 @@ | | | @@ -1,479 +1,481 @@ |
1 | /* | | 1 | /* |
2 | * (c) 2006-2008 Advanced Micro Devices, Inc. | | 2 | * (c) 2006-2008 Advanced Micro Devices, Inc. |
3 | * | | 3 | * |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | * copy of this software and associated documentation files (the "Software"), | | 5 | * copy of this software and associated documentation files (the "Software"), |
6 | * to deal in the Software without restriction, including without limitation | | 6 | * to deal in the Software without restriction, including without limitation |
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | | 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
8 | * and/or sell copies of the Software, and to permit persons to whom the | | 8 | * and/or sell copies of the Software, and to permit persons to whom the |
9 | * Software is furnished to do so, subject to the following conditions: | | 9 | * Software is furnished to do so, subject to the following conditions: |
10 | * | | 10 | * |
11 | * The above copyright notice and this permission notice shall be included in | | 11 | * The above copyright notice and this permission notice shall be included in |
12 | * all copies or substantial portions of the Software. | | 12 | * all copies or substantial portions of the Software. |
13 | * | | 13 | * |
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | | 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | | 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | | 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | | 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | * DEALINGS IN THE SOFTWARE. | | 20 | * DEALINGS IN THE SOFTWARE. |
21 | * | | 21 | * |
22 | * Neither the name of the Advanced Micro Devices, Inc. nor the names of its | | 22 | * Neither the name of the Advanced Micro Devices, Inc. nor the names of its |
23 | * contributors may be used to endorse or promote products derived from this | | 23 | * contributors may be used to endorse or promote products derived from this |
24 | * software without specific prior written permission. | | 24 | * software without specific prior written permission. |
25 | */ | | 25 | */ |
26 | | | 26 | |
27 | #ifndef _GEODE_H_ | | 27 | #ifndef _GEODE_H_ |
28 | #define _GEODE_H_ | | 28 | #define _GEODE_H_ |
29 | | | 29 | |
30 | #include "geode_pcirename.h" | | 30 | #include "geode_pcirename.h" |
| | | 31 | #ifdef HAVE_CONFIG_H |
31 | #include "config.h" | | 32 | #include "config.h" |
| | | 33 | #endif |
32 | | | 34 | |
33 | #ifdef HAVE_XAA_H | | 35 | #ifdef HAVE_XAA_H |
34 | #include "xaa.h" | | 36 | #include "xaa.h" |
35 | #endif | | 37 | #endif |
36 | #include "exa.h" | | 38 | #include "exa.h" |
37 | #include "xf86Cursor.h" | | 39 | #include "xf86Cursor.h" |
38 | | | 40 | |
39 | #include "vgaHW.h" | | 41 | #include "vgaHW.h" |
40 | #include "xf86int10.h" | | 42 | #include "xf86int10.h" |
41 | #include <X11/extensions/randr.h> | | 43 | #include <X11/extensions/randr.h> |
42 | #include "randrstr.h" | | 44 | #include "randrstr.h" |
43 | | | 45 | |
44 | #include "xf86xv.h" | | 46 | #include "xf86xv.h" |
45 | | | 47 | |
46 | #include "compat-api.h" | | 48 | #include "compat-api.h" |
47 | | | 49 | |
48 | /* We only support EXA version >=2 */ | | 50 | /* We only support EXA version >=2 */ |
49 | | | 51 | |
50 | #if (EXA_VERSION_MAJOR >= 2) | | 52 | #if (EXA_VERSION_MAJOR >= 2) |
51 | #ifndef XF86EXA | | 53 | #ifndef XF86EXA |
52 | #define XF86EXA 1 | | 54 | #define XF86EXA 1 |
53 | #endif | | 55 | #endif |
54 | #else | | 56 | #else |
55 | #undef XF86EXA | | 57 | #undef XF86EXA |
56 | #endif | | 58 | #endif |
57 | | | 59 | |
58 | #ifdef HAVE_XAA_H | | 60 | #ifdef HAVE_XAA_H |
59 | #define XF86XAA 1 | | 61 | #define XF86XAA 1 |
60 | #else | | 62 | #else |
61 | #undef XF86XAA | | 63 | #undef XF86XAA |
62 | #endif | | 64 | #endif |
63 | | | 65 | |
64 | #define CFB 0 | | 66 | #define CFB 0 |
65 | #define INT10_SUPPORT 1 | | 67 | #define INT10_SUPPORT 1 |
66 | | | 68 | |
67 | /* Existing Processor Models */ | | 69 | /* Existing Processor Models */ |
68 | #define GX1 0x01 | | 70 | #define GX1 0x01 |
69 | #define GX 0x10 | | 71 | #define GX 0x10 |
70 | #define LX 0x20 | | 72 | #define LX 0x20 |
71 | | | 73 | |
72 | #define PCI_VENDOR_ID_CYRIX 0x1078 | | 74 | #define PCI_VENDOR_ID_CYRIX 0x1078 |
73 | #define PCI_VENDOR_ID_NS 0x100b | | 75 | #define PCI_VENDOR_ID_NS 0x100b |
74 | #define PCI_VENDOR_ID_AMD 0x1022 | | 76 | #define PCI_VENDOR_ID_AMD 0x1022 |
75 | | | 77 | |
76 | #define PCI_CHIP_5530 0x0104 | | 78 | #define PCI_CHIP_5530 0x0104 |
77 | #define PCI_CHIP_SC1200 0x0504 | | 79 | #define PCI_CHIP_SC1200 0x0504 |
78 | #define PCI_CHIP_SC1400 0x0104 | | 80 | #define PCI_CHIP_SC1400 0x0104 |
79 | #define PCI_CHIP_GEODEGX 0x0030 | | 81 | #define PCI_CHIP_GEODEGX 0x0030 |
80 | #define PCI_CHIP_GEODELX 0x2081 | | 82 | #define PCI_CHIP_GEODELX 0x2081 |
81 | | | 83 | |
82 | #define GFX_CPU_GEODELX 4 | | 84 | #define GFX_CPU_GEODELX 4 |
83 | | | 85 | |
84 | #if defined(HAVE_GX) && XF86XAA | | 86 | #if defined(HAVE_GX) && XF86XAA |
85 | #define GX_FILL_RECT_SUPPORT 1 | | 87 | #define GX_FILL_RECT_SUPPORT 1 |
86 | #define GX_BRES_LINE_SUPPORT 1 | | 88 | #define GX_BRES_LINE_SUPPORT 1 |
87 | #define GX_DASH_LINE_SUPPORT 0 /* does not do dashed lines */ | | 89 | #define GX_DASH_LINE_SUPPORT 0 /* does not do dashed lines */ |
88 | #define GX_MONO_8X8_PAT_SUPPORT 1 | | 90 | #define GX_MONO_8X8_PAT_SUPPORT 1 |
89 | #define GX_CLREXP_8X8_PAT_SUPPORT 1 | | 91 | #define GX_CLREXP_8X8_PAT_SUPPORT 1 |
90 | #define GX_SCR2SCREXP_SUPPORT 1 | | 92 | #define GX_SCR2SCREXP_SUPPORT 1 |
91 | #define GX_SCR2SCRCPY_SUPPORT 1 | | 93 | #define GX_SCR2SCRCPY_SUPPORT 1 |
92 | #define GX_CPU2SCREXP_SUPPORT 1 | | 94 | #define GX_CPU2SCREXP_SUPPORT 1 |
93 | #define GX_SCANLINE_SUPPORT 1 | | 95 | #define GX_SCANLINE_SUPPORT 1 |
94 | #define GX_USE_OFFSCRN_MEM 0 | | 96 | #define GX_USE_OFFSCRN_MEM 0 |
95 | #define GX_ONE_LINE_AT_A_TIME 1 | | 97 | #define GX_ONE_LINE_AT_A_TIME 1 |
96 | #define GX_WRITE_PIXMAP_SUPPORT 1 | | 98 | #define GX_WRITE_PIXMAP_SUPPORT 1 |
97 | #endif | | 99 | #endif |
98 | | | 100 | |
99 | #define GFX(func) gfx_##func | | 101 | #define GFX(func) gfx_##func |
100 | #define GFX2(func) gfx2_##func | | 102 | #define GFX2(func) gfx2_##func |
101 | | | 103 | |
102 | #define GEODEPTR(p) ((GeodeRec *)((p)->driverPrivate)) | | 104 | #define GEODEPTR(p) ((GeodeRec *)((p)->driverPrivate)) |
103 | | | 105 | |
104 | #define DEFAULT_EXA_SCRATCH_BFRSZ 0x40000 | | 106 | #define DEFAULT_EXA_SCRATCH_BFRSZ 0x40000 |
105 | | | 107 | |
106 | /* the LX hardware (and Cimarron) require a cursor memory size of 48x64.. */ | | 108 | /* the LX hardware (and Cimarron) require a cursor memory size of 48x64.. */ |
107 | #define LX_CURSOR_HW_WIDTH 48 | | 109 | #define LX_CURSOR_HW_WIDTH 48 |
108 | #define LX_CURSOR_HW_HEIGHT 64 | | 110 | #define LX_CURSOR_HW_HEIGHT 64 |
109 | | | 111 | |
110 | /* ...but xorg requires the cursor width to be a multiple of 32. This is | | 112 | /* ...but xorg requires the cursor width to be a multiple of 32. This is |
111 | the size of the *actual* cursor. */ | | 113 | the size of the *actual* cursor. */ |
112 | #define LX_CURSOR_MAX_WIDTH 32 | | 114 | #define LX_CURSOR_MAX_WIDTH 32 |
113 | #define LX_CURSOR_MAX_HEIGHT 32 | | 115 | #define LX_CURSOR_MAX_HEIGHT 32 |
114 | | | 116 | |
115 | /* FIXME: Get rid of this from GX */ | | 117 | /* FIXME: Get rid of this from GX */ |
116 | | | 118 | |
117 | #define DEBUGMSG(cond, drv_msg) | | 119 | #define DEBUGMSG(cond, drv_msg) |
118 | | | 120 | |
119 | #ifdef HAVE_LX | | 121 | #ifdef HAVE_LX |
120 | extern unsigned char cim_inb(unsigned short port); | | 122 | extern unsigned char cim_inb(unsigned short port); |
121 | extern void cim_outb(unsigned short port, unsigned char data); | | 123 | extern void cim_outb(unsigned short port, unsigned char data); |
122 | extern unsigned short cim_inw(unsigned short port); | | 124 | extern unsigned short cim_inw(unsigned short port); |
123 | extern void cim_outw(unsigned short port, unsigned short data); | | 125 | extern void cim_outw(unsigned short port, unsigned short data); |
124 | extern unsigned long cim_ind(unsigned short port); | | 126 | extern unsigned long cim_ind(unsigned short port); |
125 | extern void cim_outd(unsigned short port, unsigned long data); | | 127 | extern void cim_outd(unsigned short port, unsigned long data); |
126 | | | 128 | |
127 | #include "cim_rtns.h" | | 129 | #include "cim_rtns.h" |
128 | | | 130 | |
129 | typedef struct _CIM_DISPLAYTIMING { | | 131 | typedef struct _CIM_DISPLAYTIMING { |
130 | unsigned short wPitch; | | 132 | unsigned short wPitch; |
131 | unsigned short wBpp; | | 133 | unsigned short wBpp; |
132 | VG_DISPLAY_MODE vgDisplayMode; | | 134 | VG_DISPLAY_MODE vgDisplayMode; |
133 | } CIM_DISPLAYTIMING; | | 135 | } CIM_DISPLAYTIMING; |
134 | | | 136 | |
135 | #endif | | 137 | #endif |
136 | | | 138 | |
137 | #ifdef HAVE_GX | | 139 | #ifdef HAVE_GX |
138 | extern void gfx_write_reg32(int offset, int data); | | 140 | extern void gfx_write_reg32(int offset, int data); |
139 | extern void gfx_write_reg16(int offset, short data); | | 141 | extern void gfx_write_reg16(int offset, short data); |
140 | extern void gfx_write_reg8(int offset, char data); | | 142 | extern void gfx_write_reg8(int offset, char data); |
141 | extern int gfx_read_reg32(int offset); | | 143 | extern int gfx_read_reg32(int offset); |
142 | extern short gfx_read_reg16(int offset); | | 144 | extern short gfx_read_reg16(int offset); |
143 | extern void gfx_write_vid32(int offset, int data); | | 145 | extern void gfx_write_vid32(int offset, int data); |
144 | extern int gfx_read_vid32(int offset); | | 146 | extern int gfx_read_vid32(int offset); |
145 | extern unsigned char gfx_inb(unsigned short port); | | 147 | extern unsigned char gfx_inb(unsigned short port); |
146 | extern void gfx_outb(unsigned short port, unsigned char data); | | 148 | extern void gfx_outb(unsigned short port, unsigned char data); |
147 | extern unsigned short gfx_inw(unsigned short port); | | 149 | extern unsigned short gfx_inw(unsigned short port); |
148 | extern void gfx_outw(unsigned short port, unsigned short data); | | 150 | extern void gfx_outw(unsigned short port, unsigned short data); |
149 | extern unsigned long gfx_ind(unsigned short port); | | 151 | extern unsigned long gfx_ind(unsigned short port); |
150 | extern void gfx_outd(unsigned short port, unsigned long data); | | 152 | extern void gfx_outd(unsigned short port, unsigned long data); |
151 | | | 153 | |
152 | #define Q_WORD QQ_WORD | | 154 | #define Q_WORD QQ_WORD |
153 | #include "gfx_rtns.h" | | 155 | #include "gfx_rtns.h" |
154 | #undef Q_WORD | | 156 | #undef Q_WORD |
155 | #include "panel.h" | | 157 | #include "panel.h" |
156 | | | 158 | |
157 | typedef struct tag_GFX_DISPLAYTIMING { | | 159 | typedef struct tag_GFX_DISPLAYTIMING { |
158 | unsigned int dwDotClock; | | 160 | unsigned int dwDotClock; |
159 | unsigned short wPitch; | | 161 | unsigned short wPitch; |
160 | unsigned short wBpp; | | 162 | unsigned short wBpp; |
161 | unsigned short wHTotal; | | 163 | unsigned short wHTotal; |
162 | unsigned short wHActive; | | 164 | unsigned short wHActive; |
163 | unsigned short wHSyncStart; | | 165 | unsigned short wHSyncStart; |
164 | unsigned short wHSyncEnd; | | 166 | unsigned short wHSyncEnd; |
165 | unsigned short wHBlankStart; | | 167 | unsigned short wHBlankStart; |
166 | unsigned short wHBlankEnd; | | 168 | unsigned short wHBlankEnd; |
167 | unsigned short wVTotal; | | 169 | unsigned short wVTotal; |
168 | unsigned short wVActive; | | 170 | unsigned short wVActive; |
169 | unsigned short wVSyncStart; | | 171 | unsigned short wVSyncStart; |
170 | unsigned short wVSyncEnd; | | 172 | unsigned short wVSyncEnd; |
171 | unsigned short wVBlankStart; | | 173 | unsigned short wVBlankStart; |
172 | unsigned short wVBlankEnd; | | 174 | unsigned short wVBlankEnd; |
173 | unsigned short wPolarity; | | 175 | unsigned short wPolarity; |
174 | } GFX_DISPLAYTIMING; | | 176 | } GFX_DISPLAYTIMING; |
175 | | | 177 | |
176 | #endif | | 178 | #endif |
177 | | | 179 | |
178 | typedef struct _VESARec { | | 180 | typedef struct _VESARec { |
179 | xf86Int10InfoPtr pInt; | | 181 | xf86Int10InfoPtr pInt; |
180 | } VESARec; | | 182 | } VESARec; |
181 | | | 183 | |
182 | typedef struct _GeodeMemRec { | | 184 | typedef struct _GeodeMemRec { |
183 | struct _GeodeMemRec *next; | | 185 | struct _GeodeMemRec *next; |
184 | struct _GeodeMemRec *prev; | | 186 | struct _GeodeMemRec *prev; |
185 | unsigned int offset; | | 187 | unsigned int offset; |
186 | int size; | | 188 | int size; |
187 | } GeodeMemRec, *GeodeMemPtr; | | 189 | } GeodeMemRec, *GeodeMemPtr; |
188 | | | 190 | |
189 | #define OUTPUT_PANEL 0x01 | | 191 | #define OUTPUT_PANEL 0x01 |
190 | #define OUTPUT_CRT 0x02 | | 192 | #define OUTPUT_CRT 0x02 |
191 | #define OUTPUT_TV 0x04 | | 193 | #define OUTPUT_TV 0x04 |
192 | #define OUTPUT_VOP 0x08 | | 194 | #define OUTPUT_VOP 0x08 |
193 | #define OUTPUT_DCON 0x10 | | 195 | #define OUTPUT_DCON 0x10 |
194 | | | 196 | |
195 | typedef struct _geodeRec { | | 197 | typedef struct _geodeRec { |
196 | /* Common for both GX and LX */ | | 198 | /* Common for both GX and LX */ |
197 | int Output; /* Bitmask indicating the valid output options */ | | 199 | int Output; /* Bitmask indicating the valid output options */ |
198 | Bool HWCursor; | | 200 | Bool HWCursor; |
199 | Bool NoAccel; | | 201 | Bool NoAccel; |
200 | Bool useVGA; | | 202 | Bool useVGA; |
201 | Bool VGAActive; /* Flag indicating if LX VGA is active */ | | 203 | Bool VGAActive; /* Flag indicating if LX VGA is active */ |
202 | Bool Compression; | | 204 | Bool Compression; |
203 | Bool useEXA; | | 205 | Bool useEXA; |
204 | | | 206 | |
205 | int rotation; | | 207 | int rotation; |
206 | int displayWidth; | | 208 | int displayWidth; |
207 | Bool starting; | | 209 | Bool starting; |
208 | Bool tryCompression; | | 210 | Bool tryCompression; |
209 | Bool tryHWCursor; | | 211 | Bool tryHWCursor; |
210 | | | 212 | |
211 | int mm_width, mm_height; /* physical display size */ | | 213 | int mm_width, mm_height; /* physical display size */ |
212 | | | 214 | |
213 | unsigned long CursorStartOffset; | | 215 | unsigned long CursorStartOffset; |
214 | | | 216 | |
215 | int Pitch; /* display FB pitch */ | | 217 | int Pitch; /* display FB pitch */ |
216 | int displaySize; /* The size of the visibile area */ | | 218 | int displaySize; /* The size of the visibile area */ |
217 | | | 219 | |
218 | ExaOffscreenArea *shadowArea; | | 220 | ExaOffscreenArea *shadowArea; |
219 | | | 221 | |
220 | /* Framebuffer memory */ | | 222 | /* Framebuffer memory */ |
221 | | | 223 | |
222 | unsigned char *FBBase; | | 224 | unsigned char *FBBase; |
223 | unsigned int FBAvail; | | 225 | unsigned int FBAvail; |
224 | | | 226 | |
225 | /* EXA structures */ | | 227 | /* EXA structures */ |
226 | | | 228 | |
227 | ExaDriverPtr pExa; | | 229 | ExaDriverPtr pExa; |
228 | unsigned int exaBfrOffset; | | 230 | unsigned int exaBfrOffset; |
229 | unsigned int exaBfrSz; | | 231 | unsigned int exaBfrSz; |
230 | | | 232 | |
231 | /* Other structures */ | | 233 | /* Other structures */ |
232 | | | 234 | |
233 | EntityInfoPtr pEnt; | | 235 | EntityInfoPtr pEnt; |
234 | ScreenBlockHandlerProcPtr BlockHandler; /* needed for video */ | | 236 | ScreenBlockHandlerProcPtr BlockHandler; /* needed for video */ |
235 | XF86VideoAdaptorPtr adaptor; | | 237 | XF86VideoAdaptorPtr adaptor; |
236 | | | 238 | |
237 | /* State save structures */ | | 239 | /* State save structures */ |
238 | unsigned long FBDisplayOffset; | | 240 | unsigned long FBDisplayOffset; |
239 | unsigned long PrevDisplayOffset; | | 241 | unsigned long PrevDisplayOffset; |
240 | | | 242 | |
241 | VESARec *vesa; | | 243 | VESARec *vesa; |
242 | | | 244 | |
243 | int FBCompressionEnable; | | 245 | int FBCompressionEnable; |
244 | | | 246 | |
245 | VG_CURSOR_DATA FBCursor; | | 247 | VG_CURSOR_DATA FBCursor; |
246 | | | 248 | |
247 | /* Save the Cursor offset of the FB */ | | 249 | /* Save the Cursor offset of the FB */ |
248 | unsigned long FBCursorOffset; | | 250 | unsigned long FBCursorOffset; |
249 | unsigned char FBBIOSMode; | | 251 | unsigned char FBBIOSMode; |
250 | | | 252 | |
251 | /* Hooks */ | | 253 | /* Hooks */ |
252 | | | 254 | |
253 | void (*PointerMoved) (POINTER_MOVED_ARGS_DECL); | | 255 | void (*PointerMoved) (POINTER_MOVED_ARGS_DECL); |
254 | CloseScreenProcPtr CloseScreen; | | 256 | CloseScreenProcPtr CloseScreen; |
255 | Bool (*CreateScreenResources) (ScreenPtr); | | 257 | Bool (*CreateScreenResources) (ScreenPtr); |
256 | | | 258 | |
257 | /* ===== LX specific items ===== */ | | 259 | /* ===== LX specific items ===== */ |
258 | | | 260 | |
259 | /* Flags */ | | 261 | /* Flags */ |
260 | Bool Scale; | | 262 | Bool Scale; |
261 | | | 263 | |
262 | DisplayModePtr panelMode; /* The mode for the panel (if attached) */ | | 264 | DisplayModePtr panelMode; /* The mode for the panel (if attached) */ |
263 | | | 265 | |
264 | /* Command buffer information */ | | 266 | /* Command buffer information */ |
265 | unsigned long CmdBfrOffset; | | 267 | unsigned long CmdBfrOffset; |
266 | unsigned long CmdBfrSize; | | 268 | unsigned long CmdBfrSize; |
267 | | | 269 | |
268 | /* Memory Management */ | | 270 | /* Memory Management */ |
269 | GeodeMemPtr offscreenList; | | 271 | GeodeMemPtr offscreenList; |
270 | unsigned int offscreenStart; | | 272 | unsigned int offscreenStart; |
271 | unsigned int offscreenSize; | | 273 | unsigned int offscreenSize; |
272 | | | 274 | |
273 | /* Save state */ | | 275 | /* Save state */ |
274 | VG_COMPRESSION_DATA CBData; | | 276 | VG_COMPRESSION_DATA CBData; |
275 | VG_COMPRESSION_DATA FBCBData; | | 277 | VG_COMPRESSION_DATA FBCBData; |
276 | CIM_DISPLAYTIMING FBcimdisplaytiming; | | 278 | CIM_DISPLAYTIMING FBcimdisplaytiming; |
277 | | | 279 | |
278 | /* ===== GX specific items ===== */ | | 280 | /* ===== GX specific items ===== */ |
279 | | | 281 | |
280 | /* Flags */ | | 282 | /* Flags */ |
281 | Bool Panel; | | 283 | Bool Panel; |
282 | | | 284 | |
283 | int PanelX; | | 285 | int PanelX; |
284 | int PanelY; | | 286 | int PanelY; |
285 | | | 287 | |
286 | int displayPitch; /* The pitch ofthe visible area */ | | 288 | int displayPitch; /* The pitch ofthe visible area */ |
287 | int displayOffset; /* The offset of the visible area */ | | 289 | int displayOffset; /* The offset of the visible area */ |
288 | | | 290 | |
289 | DisplayModePtr curMode; | | 291 | DisplayModePtr curMode; |
290 | | | 292 | |
291 | unsigned int shadowSize; | | 293 | unsigned int shadowSize; |
292 | unsigned int shadowOffset; | | 294 | unsigned int shadowOffset; |
293 | | | 295 | |
294 | int FBVGAActive; | | 296 | int FBVGAActive; |
295 | | | 297 | |
296 | xf86CursorInfoPtr CursorInfo; | | 298 | xf86CursorInfoPtr CursorInfo; |
297 | | | 299 | |
298 | /* XAA structures */ | | 300 | /* XAA structures */ |
299 | | | 301 | |
300 | unsigned int cpySrcOffset; | | 302 | unsigned int cpySrcOffset; |
301 | int cpySrcPitch, cpySrcBpp; | | 303 | int cpySrcPitch, cpySrcBpp; |
302 | int cpyDx, cpyDy; | | 304 | int cpyDx, cpyDy; |
303 | unsigned int cmpSrcOffset; | | 305 | unsigned int cmpSrcOffset; |
304 | int cmpSrcPitch, cmpSrcBpp; | | 306 | int cmpSrcPitch, cmpSrcBpp; |
305 | unsigned int cmpSrcFmt, cmpDstFmt; | | 307 | unsigned int cmpSrcFmt, cmpDstFmt; |
306 | int cmpOp; | | 308 | int cmpOp; |
307 | | | 309 | |
308 | unsigned char **AccelImageWriteBuffers; | | 310 | unsigned char **AccelImageWriteBuffers; |
309 | int NoOfImgBuffers; | | 311 | int NoOfImgBuffers; |
310 | unsigned char **AccelColorExpandBuffers; | | 312 | unsigned char **AccelColorExpandBuffers; |
311 | int NoOfColorExpandLines; | | 313 | int NoOfColorExpandLines; |
312 | #if XF86XAA | | 314 | #if XF86XAA |
313 | XAAInfoRecPtr AccelInfoRec; | | 315 | XAAInfoRecPtr AccelInfoRec; |
314 | #endif | | 316 | #endif |
315 | | | 317 | |
316 | /* Save state */ | | 318 | /* Save state */ |
317 | unsigned long FBCompressionOffset; | | 319 | unsigned long FBCompressionOffset; |
318 | unsigned short FBCompressionPitch; | | 320 | unsigned short FBCompressionPitch; |
319 | unsigned short FBCompressionSize; | | 321 | unsigned short FBCompressionSize; |
320 | GFX_DISPLAYTIMING FBgfxdisplaytiming; | | 322 | GFX_DISPLAYTIMING FBgfxdisplaytiming; |
321 | | | 323 | |
322 | /* Hooks */ | | 324 | /* Hooks */ |
323 | void (*WritePixmap) (ScrnInfoPtr pScrni, int x, int y, int w, int h, | | 325 | void (*WritePixmap) (ScrnInfoPtr pScrni, int x, int y, int w, int h, |
324 | unsigned char *src, int srcwidth, int rop, | | 326 | unsigned char *src, int srcwidth, int rop, |
325 | unsigned int planemask, int trans, int bpp, int depth); | | 327 | unsigned int planemask, int trans, int bpp, int depth); |
326 | | | 328 | |
327 | /* Video information */ | | 329 | /* Video information */ |
328 | int video_x; | | 330 | int video_x; |
329 | int video_y; | | 331 | int video_y; |
330 | short video_w; | | 332 | short video_w; |
331 | short video_h; | | 333 | short video_h; |
332 | short video_srcw; | | 334 | short video_srcw; |
333 | short video_srch; | | 335 | short video_srch; |
334 | short video_dstw; | | 336 | short video_dstw; |
335 | short video_dsth; | | 337 | short video_dsth; |
336 | int video_id; | | 338 | int video_id; |
337 | int video_offset; | | 339 | int video_offset; |
338 | ScrnInfoPtr video_scrnptr; | | 340 | ScrnInfoPtr video_scrnptr; |
339 | BOOL OverlayON; | | 341 | BOOL OverlayON; |
340 | } GeodeRec, *GeodePtr; | | 342 | } GeodeRec, *GeodePtr; |
341 | | | 343 | |
342 | /* option flags are self-explanatory */ | | 344 | /* option flags are self-explanatory */ |
343 | #ifdef HAVE_LX | | 345 | #ifdef HAVE_LX |
344 | enum { | | 346 | enum { |
345 | LX_OPTION_SW_CURSOR, | | 347 | LX_OPTION_SW_CURSOR, |
346 | LX_OPTION_HW_CURSOR, | | 348 | LX_OPTION_HW_CURSOR, |
347 | LX_OPTION_NOCOMPRESSION, | | 349 | LX_OPTION_NOCOMPRESSION, |
348 | LX_OPTION_NOACCEL, | | 350 | LX_OPTION_NOACCEL, |
349 | LX_OPTION_EXA_SCRATCH_BFRSZ, | | 351 | LX_OPTION_EXA_SCRATCH_BFRSZ, |
350 | LX_OPTION_TV_SUPPORT, | | 352 | LX_OPTION_TV_SUPPORT, |
351 | LX_OPTION_TV_OUTPUT, | | 353 | LX_OPTION_TV_OUTPUT, |
352 | LX_OPTION_TV_OVERSCAN, | | 354 | LX_OPTION_TV_OVERSCAN, |
353 | LX_OPTION_ROTATE, | | 355 | LX_OPTION_ROTATE, |
354 | LX_OPTION_NOPANEL, | | 356 | LX_OPTION_NOPANEL, |
355 | LX_OPTION_FBSIZE, | | 357 | LX_OPTION_FBSIZE, |
356 | LX_OPTION_PANEL_MODE, | | 358 | LX_OPTION_PANEL_MODE, |
357 | LX_OPTION_DONT_PROGRAM | | 359 | LX_OPTION_DONT_PROGRAM |
358 | } LX_GeodeOpts; | | 360 | } LX_GeodeOpts; |
359 | #endif | | 361 | #endif |
360 | | | 362 | |
361 | #ifdef HAVE_GX | | 363 | #ifdef HAVE_GX |
362 | enum { | | 364 | enum { |
363 | GX_OPTION_SW_CURSOR, | | 365 | GX_OPTION_SW_CURSOR, |
364 | GX_OPTION_HW_CURSOR, | | 366 | GX_OPTION_HW_CURSOR, |
365 | GX_OPTION_NOCOMPRESSION, | | 367 | GX_OPTION_NOCOMPRESSION, |
366 | GX_OPTION_NOACCEL, | | 368 | GX_OPTION_NOACCEL, |
367 | GX_OPTION_ACCEL_METHOD, | | 369 | GX_OPTION_ACCEL_METHOD, |
368 | GX_OPTION_EXA_SCRATCH_BFRSZ, | | 370 | GX_OPTION_EXA_SCRATCH_BFRSZ, |
369 | GX_OPTION_TV_SUPPORT, | | 371 | GX_OPTION_TV_SUPPORT, |
370 | GX_OPTION_TV_OUTPUT, | | 372 | GX_OPTION_TV_OUTPUT, |
371 | GX_OPTION_TV_OVERSCAN, | | 373 | GX_OPTION_TV_OVERSCAN, |
372 | GX_OPTION_ROTATE, | | 374 | GX_OPTION_ROTATE, |
373 | GX_OPTION_NOPANEL, | | 375 | GX_OPTION_NOPANEL, |
374 | GX_OPTION_OSM_IMG_BUFS, | | 376 | GX_OPTION_OSM_IMG_BUFS, |
375 | GX_OPTION_OSM_CLR_BUFS, | | 377 | GX_OPTION_OSM_CLR_BUFS, |
376 | GX_OPTION_FBSIZE, | | 378 | GX_OPTION_FBSIZE, |
377 | GX_OPTION_PANEL_GEOMETRY, | | 379 | GX_OPTION_PANEL_GEOMETRY, |
378 | GX_OPTION_DONT_PROGRAM | | 380 | GX_OPTION_DONT_PROGRAM |
379 | } GX_GeodeOpts; | | 381 | } GX_GeodeOpts; |
380 | #endif | | 382 | #endif |
381 | | | 383 | |
382 | /* geode_dcon.c */ | | 384 | /* geode_dcon.c */ |
383 | extern Bool dcon_init(ScrnInfoPtr pScrni); | | 385 | extern Bool dcon_init(ScrnInfoPtr pScrni); |
384 | extern int DCONDPMSSet(ScrnInfoPtr pScrni, int mode); | | 386 | extern int DCONDPMSSet(ScrnInfoPtr pScrni, int mode); |
385 | | | 387 | |
386 | /* geode_common.c */ | | 388 | /* geode_common.c */ |
387 | | | 389 | |
388 | void geode_memory_to_screen_blt(unsigned long, unsigned long, | | 390 | void geode_memory_to_screen_blt(unsigned long, unsigned long, |
389 | unsigned long, unsigned long, long, long, int); | | 391 | unsigned long, unsigned long, long, long, int); |
390 | int GeodeGetRefreshRate(DisplayModePtr); | | 392 | int GeodeGetRefreshRate(DisplayModePtr); |
391 | void GeodeCopyGreyscale(unsigned char *, unsigned char *, int, int, int, int); | | 393 | void GeodeCopyGreyscale(unsigned char *, unsigned char *, int, int, int, int); |
392 | int GeodeGetSizeFromFB(unsigned int *); | | 394 | int GeodeGetSizeFromFB(unsigned int *); |
393 | | | 395 | |
394 | /* gx_video.c */ | | 396 | /* gx_video.c */ |
395 | | | 397 | |
396 | int | | 398 | int |
397 | | | 399 | |
398 | | | 400 | |
399 | GeodeQueryImageAttributes(ScrnInfoPtr, int id, unsigned short *w, | | 401 | GeodeQueryImageAttributes(ScrnInfoPtr, int id, unsigned short *w, |
400 | unsigned short *h, int *pitches, int *offsets); | | 402 | unsigned short *h, int *pitches, int *offsets); |
401 | | | 403 | |
402 | Bool RegionsEqual(RegionPtr A, RegionPtr B); | | 404 | Bool RegionsEqual(RegionPtr A, RegionPtr B); |
403 | | | 405 | |
404 | /* gx_driver.c */ | | 406 | /* gx_driver.c */ |
405 | | | 407 | |
406 | void GeodeProbeDDC(ScrnInfoPtr pScrni, int index); | | 408 | void GeodeProbeDDC(ScrnInfoPtr pScrni, int index); |
407 | xf86MonPtr GeodeDoDDC(ScrnInfoPtr pScrni, int index); | | 409 | xf86MonPtr GeodeDoDDC(ScrnInfoPtr pScrni, int index); |
408 | Bool GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, char *name); | | 410 | Bool GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, char *name); |
409 | | | 411 | |
410 | int GeodeGetFPGeometry(const char *str, int *width, int *height); | | 412 | int GeodeGetFPGeometry(const char *str, int *width, int *height); |
411 | void GeodePointerMoved(POINTER_MOVED_ARGS_DECL); | | 413 | void GeodePointerMoved(POINTER_MOVED_ARGS_DECL); |
412 | void GeodeFreeScreen(FREE_SCREEN_ARGS_DECL); | | 414 | void GeodeFreeScreen(FREE_SCREEN_ARGS_DECL); |
413 | int GeodeCalculatePitchBytes(unsigned int width, unsigned int bpp); | | 415 | int GeodeCalculatePitchBytes(unsigned int width, unsigned int bpp); |
414 | void GXSetupChipsetFPtr(ScrnInfoPtr pScrn); | | 416 | void GXSetupChipsetFPtr(ScrnInfoPtr pScrn); |
415 | | | 417 | |
416 | /* geode_msr.c */ | | 418 | /* geode_msr.c */ |
417 | int GeodeReadMSR(unsigned long addr, unsigned long *lo, unsigned long *hi); | | 419 | int GeodeReadMSR(unsigned long addr, unsigned long *lo, unsigned long *hi); |
418 | int GeodeWriteMSR(unsigned long addr, unsigned long lo, unsigned long hi); | | 420 | int GeodeWriteMSR(unsigned long addr, unsigned long lo, unsigned long hi); |
419 | | | 421 | |
420 | /* gx_cursor.c */ | | 422 | /* gx_cursor.c */ |
421 | Bool GXHWCursorInit(ScreenPtr pScrn); | | 423 | Bool GXHWCursorInit(ScreenPtr pScrn); |
422 | void GXLoadCursorImage(ScrnInfoPtr pScrni, unsigned char *src); | | 424 | void GXLoadCursorImage(ScrnInfoPtr pScrni, unsigned char *src); |
423 | void GXHideCursor(ScrnInfoPtr pScrni); | | 425 | void GXHideCursor(ScrnInfoPtr pScrni); |
424 | void GXShowCursor(ScrnInfoPtr pScrni); | | 426 | void GXShowCursor(ScrnInfoPtr pScrni); |
425 | | | 427 | |
426 | /* gx_randr.c */ | | 428 | /* gx_randr.c */ |
427 | Rotation GXGetRotation(ScreenPtr pScreen); | | 429 | Rotation GXGetRotation(ScreenPtr pScreen); |
428 | Bool GXRandRInit(ScreenPtr pScreen, int rotation); | | 430 | Bool GXRandRInit(ScreenPtr pScreen, int rotation); |
429 | extern _X_EXPORT Bool GXRandRSetConfig(ScreenPtr pScreen, Rotation rotation, | | 431 | extern _X_EXPORT Bool GXRandRSetConfig(ScreenPtr pScreen, Rotation rotation, |
430 | int rate, RRScreenSizePtr pSize); | | 432 | int rate, RRScreenSizePtr pSize); |
431 | | | 433 | |
432 | /* gx_rotate.c */ | | 434 | /* gx_rotate.c */ |
433 | Bool GXRotate(ScrnInfoPtr pScrni, DisplayModePtr mode); | | 435 | Bool GXRotate(ScrnInfoPtr pScrni, DisplayModePtr mode); |
434 | | | 436 | |
435 | /* gx_accel.c */ | | 437 | /* gx_accel.c */ |
436 | Bool GXAccelInit(ScreenPtr pScrn); | | 438 | Bool GXAccelInit(ScreenPtr pScrn); |
437 | void GXAccelSync(ScrnInfoPtr pScrni); | | 439 | void GXAccelSync(ScrnInfoPtr pScrni); |
438 | | | 440 | |
439 | /* gx_video.c */ | | 441 | /* gx_video.c */ |
440 | void GXInitVideo(ScreenPtr pScrn); | | 442 | void GXInitVideo(ScreenPtr pScrn); |
441 | | | 443 | |
442 | /* lx_driver.c */ | | 444 | /* lx_driver.c */ |
443 | void LXSetupChipsetFPtr(ScrnInfoPtr pScrn); | | 445 | void LXSetupChipsetFPtr(ScrnInfoPtr pScrn); |
444 | | | 446 | |
445 | /* lx_cursor.c */ | | 447 | /* lx_cursor.c */ |
446 | Bool LXHWCursorInit(ScreenPtr pScrn); | | 448 | Bool LXHWCursorInit(ScreenPtr pScrn); |
447 | void LXLoadARGBCursorImage(ScrnInfoPtr pScrni, unsigned char *src); | | 449 | void LXLoadARGBCursorImage(ScrnInfoPtr pScrni, unsigned char *src); |
448 | void LXHideCursor(ScrnInfoPtr pScrni); | | 450 | void LXHideCursor(ScrnInfoPtr pScrni); |
449 | void LXShowCursor(ScrnInfoPtr pScrni); | | 451 | void LXShowCursor(ScrnInfoPtr pScrni); |
450 | | | 452 | |
451 | /* lx_exa.c */ | | 453 | /* lx_exa.c */ |
452 | Bool LXExaInit(ScreenPtr pScreen); | | 454 | Bool LXExaInit(ScreenPtr pScreen); |
453 | | | 455 | |
454 | /* lx_video.c */ | | 456 | /* lx_video.c */ |
455 | void LXInitVideo(ScreenPtr pScrn); | | 457 | void LXInitVideo(ScreenPtr pScrn); |
456 | | | 458 | |
457 | /* lx_output.c */ | | 459 | /* lx_output.c */ |
458 | void LXSetupOutput(ScrnInfoPtr); | | 460 | void LXSetupOutput(ScrnInfoPtr); |
459 | | | 461 | |
460 | /* lx_panel.c */ | | 462 | /* lx_panel.c */ |
461 | DisplayModePtr LXGetLegacyPanelMode(ScrnInfoPtr pScrni); | | 463 | DisplayModePtr LXGetLegacyPanelMode(ScrnInfoPtr pScrni); |
462 | DisplayModePtr LXGetManualPanelMode(char *modestr); | | 464 | DisplayModePtr LXGetManualPanelMode(char *modestr); |
463 | | | 465 | |
464 | void LXAdjustFrame(ADJUST_FRAME_ARGS_DECL); | | 466 | void LXAdjustFrame(ADJUST_FRAME_ARGS_DECL); |
465 | | | 467 | |
466 | /* lx_display.c */ | | 468 | /* lx_display.c */ |
467 | void LXSetupCrtc(ScrnInfoPtr pScrni); | | 469 | void LXSetupCrtc(ScrnInfoPtr pScrni); |
468 | | | 470 | |
469 | /* lx_memory.c */ | | 471 | /* lx_memory.c */ |
470 | GeodeMemPtr GeodeAllocOffscreen(GeodeRec * pGeode, int size, int align); | | 472 | GeodeMemPtr GeodeAllocOffscreen(GeodeRec * pGeode, int size, int align); |
471 | void GeodeFreeOffscreen(GeodeRec * pGeode, GeodeMemPtr ptr); | | 473 | void GeodeFreeOffscreen(GeodeRec * pGeode, GeodeMemPtr ptr); |
472 | void LXInitOffscreen(ScrnInfoPtr pScrni); | | 474 | void LXInitOffscreen(ScrnInfoPtr pScrni); |
473 | void GeodeCloseOffscreen(ScrnInfoPtr pScrni); | | 475 | void GeodeCloseOffscreen(ScrnInfoPtr pScrni); |
474 | unsigned int GeodeOffscreenFreeSize(GeodeRec * pGeode); | | 476 | unsigned int GeodeOffscreenFreeSize(GeodeRec * pGeode); |
475 | | | 477 | |
476 | /* lx_cursor.c */ | | 478 | /* lx_cursor.c */ |
477 | Bool LXCursorInit(ScreenPtr pScrn); | | 479 | Bool LXCursorInit(ScreenPtr pScrn); |
478 | | | 480 | |
479 | #endif | | 481 | #endif |