]> git.pld-linux.org Git - packages/XFree86-Servers.git/blame - XFree86-Servers-ragemobility.patch
- one fix to many
[packages/XFree86-Servers.git] / XFree86-Servers-ragemobility.patch
CommitLineData
3d715510
JB
1diff -cENRr -x CVS -x test base/xc/programs/Xserver/hw/xfree86/accel/mach64/ativga.c devel/xc/programs/Xserver/hw/xfree86/accel/mach64/ativga.c
2*** base/xc/programs/Xserver/hw/xfree86/accel/mach64/ativga.c Wed Feb 9 20:05:48 2000
3--- devel/xc/programs/Xserver/hw/xfree86/accel/mach64/ativga.c Fri Feb 4 09:13:42 2000
4***************
5*** 1,4 ****
6! /* $XFree86: xc/programs/Xserver/hw/xfree86/accel/mach64/ativga.c,v 3.7.2.1 1998/10/18 20:42:04 hohndel Exp $ */
7 /***************************************************************************
8 * Start of VGA font saving and restoration code.
9 * Created: Sun Jun 27 12:50:09 1993 by faith@cs.unc.edu
10--- 1,4 ----
11! /* $XFree86: xc/programs/Xserver/hw/xfree86/accel/mach64/ativga.c,v 3.7.2.1tsi Exp $ */
12 /***************************************************************************
13 * Start of VGA font saving and restoration code.
14 * Created: Sun Jun 27 12:50:09 1993 by faith@cs.unc.edu
15***************
16*** 55,60 ****
17--- 55,61 ----
18
19 typedef struct {
20 vgaHWRec std;
21+ unsigned char shadow_crtc[25];
22 unsigned char ATIExtRegBank[11]; /* ATI Registers B0,B1,B2,B3,
23 B5, B6,B8,B9, BE,A6,A7 */
24 } SaveBlock;
25***************
26*** 104,111 ****
27--- 105,114 ----
28 void mach64SaveVGAInfo(screen_idx)
29 int screen_idx;
30 {
31+ unsigned long saved_lcd_gen_ctrl = 0, lcd_gen_ctrl = 0;
32 unsigned char b2_save;
33 unsigned char b8_save;
34+ int i;
35
36 if (!vgaBase) {
37 vgaBase = xf86MapVidMem(screen_idx, VGA_REGION, (pointer)0xa0000,
38***************
39*** 114,123 ****
40
41 vgaIOBase = (inb(0x3cc) & 0x01) ? 0x3D0 : 0x3B0;
42
43- /* This part is copied from ATISave() in
44- * xf86/vga256/drivers/ati/driver.c
45- */
46-
47 if (!mach64IntegratedController) {
48 /* Unlock ATI specials */
49 outw(ATIExtReg, (((b8_save = inATI(0xb8)) & 0xC0) << 8) | 0xb8);
50--- 117,122 ----
51***************
52*** 126,132 ****
53--- 125,172 ----
54 outw(ATIExtReg, 0x00b2); /* segment select 0 */
55 }
56
57+ if (mach64LCDPanelID >= 0) {
58+ if (mach64ChipType == MACH64_LG_ID) {
59+ saved_lcd_gen_ctrl = regr(LCD_GEN_CTRL);
60+ lcd_gen_ctrl = saved_lcd_gen_ctrl &
61+ ~(CRTC_RW_SELECT | SHADOW_EN | SHADOW_RW_EN);
62+ regw(LCD_GEN_CTRL, lcd_gen_ctrl);
63+ } else {
64+ outb(ioLCD_INDEX, LCD_GEN_CNTL);
65+ saved_lcd_gen_ctrl = inl(ioLCD_DATA);
66+ lcd_gen_ctrl = saved_lcd_gen_ctrl &
67+ ~(CRTC_RW_SELECT | SHADOW_EN | SHADOW_RW_EN);
68+ outl(ioLCD_DATA, lcd_gen_ctrl);
69+ }
70+ }
71+
72 vgaNewVideoState = vgaHWSave(vgaNewVideoState, sizeof(SaveBlock));
73+ /* Unlock VGA CRTC */
74+ outw(vgaIOBase + 4, ((save->std.CRTC[17] & 0x7F) << 8) | 17);
75+
76+ if (mach64LCDPanelID >= 0) {
77+ lcd_gen_ctrl |= SHADOW_EN | SHADOW_RW_EN;
78+ if (mach64ChipType == MACH64_LG_ID) {
79+ regw(LCD_GEN_CTRL, lcd_gen_ctrl);
80+ } else {
81+ outb(ioLCD_INDEX, LCD_GEN_CNTL);
82+ outl(ioLCD_DATA, lcd_gen_ctrl);
83+ }
84+
85+ for (i=0; i<25; i++) {
86+ outb(vgaIOBase + 4, i);
87+ save->shadow_crtc[i] = inb(vgaIOBase + 5);
88+ }
89+ /* Unlock shadow VGA CRTC */
90+ outw(vgaIOBase + 4, ((save->shadow_crtc[17] & 0x7F) << 8) | 17);
91+
92+ if (mach64ChipType == MACH64_LG_ID) {
93+ regw(LCD_GEN_CTRL, saved_lcd_gen_ctrl);
94+ } else {
95+ outb(ioLCD_INDEX, LCD_GEN_CNTL);
96+ outl(ioLCD_DATA, saved_lcd_gen_ctrl);
97+ }
98+ }
99
100 if (!mach64IntegratedController) {
101 save->ATIReg0 = inATI(0xb0);
102***************
103*** 155,163 ****
104
105 void mach64RestoreVGAInfo()
106 {
107! /* This routine is mostly from ATIRestore() in
108! * xf86/vga256/drivers/ati/driver.c
109! */
110
111 if (!mach64IntegratedController) {
112 /* Unlock ATI specials */
113--- 195,202 ----
114
115 void mach64RestoreVGAInfo()
116 {
117! unsigned long saved_lcd_gen_ctrl = 0, lcd_gen_ctrl = 0;
118! int i;
119
120 if (!mach64IntegratedController) {
121 /* Unlock ATI specials */
122***************
123*** 182,191 ****
124--- 221,265 ----
125 outw(ATIExtReg, (save->ATIReg8 << 8) | 0xb8);
126 }
127
128+ if (mach64LCDPanelID >= 0) {
129+ if (mach64ChipType == MACH64_LG_ID) {
130+ saved_lcd_gen_ctrl = regr(LCD_GEN_CTRL);
131+ lcd_gen_ctrl = saved_lcd_gen_ctrl &
132+ ~(CRTC_RW_SELECT | SHADOW_EN | SHADOW_RW_EN);
133+ regw(LCD_GEN_CTRL, lcd_gen_ctrl);
134+ } else {
135+ outb(ioLCD_INDEX, LCD_GEN_CNTL);
136+ saved_lcd_gen_ctrl = inl(ioLCD_DATA);
137+ lcd_gen_ctrl = saved_lcd_gen_ctrl &
138+ ~(CRTC_RW_SELECT | SHADOW_EN | SHADOW_RW_EN);
139+ outl(ioLCD_DATA, lcd_gen_ctrl);
140+ }
141+ }
142+
143 /*
144 * Restore the generic vga registers
145 */
146 vgaHWRestore((vgaHWPtr)save);
147+
148+ if (mach64LCDPanelID >= 0) {
149+ lcd_gen_ctrl |= SHADOW_EN | SHADOW_RW_EN;
150+ if (mach64ChipType == MACH64_LG_ID) {
151+ regw(LCD_GEN_CTRL, lcd_gen_ctrl);
152+ } else {
153+ outb(ioLCD_INDEX, LCD_GEN_CNTL);
154+ outl(ioLCD_DATA, lcd_gen_ctrl);
155+ }
156+
157+ outw(vgaIOBase + 4, ((save->shadow_crtc[17] & 0x7F) << 8) | 17);
158+ for (i=0; i<25; i++) outw(vgaIOBase + 4, (save->shadow_crtc[i] << 8) | i);
159+
160+ if (mach64ChipType == MACH64_LG_ID) {
161+ regw(LCD_GEN_CTRL, saved_lcd_gen_ctrl);
162+ } else {
163+ outb(ioLCD_INDEX, LCD_GEN_CNTL);
164+ outl(ioLCD_DATA, saved_lcd_gen_ctrl);
165+ }
166+ }
167 }
168
169 /*
170diff -cENRr -x CVS -x test base/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64.c devel/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64.c
171*** base/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64.c Wed Feb 9 20:05:49 2000
172--- devel/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64.c Mon Feb 14 09:27:30 2000
173***************
174*** 1,4 ****
175! /* $XFree86: xc/programs/Xserver/hw/xfree86/accel/mach64/mach64.c,v 3.62.2.20 1999/10/12 17:18:42 hohndel Exp $ */
176 /*
177 * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
178 * Copyright 1993,1994,1995,1996,1997 by Kevin E. Martin, Chapel Hill, North Carolina.
179--- 1,4 ----
180! /* $XFree86: xc/programs/Xserver/hw/xfree86/accel/mach64/mach64.c,v 3.62.2.20tsi Exp $ */
181 /*
182 * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
183 * Copyright 1993,1994,1995,1996,1997 by Kevin E. Martin, Chapel Hill, North Carolina.
184***************
185*** 417,422 ****
186--- 417,423 ----
187 int mach64MemClk;
188 int mach64DRAMMemClk;
189 int mach64VRAMMemClk;
190+ int mach64XCLK;
191 int mach64MemCycle;
192 Bool mach64IntegratedController;
193 Bool mach64HasDSP;
194***************
195*** 1540,1545 ****
196--- 1541,1565 ----
197 mach64CXClk = 7; /* Use IBM RGB514 PLL */
198 else
199 mach64CXClk = info->CXClk;
200+ if (mach64HasDSP) {
201+ /* Calculate XCLK */
202+ outb(ioCLOCK_CNTL + 1, MCLK_FB_DIV << 2);
203+ mach64XCLK =
204+ inb(ioCLOCK_CNTL + 2) * 4 * mach64RefFreq / mach64RefDivider;
205+ outb(ioCLOCK_CNTL + 1, PLL_XCLK_CNTL << 2);
206+ i = inb(ioCLOCK_CNTL + 2);
207+ if (!(i & MFB_TIMES_4_2))
208+ mach64XCLK >>= 1;
209+ i = i & XCLK_SRC_SEL;
210+ switch (i) {
211+ case 0: break;
212+ case 1: case 2: case 3: mach64XCLK >>= i; break;
213+ case 4: mach64XCLK /= 3; break;
214+ default:
215+ ErrorF("Unsupported XCLK source: %d!\n", i);
216+ return FALSE;
217+ }
218+ }
219
220 #ifdef DEBUG
221 ErrorF("MinFreq = %d, MaxFreq = %d, RefFreq = %d, RefDivider = %d\n",
222***************
223*** 1561,1567 ****
224
225 mach64LCDHorizontal = info->LCDHorizontal;
226 mach64LCDVertical = info->LCDVertical;
227! mach64LCDClock = mach64GetCTClock(0);
228 ErrorF("%s %s: %dx%d panel (ID %d) detected; clock %.2f MHz\n",
229 XCONFIG_PROBED, mach64InfoRec.name,
230 mach64LCDHorizontal, mach64LCDVertical, mach64LCDPanelID,
231--- 1581,1587 ----
232
233 mach64LCDHorizontal = info->LCDHorizontal;
234 mach64LCDVertical = info->LCDVertical;
235! mach64LCDClock = mach64GetCTClock((inb(0x3cc) >> 2) & 3);
236 ErrorF("%s %s: %dx%d panel (ID %d) detected; clock %.2f MHz\n",
237 XCONFIG_PROBED, mach64InfoRec.name,
238 mach64LCDHorizontal, mach64LCDVertical, mach64LCDPanelID,
239diff -cENRr -x CVS -x test base/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64.h devel/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64.h
240*** base/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64.h Wed Feb 9 20:05:49 2000
241--- devel/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64.h Mon Feb 14 08:52:16 2000
242***************
243*** 1,4 ****
244! /* $XFree86: xc/programs/Xserver/hw/xfree86/accel/mach64/mach64.h,v 3.14.2.6 1999/07/23 13:22:36 hohndel Exp $ */
245 /*
246 * Copyright 1992,1993,1994,1995,1996,1997 by Kevin E. Martin, Chapel Hill, North Carolina.
247 *
248--- 1,4 ----
249! /* $XFree86: xc/programs/Xserver/hw/xfree86/accel/mach64/mach64.h,v 3.14.2.6tsi Exp $ */
250 /*
251 * Copyright 1992,1993,1994,1995,1996,1997 by Kevin E. Martin, Chapel Hill, North Carolina.
252 *
253***************
254*** 29,35 ****
255 #ifndef MACH64_H
256 #define MACH64_H
257
258! #define MACH64_PATCHLEVEL "0"
259
260 #define MACH64_CURSBYTES 1024
261 #define MACH64_CURSMAX 64
262--- 29,35 ----
263 #ifndef MACH64_H
264 #define MACH64_H
265
266! #define MACH64_PATCHLEVEL "1"
267
268 #define MACH64_CURSBYTES 1024
269 #define MACH64_CURSMAX 64
270***************
271*** 85,90 ****
272--- 85,91 ----
273 extern int mach64MemClk;
274 extern int mach64DRAMMemClk;
275 extern int mach64VRAMMemClk;
276+ extern int mach64XCLK;
277 extern int mach64MemCycle;
278
279 extern int mach64LCDPanelID;
280diff -cENRr -x CVS -x test base/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64init.c devel/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64init.c
281*** base/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64init.c Wed Feb 9 20:05:53 2000
282--- devel/xc/programs/Xserver/hw/xfree86/accel/mach64/mach64init.c Mon Feb 14 09:25:05 2000
283***************
284*** 1,4 ****
285! /* $XFree86: xc/programs/Xserver/hw/xfree86/accel/mach64/mach64init.c,v 3.24.2.11 1999/10/12 17:18:43 hohndel Exp $ */
286 /*
287 * Written by Jake Richter
288 * Copyright (c) 1989, 1990 Panacea Inc., Londonderry, NH - All Rights Reserved
289--- 1,4 ----
290! /* $XFree86: xc/programs/Xserver/hw/xfree86/accel/mach64/mach64init.c,v 3.24.2.11tsi Exp $ */
291 /*
292 * Written by Jake Richter
293 * Copyright (c) 1989, 1990 Panacea Inc., Londonderry, NH - All Rights Reserved
294***************
295*** 1120,1126 ****
296 default: bpp = 4; break;
297 }
298
299! x = ((double)mach64VRAMMemClk * 64.0) / (current_dot_clock * (double)bpp);
300 if (mach64LCDPanelID >= 0) /* Compensate for horizontal stretching */
301 x *= (double)mach64LCDHorizontal / (double)current_hdisplay;
302 bx = ceil(log(floor(x))/log(2));
303--- 1120,1126 ----
304 default: bpp = 4; break;
305 }
306
307! x = ((double)mach64XCLK * 64.0) / (current_dot_clock * (double)bpp);
308 if (mach64LCDPanelID >= 0) /* Compensate for horizontal stretching */
309 x *= (double)mach64LCDHorizontal / (double)current_hdisplay;
310 bx = ceil(log(floor(x))/log(2));
311***************
312*** 1275,1281 ****
313 ErrorF("dsp_on = %d, ron = %d, rloop = %d\n", dsp_on, ron, rloop);
314 ErrorF("dsp_off = %d, roff = %d\n", dsp_off, roff);
315 ErrorF("dsp_xclks_per_qw = %d\n", dsp_xclks_per_qw);
316! ErrorF("mach64VRAMMemClk = %d, ", mach64VRAMMemClk);
317 ErrorF("dot_clock = %.3lf, ", current_dot_clock);
318 ErrorF("bpp = %d\n", bpp);
319 ErrorF("trp = %d, ", trp);
320--- 1275,1281 ----
321 ErrorF("dsp_on = %d, ron = %d, rloop = %d\n", dsp_on, ron, rloop);
322 ErrorF("dsp_off = %d, roff = %d\n", dsp_off, roff);
323 ErrorF("dsp_xclks_per_qw = %d\n", dsp_xclks_per_qw);
324! ErrorF("mach64XCLK = %d, ", mach64XCLK);
325 ErrorF("dot_clock = %.3lf, ", current_dot_clock);
326 ErrorF("bpp = %d\n", bpp);
327 ErrorF("trp = %d, ", trp);
328***************
329*** 2899,2906 ****
330 outl(ioLCD_DATA, old_POWER_MANAGEMENT);
331 if ((mach64ChipType != MACH64_LB_ID) &&
332 (mach64ChipType != MACH64_LD_ID) &&
333! (mach64ChipType != MACH64_LR_ID) &&
334! (mach64ChipType != MACH64_LS_ID)) {
335 outb(ioLCD_INDEX, LCD_POWER_MANAGEMENT_2);
336 outl(ioLCD_DATA, old_POWER_MANAGEMENT_2);
337 }
338--- 2899,2906 ----
339 outl(ioLCD_DATA, old_POWER_MANAGEMENT);
340 if ((mach64ChipType != MACH64_LB_ID) &&
341 (mach64ChipType != MACH64_LD_ID) &&
342! (mach64ChipType != MACH64_LI_ID) &&
343! (mach64ChipType != MACH64_LP_ID)) {
344 outb(ioLCD_INDEX, LCD_POWER_MANAGEMENT_2);
345 outl(ioLCD_DATA, old_POWER_MANAGEMENT_2);
346 }
347diff -cENRr -x CVS -x test base/xc/programs/Xserver/hw/xfree86/accel/mach64/regmach64.h devel/xc/programs/Xserver/hw/xfree86/accel/mach64/regmach64.h
348*** base/xc/programs/Xserver/hw/xfree86/accel/mach64/regmach64.h Wed Feb 9 20:05:54 2000
349--- devel/xc/programs/Xserver/hw/xfree86/accel/mach64/regmach64.h Mon Feb 14 09:16:35 2000
350***************
351*** 1,4 ****
352! /* $XFree86: xc/programs/Xserver/hw/xfree86/accel/mach64/regmach64.h,v 3.15.2.8 1999/10/12 17:18:44 hohndel Exp $ */
353 /*
354 * Copyright 1992,1993,1994,1995,1996,1997 by Kevin E. Martin, Chapel Hill, North Carolina.
355 *
356--- 1,4 ----
357! /* $XFree86: xc/programs/Xserver/hw/xfree86/accel/mach64/regmach64.h,v 3.15.2.8tsi Exp $ */
358 /*
359 * Copyright 1992,1993,1994,1995,1996,1997 by Kevin E. Martin, Chapel Hill, North Carolina.
360 *
361***************
362*** 353,358 ****
363--- 353,360 ----
364 #define VCLK1_POST 0x0C
365 #define VCLK2_POST 0x30
366 #define VCLK3_POST 0xC0
367+ #define XCLK_SRC_SEL 0x07
368+ #define MFB_TIMES_4_2 0x08
369
370 /* LCD_INDEX register mapping */
371 #define LCD_REG_INDEX 0x0000000f
372diff -cENRr -x CVS -x test base/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/aticlock.c devel/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/aticlock.c
373*** base/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/aticlock.c Wed Feb 9 20:09:29 2000
374--- devel/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/aticlock.c Wed Feb 2 09:56:02 2000
375***************
376*** 1,4 ****
377! /* $XFree86: xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/aticlock.c,v 1.1.2.3 1999/10/12 17:18:52 hohndel Exp $ */
378 /*
379 * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
380 *
381--- 1,4 ----
382! /* $XFree86: xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/aticlock.c,v 1.1.2.3tsi Exp $ */
383 /*
384 * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
385 *
386***************
387*** 534,539 ****
388--- 534,544 ----
389 for (; Clock_Line[++Clock_Chip_Index]; )
390 {
391 int Maximum_Gap = 0, Clock_Count = 0, Clock_Index = 0;
392+
393+ /* Only Mach64's and Rage128's can have programmable clocks */
394+ if ((Clock_Chip_Index >= ATI_CLOCK_MACH64A) &&
395+ (ATIAdapter < ATI_ADAPTER_MACH64))
396+ break;
397
398 for (; Clock_Index < Number_Of_Clocks; Clock_Index++)
399 {
400diff -cENRr -x CVS -x test base/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/aticonsole.c devel/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/aticonsole.c
401*** base/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/aticonsole.c Wed Feb 9 20:09:29 2000
402--- devel/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/aticonsole.c Wed Feb 2 19:20:42 2000
403***************
404*** 1,4 ****
405! /* $XFree86: xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/aticonsole.c,v 1.1.2.2 1999/10/12 17:18:52 hohndel Exp $ */
406 /*
407 * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
408 *
409--- 1,4 ----
410! /* $XFree86: xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/aticonsole.c,v 1.1.2.2tsi Exp $ */
411 /*
412 * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
413 *
414***************
415*** 54,60 ****
416 saved_crtc_int_cntl, saved_lcd_index;
417
418 static Bool entered = LEAVE;
419! CARD32 tmp;
420
421 # ifdef XFreeXDGA
422 if ((enter == LEAVE) && !ATIUsing1bppModes &&
423--- 54,60 ----
424 saved_crtc_int_cntl, saved_lcd_index;
425
426 static Bool entered = LEAVE;
427! CARD32 tmp, lcd_gen_ctrl = 0, saved_lcd_gen_ctrl = 0;
428
429 # ifdef XFreeXDGA
430 if ((enter == LEAVE) && !ATIUsing1bppModes &&
431***************
432*** 139,149 ****
433 outl(ATIIOPortCRTC_GEN_CNTL, tmp | CRTC_EN);
434 outl(ATIIOPortCRTC_GEN_CNTL, tmp);
435 outl(ATIIOPortCRTC_GEN_CNTL, tmp | CRTC_EN);
436! if (ATIChip >= ATI_CHIP_264XL)
437 {
438 saved_lcd_index = inl(ATIIOPortLCD_INDEX);
439! outl(ATIIOPortLCD_INDEX,
440! saved_lcd_index & ~(LCD_MONDET_INT_EN | LCD_MONDET_INT));
441 }
442
443 /* Ensure VGA aperture is enabled */
444--- 139,150 ----
445 outl(ATIIOPortCRTC_GEN_CNTL, tmp | CRTC_EN);
446 outl(ATIIOPortCRTC_GEN_CNTL, tmp);
447 outl(ATIIOPortCRTC_GEN_CNTL, tmp | CRTC_EN);
448! if (ATILCDPanelID >= 0)
449 {
450 saved_lcd_index = inl(ATIIOPortLCD_INDEX);
451! if (ATIChip >= ATI_CHIP_264XL)
452! outl(ATIIOPortLCD_INDEX, saved_lcd_index &
453! ~(LCD_MONDET_INT_EN | LCD_MONDET_INT));
454 }
455
456 /* Ensure VGA aperture is enabled */
457***************
458*** 191,196 ****
459--- 192,222 ----
460 }
461 }
462
463+ if (ATILCDPanelID >= 0)
464+ {
465+ if (ATIChip == ATI_CHIP_264LT)
466+ {
467+ saved_lcd_gen_ctrl = inl(ATIIOPortLCD_GEN_CTRL);
468+
469+ /* Setup to unlock non-shadow registers */
470+ lcd_gen_ctrl = saved_lcd_gen_ctrl &
471+ ~(CRTC_RW_SELECT | SHADOW_EN | SHADOW_RW_EN);
472+ outl(ATIIOPortLCD_GEN_CTRL, lcd_gen_ctrl);
473+ }
474+ else /* if ((ATIChip == ATI_CHIP_264LTPRO) ||
475+ (ATIChip == ATI_CHIP_264XL) ||
476+ (ATIChip == ATI_CHIP_MOBILITY)) */
477+ {
478+ saved_lcd_gen_ctrl = ATIGetLTProLCDReg(LCD_GEN_CNTL);
479+
480+ /* Setup to unlock shadow registers */
481+ lcd_gen_ctrl = saved_lcd_gen_ctrl &
482+ ~(CRTC_RW_SELECT | SHADOW_EN | SHADOW_RW_EN);
483+ ATIPutLTProLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl);
484+ }
485+ }
486+
487+ UnlockShadowVGA:
488 ATISetVGAIOBase(inb(R_GENMO));
489
490 /*
491***************
492*** 241,258 ****
493--- 267,371 ----
494 VSyncEnd = VBlankEnd - 1;
495 PutReg(CRTX(vgaIOBase), 0x11U, (VSyncEnd & 0x0FU) | 0x20U);
496 }
497+
498+ if (ATILCDPanelID >= 0)
499+ {
500+ Bool DoShadow = TRUE;
501+
502+ lcd_gen_ctrl ^= (SHADOW_EN | SHADOW_RW_EN);
503+ if (!(lcd_gen_ctrl & (SHADOW_EN | SHADOW_RW_EN)))
504+ {
505+ DoShadow = FALSE;
506+ lcd_gen_ctrl = saved_lcd_gen_ctrl;
507+ }
508+
509+ /*
510+ * Setup to unlock shadow registers or restore previous
511+ * selection.
512+ */
513+ if (ATIChip == ATI_CHIP_264LT)
514+ outl(ATIIOPortLCD_GEN_CTRL, lcd_gen_ctrl);
515+ else /* if ((ATIChip == ATI_CHIP_264LTPRO) ||
516+ (ATIChip == ATI_CHIP_264XL) ||
517+ (ATIChip == ATI_CHIP_MOBILITY)) */
518+ {
519+ ATIPutLTProLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl);
520+
521+ /* Restore LCD index */
522+ outb(ATIIOPortLCD_INDEX, GetByte(saved_lcd_index, 0));
523+ }
524+
525+ if (DoShadow)
526+ goto UnlockShadowVGA; /* Unlock shadow registers */
527+ }
528 }
529 }
530 else
531 {
532 if (ATIVGAAdapter != ATI_ADAPTER_NONE)
533 {
534+ if (ATILCDPanelID >= 0)
535+ {
536+ if (ATIChip == ATI_CHIP_264LT)
537+ {
538+ saved_lcd_gen_ctrl = inl(ATIIOPortLCD_GEN_CTRL);
539+
540+ /* Setup to lock non-shadow registers */
541+ lcd_gen_ctrl = saved_lcd_gen_ctrl &
542+ ~(CRTC_RW_SELECT | SHADOW_EN | SHADOW_RW_EN);
543+ outl(ATIIOPortLCD_GEN_CTRL, lcd_gen_ctrl);
544+ }
545+ else /* if ((ATIChip == ATI_CHIP_264LTPRO) ||
546+ (ATIChip == ATI_CHIP_264XL) ||
547+ (ATIChip == ATI_CHIP_MOBILITY)) */
548+ {
549+ saved_lcd_gen_ctrl = ATIGetLTProLCDReg(LCD_GEN_CNTL);
550+
551+ /* Setup to lock shadow registers */
552+ lcd_gen_ctrl = saved_lcd_gen_ctrl &
553+ ~(CRTC_RW_SELECT | SHADOW_EN | SHADOW_RW_EN);
554+ ATIPutLTProLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl);
555+ }
556+ }
557+
558+ LockShadowVGA:
559 ATISetVGAIOBase(inb(R_GENMO));
560
561 /* Protect CRTC[0-7] */
562 tmp = GetReg(CRTX(vgaIOBase), 0x11U);
563 outb(CRTD(vgaIOBase), tmp | 0x80U);
564
565+ if (ATILCDPanelID >= 0)
566+ {
567+ Bool DoShadow = TRUE;
568+
569+ lcd_gen_ctrl ^= (SHADOW_EN | SHADOW_RW_EN);
570+ if (!(lcd_gen_ctrl & (SHADOW_EN | SHADOW_RW_EN)))
571+ {
572+ DoShadow = FALSE;
573+ lcd_gen_ctrl = saved_lcd_gen_ctrl;
574+ }
575+
576+ /*
577+ * Setup to lock shadow registers or restore previous
578+ * selection.
579+ */
580+ if (ATIChip == ATI_CHIP_264LT)
581+ outl(ATIIOPortLCD_GEN_CTRL, lcd_gen_ctrl);
582+ else /* if ((ATIChip == ATI_CHIP_264LTPRO) ||
583+ (ATIChip == ATI_CHIP_264XL) ||
584+ (ATIChip == ATI_CHIP_MOBILITY)) */
585+ {
586+ ATIPutLTProLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl);
587+
588+ /* Restore LCD index */
589+ outb(ATIIOPortLCD_INDEX, GetByte(saved_lcd_index, 0));
590+ }
591+
592+ if (DoShadow)
593+ goto LockShadowVGA; /* Lock shadow registers */
594+ }
595+
596 if (ATIChipHasVGAWonder)
597 {
598 /*
599***************
600*** 315,321 ****
601 outl(ATIIOPortDAC_CNTL, saved_dac_cntl);
602 if (ATIChip < ATI_CHIP_264CT)
603 outl(ATIIOPortMEM_INFO, saved_mem_info);
604! else if (ATIChip >= ATI_CHIP_264XL)
605 outl(ATIIOPortLCD_INDEX, saved_lcd_index);
606 }
607
608--- 428,434 ----
609 outl(ATIIOPortDAC_CNTL, saved_dac_cntl);
610 if (ATIChip < ATI_CHIP_264CT)
611 outl(ATIIOPortMEM_INFO, saved_mem_info);
612! else if (ATILCDPanelID >= 0)
613 outl(ATIIOPortLCD_INDEX, saved_lcd_index);
614 }
615
616diff -cENRr -x CVS -x test base/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/atiprobe.c devel/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/atiprobe.c
617*** base/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/atiprobe.c Wed Feb 9 20:09:32 2000
618--- devel/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/atiprobe.c Tue Feb 1 10:27:18 2000
619***************
620*** 1,4 ****
621! /* $XFree86: xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/atiprobe.c,v 1.1.2.8 1999/10/13 14:32:32 hohndel Exp $ */
622 /*
623 * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
624 *
625--- 1,4 ----
626! /* $XFree86: xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/atiprobe.c,v 1.1.2.8tsi Exp $ */
627 /*
628 * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
629 *
630***************
631*** 1184,1200 ****
632 ATILCDHorizontal = BIOSWord(LCDPanelInfo + 0x19U);
633 ATILCDVertical = BIOSWord(LCDPanelInfo + 0x1BU);
634
635! /* Assume clock 0 */
636! ATILCDClock = 2 * ATIGetMach64PLLReg(PLL_VCLK0_FB_DIV);
637 ATILCDClock *= ATIReferenceNumerator;
638 ATILCDClock /= ATIClockDescriptor->MinM;
639 ATILCDClock /= ATIReferenceDenominator;
640! Index =
641! GetBits(ATIGetMach64PLLReg(PLL_XCLK_CNTL), PLL_VCLK0_XDIV);
642! Index *= MaxBits(PLL_VCLK0_POST_DIV) + 1;
643! Index |= GetBits(ATIGetMach64PLLReg(PLL_VCLK_POST_DIV),
644! PLL_VCLK0_POST_DIV);
645! ATILCDClock /= ATIClockDescriptor->PostDividers[Index];
646 }
647 }
648
649--- 1184,1202 ----
650 ATILCDHorizontal = BIOSWord(LCDPanelInfo + 0x19U);
651 ATILCDVertical = BIOSWord(LCDPanelInfo + 0x1BU);
652
653! /* Compute panel clock */
654! Index = GetBits(inb(R_GENMO), 0x0C);
655! ATILCDClock = 2 * ATIGetMach64PLLReg(PLL_VCLK0_FB_DIV + Index);
656 ATILCDClock *= ATIReferenceNumerator;
657 ATILCDClock /= ATIClockDescriptor->MinM;
658 ATILCDClock /= ATIReferenceDenominator;
659! Index2 =
660! GetBits(ATIGetMach64PLLReg(PLL_XCLK_CNTL),
661! PLL_VCLK0_XDIV << Index);
662! Index2 *= MaxBits(PLL_VCLK0_POST_DIV) + 1;
663! Index2 |= GetBits(ATIGetMach64PLLReg(PLL_VCLK_POST_DIV),
664! PLL_VCLK0_POST_DIV << (2 * Index));
665! ATILCDClock /= ATIClockDescriptor->PostDividers[Index2];
666 }
667 }
668
669diff -cENRr -x CVS -x test base/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/ativersion.h devel/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/ativersion.h
670*** base/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/ativersion.h Wed Feb 9 20:09:34 2000
671--- devel/xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/ativersion.h Wed Feb 9 11:01:02 2000
672***************
673*** 1,4 ****
674! /* $XFree86: xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/ativersion.h,v 1.1.2.5 1999/10/12 17:18:57 hohndel Exp $ */
675 /*
676 * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
677 *
678--- 1,4 ----
679! /* $XFree86: xc/programs/Xserver/hw/xfree86/vga256/drivers/ati/ativersion.h,v 1.1.2.5tsi Exp $ */
680 /*
681 * Copyright 1997 through 1999 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca
682 *
683***************
684*** 24,33 ****
685 #ifndef ___ATIVERSION_H___
686 #define ___ATIVERSION_H___ 1
687
688! #define ATI_VERSION_NAME "4.6"
689
690 #define ATI_VERSION_MAJOR 4
691! #define ATI_VERSION_MINOR 6
692
693 #define ATI_VERSION_CURRENT ((ATI_VERSION_MAJOR << 16) | ATI_VERSION_MINOR)
694
695--- 24,33 ----
696 #ifndef ___ATIVERSION_H___
697 #define ___ATIVERSION_H___ 1
698
699! #define ATI_VERSION_NAME "4.7"
700
701 #define ATI_VERSION_MAJOR 4
702! #define ATI_VERSION_MINOR 7
703
704 #define ATI_VERSION_CURRENT ((ATI_VERSION_MAJOR << 16) | ATI_VERSION_MINOR)
705
This page took 0.127725 seconds and 4 git commands to generate.