View | Details | Raw Unified | Return to bug 3022 | Differences between
and this patch

Collapse All | Expand All

(-)linux-2.6.11-rc4-tank/drivers/video/aty/radeon_pm.c.tppm (-1 / +266 lines)
Lines 25-32 Link Here
25
#include <asm/pmac_feature.h>
25
#include <asm/pmac_feature.h>
26
#endif
26
#endif
27
27
28
/* For detecting supported PC laptops */
29
#ifdef CONFIG_X86
30
#include <linux/dmi.h>
31
#endif
32
28
#include "ati_ids.h"
33
#include "ati_ids.h"
29
34
35
#ifdef CONFIG_X86
36
/* This array holds a list of supported PC laptops.
37
 * Currently only few IBM models are tested.
38
 * If you want to experiment, use dmidecode to find out
39
 * vendor and product codes for Your laptop.
40
 */
41
static struct dmi_system_id __devinitdata radeonfb_dmi_table[] = {
42
	{
43
		/* Reported by George Avrunin <avrunin@math.umass.edu> */
44
		.ident = "IBM ThinkPad T40 (2372-9CU)",
45
		.matches = {
46
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
47
			DMI_MATCH(DMI_PRODUCT_NAME, "23729CU"),
48
		},
49
	},
50
	{
51
		/* Reported by Pete Toscano <pete@verisignlabs.com> */
52
		.ident = "IBM ThinkPad R40 (2722-B3G)",
53
		.matches = {
54
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
55
			DMI_MATCH(DMI_PRODUCT_NAME, "2722B3G"),
56
		},
57
	},
58
	{
59
		/* Reported by Klaus Kurzmann <mok@fluxnetz.de> */
60
		.ident = "IBM ThinkPad T40 (2373-25G)",
61
		.matches = {
62
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
63
			DMI_MATCH(DMI_PRODUCT_NAME, "237325G"),
64
		},
65
	},
66
	{
67
		/* Reported by Antti Andreimann <Antti.Andreimann@mail.ee> */
68
		.ident = "IBM ThinkPad T41 (2373-2FG)",
69
		.matches = {
70
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
71
			DMI_MATCH(DMI_PRODUCT_NAME, "23732FG"),
72
		},
73
	},
74
	{
75
		/* Reported by Antti P Miettinen <apm@brigitte.dna.fi> */
76
		.ident = "IBM ThinkPad T40 (2373-4G2)",
77
		.matches = {
78
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
79
			DMI_MATCH(DMI_PRODUCT_NAME, "23734G2"),
80
	      },
81
	},
82
	{
83
		/* Reported by Pete Toscano <pete@verisignlabs.com> */
84
		.ident = "IBM ThinkPad T40 (2373-92G)",
85
		.matches = {
86
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
87
			DMI_MATCH(DMI_PRODUCT_NAME, "237392G"),
88
	      },
89
	},
90
	{
91
		/* Reported by Pete Toscano <pete@verisignlabs.com> */
92
		.ident = "IBM ThinkPad T40 (2373-8CG)",
93
		.matches = {
94
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
95
			DMI_MATCH(DMI_PRODUCT_NAME, "23738CG"),
96
		},
97
	},
98
	{
99
		/* Reported by Pete Toscano <pete@verisignlabs.com> */
100
		.ident = "IBM ThinkPad T40 (2373-94U)",
101
		.matches = {
102
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
103
			DMI_MATCH(DMI_PRODUCT_NAME, "237394U"),
104
		},
105
	},
106
	{
107
		/* Reported by Manuel Carro <mcarro@fi.upm.es> */
108
		.ident = "IBM ThinkPad T40 (2373-94G)",
109
		.matches = {
110
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
111
			DMI_MATCH(DMI_PRODUCT_NAME, "237394G"),
112
		},
113
	},
114
	{
115
		/* Reported by Ajay Ramaswamy <ajay@ramaswamy.net> */
116
		.ident = "IBM ThinkPad T41 (2373-9HU)",
117
		.matches = {
118
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
119
			DMI_MATCH(DMI_PRODUCT_NAME, "23739HU"),
120
	      },
121
	},
122
	{
123
		/* Reported by Jerome Poggi <Jerome.Poggi@hsc.fr> */
124
		.ident = "IBM ThinkPad T42 (2373-FWG)",
125
		.matches = {
126
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
127
			DMI_MATCH(DMI_PRODUCT_NAME, "2373FWG"),
128
		},
129
	},
130
	{
131
		/* Reported by Juerg Billeter <j@bitron.ch> */
132
		.ident = "IBM ThinkPad T40p (2373-G1G)",
133
		.matches = {
134
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
135
			DMI_MATCH(DMI_PRODUCT_NAME, "2373G1G"),
136
		},
137
	},
138
	{
139
		/* Reported by Hartwig, Thomas <t.hartwig@itth.com> */
140
		.ident = "IBM ThinkPad T40p (2373-G3G)",
141
		.matches = {
142
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
143
			DMI_MATCH(DMI_PRODUCT_NAME, "2373G3G"),
144
		},
145
	},
146
	{
147
		/* Reported by Eric Benson <eric_a_benson@yahoo.com> */
148
		.ident = "IBM ThinkPad T41p (2373-GEU)",
149
		.matches = {
150
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
151
			DMI_MATCH(DMI_PRODUCT_NAME, "2373GEU"),
152
		},
153
	},
154
	{
155
		/* Reported by Dwight Barkley <barkley@maths.warwick.ac.uk> */
156
		.ident = "IBM ThinkPad T42 (2373-JTU)",
157
		.matches = {
158
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
159
			DMI_MATCH(DMI_PRODUCT_NAME, "2373JTU"),
160
		},
161
	},
162
	{
163
		/* Reported by Vernon Mauery <vernux@us.ibm.com> */
164
		.ident = "IBM ThinkPad T40 (2373-MU4)",
165
		.matches = {
166
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
167
			DMI_MATCH(DMI_PRODUCT_NAME, "2373MU4"),
168
		},
169
	},
170
	{
171
		/* Reported by Ajay Ramaswamy <ajay@ramaswamy.net> */
172
		.ident = "IBM ThinkPad T41 (2373-XNX)",
173
		.matches = {
174
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
175
			DMI_MATCH(DMI_PRODUCT_NAME, "2373XNX"),
176
	      },
177
	},
178
	{
179
		/* Reported by obi <graziano@cs.ucsb.edu> */
180
		.ident = "IBM ThinkPad T41 (2378-DEU)",
181
		.matches = {
182
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
183
			DMI_MATCH(DMI_PRODUCT_NAME, "2378DEU"),
184
		},
185
	},
186
	{
187
		/* Reported by Volker Braun <vbraun@physics.upenn.edu> */
188
		.ident = "IBM ThinkPad T41 (2379-DJU)",
189
		.matches = {
190
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
191
			DMI_MATCH(DMI_PRODUCT_NAME, "2379DJU"),
192
		},
193
	},
194
	{
195
		/* Reported by Pete Toscano <pete@verisignlabs.com> */
196
		.ident = "IBM ThinkPad T42 (2373-FWG)",
197
		.matches = {
198
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
199
			DMI_MATCH(DMI_PRODUCT_NAME, "2373FWG"),
200
		},
201
	},
202
	{
203
		/* Reported by Frank Schmitt <tonne2004@gehheimdienst.de> */
204
		.ident = "IBM ThinkPad R40 (2722-3GG)",
205
		.matches = {
206
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
207
			DMI_MATCH(DMI_PRODUCT_NAME, "27223GG"),
208
		},
209
	},
210
	{
211
		/* Reported by Nils Trebing <nils.trebing@uni-konstanz.de> */
212
		.ident = "IBM ThinkPad R40 (2722-5MG)",
213
		.matches = {
214
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
215
			DMI_MATCH(DMI_PRODUCT_NAME, "27225MG"),
216
		},
217
	},
218
	{
219
		/* Reported by Paul Ionescu <i_p_a_u_l@yahoo.com> */
220
		.ident = "IBM ThinkPad T41 (2373-TG5)",
221
		.matches = {
222
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
223
			DMI_MATCH(DMI_PRODUCT_NAME, "2373TG5"),
224
		},
225
	},
226
	{
227
		/* Reported by Michele Lamarca <lammic@gmail.com> */
228
		.ident = "IBM ThinkPad T40 (2373-22G)",
229
		.matches = {
230
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
231
			DMI_MATCH(DMI_PRODUCT_NAME, "237322G"),
232
		},
233
	},
234
	{
235
		/* Reported by Henrik Brix Andersen <brix@gentoo.org> */
236
		.ident = "IBM ThinkPad X31 (2672-XXH)",
237
		.matches = {
238
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
239
			DMI_MATCH(DMI_PRODUCT_NAME, "2672XXH"),
240
		},
241
	},
242
	{
243
		/* Reported by Matthew Saltzman <mjs@clemson.edu> */
244
		.ident = "IBM ThinkPad T41 (2373-7JU)",
245
		.matches = {
246
			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
247
			DMI_MATCH(DMI_PRODUCT_NAME, "23737JU"),
248
		},
249
	},
250
	{ },
251
	/* Negative reports: */
252
	/* IBM thinkpad T30 2366 -> machine hangs 
253
	   Reported by: Jakob Schiotz <schiotz@fysik.dtu.dk> */
254
	/* IBM thinkpad T42p 2373-KUU -> machine hangs as X starts
255
	   Reported by: Dax Kelson <dax@gurulabs.com> */
256
	/* IBM ThinkPad X31 2672-XXH -> works, but doesn't fix the LCD 
257
	   backlight on during S3 issue.
258
	   Reported by: Henrik Brix Andersen <brix@gentoo.org> */
259
};
260
261
extern int radeon_force_sleep;
262
#endif
263
30
void radeon_pm_disable_dynamic_mode(struct radeonfb_info *rinfo)
264
void radeon_pm_disable_dynamic_mode(struct radeonfb_info *rinfo)
31
{
265
{
32
	u32 tmp;
266
	u32 tmp;
Lines 852-858 Link Here
852
	/* because both INPLL and OUTPLL take the same lock, that's why. */
1086
	/* because both INPLL and OUTPLL take the same lock, that's why. */
853
	tmp = INPLL( pllMCLK_MISC) | MCLK_MISC__EN_MCLK_TRISTATE_IN_SUSPEND;
1087
	tmp = INPLL( pllMCLK_MISC) | MCLK_MISC__EN_MCLK_TRISTATE_IN_SUSPEND;
854
	OUTPLL( pllMCLK_MISC, tmp);
1088
	OUTPLL( pllMCLK_MISC, tmp);
855
	
1089
1090
	/* BUS_CNTL1__MOBILE_PLATORM_SEL setting is northbridge chipset
1091
	 * and radeon chip dependent. Thus we only enable it on Mac for
1092
	 * now (until we get more info on how to compute the correct
1093
	 * value for various X86 bridges).
1094
	 */
1095
1096
#ifdef CONFIG_PPC_PMAC
856
	/* AGP PLL control */
1097
	/* AGP PLL control */
857
	if (rinfo->family <= CHIP_FAMILY_RV280) {
1098
	if (rinfo->family <= CHIP_FAMILY_RV280) {
858
		OUTREG(BUS_CNTL1, INREG(BUS_CNTL1) |  BUS_CNTL1__AGPCLK_VALID);
1099
		OUTREG(BUS_CNTL1, INREG(BUS_CNTL1) |  BUS_CNTL1__AGPCLK_VALID);
Lines 864-869 Link Here
864
		OUTREG(BUS_CNTL1, INREG(BUS_CNTL1));
1105
		OUTREG(BUS_CNTL1, INREG(BUS_CNTL1));
865
		OUTREG(BUS_CNTL1, (INREG(BUS_CNTL1) & ~0x4000) | 0x8000);
1106
		OUTREG(BUS_CNTL1, (INREG(BUS_CNTL1) & ~0x4000) | 0x8000);
866
	}
1107
	}
1108
#endif
867
1109
868
	OUTREG(CRTC_OFFSET_CNTL, (INREG(CRTC_OFFSET_CNTL)
1110
	OUTREG(CRTC_OFFSET_CNTL, (INREG(CRTC_OFFSET_CNTL)
869
				  & ~CRTC_OFFSET_CNTL__CRTC_STEREO_SYNC_OUT_EN));
1111
				  & ~CRTC_OFFSET_CNTL__CRTC_STEREO_SYNC_OUT_EN));
Lines 2750-2755 Link Here
2750
#endif
2992
#endif
2751
	}
2993
	}
2752
#endif /* defined(CONFIG_PM) && defined(CONFIG_PPC_OF) */
2994
#endif /* defined(CONFIG_PM) && defined(CONFIG_PPC_OF) */
2995
2996
/* The PM code also works on some PC laptops.
2997
 * Only a few models are actually tested so Your mileage may vary.
2998
 * We can do D2 on at least M7 and M9 on some IBM ThinkPad T41 models.
2999
 */
3000
#if defined(CONFIG_PM) && defined(CONFIG_X86)
3001
	if (radeon_force_sleep || dmi_check_system(radeonfb_dmi_table)) {
3002
		if (radeon_force_sleep)
3003
			printk("radeonfb: forcefully enabling sleep mode\n");
3004
		else
3005
			printk("radeonfb: enabling sleep mode\n");
3006
3007
		if (rinfo->is_mobility && rinfo->pm_reg &&
3008
		    rinfo->family <= CHIP_FAMILY_RV250)
3009
			rinfo->pm_mode |= radeon_pm_d2;
3010
3011
		/* Power down TV DAC, that saves a significant amount of power,
3012
		 * we'll have something better once we actually have some TVOut
3013
		 * support
3014
		 */
3015
		OUTREG(TV_DAC_CNTL, INREG(TV_DAC_CNTL) | 0x07000000);
3016
	}
3017
#endif /* defined(CONFIG_PM) && defined(CONFIG_X86) */
2753
}
3018
}
2754
3019
2755
void radeonfb_pm_exit(struct radeonfb_info *rinfo)
3020
void radeonfb_pm_exit(struct radeonfb_info *rinfo)
(-)linux-2.6.11-rc4-tank/drivers/video/aty/radeon_base.c.tppm (+9 lines)
Lines 273-278 Link Here
273
#ifdef CONFIG_MTRR
273
#ifdef CONFIG_MTRR
274
static int nomtrr = 0;
274
static int nomtrr = 0;
275
#endif
275
#endif
276
#if defined(CONFIG_PM) && defined(CONFIG_X86)
277
int radeon_force_sleep = 0;
278
#endif
276
279
277
/*
280
/*
278
 * prototypes
281
 * prototypes
Lines 2535-2540 Link Here
2535
			force_measure_pll = 1;
2538
			force_measure_pll = 1;
2536
		} else if (!strncmp(this_opt, "ignore_edid", 11)) {
2539
		} else if (!strncmp(this_opt, "ignore_edid", 11)) {
2537
			ignore_edid = 1;
2540
			ignore_edid = 1;
2541
#if defined(CONFIG_PM) && defined(CONFIG_X86)
2542
		} else if (!strncmp(this_opt, "force_sleep", 11)) {
2543
			radeon_force_sleep = 1;
2544
#endif
2538
		} else
2545
		} else
2539
			mode_option = this_opt;
2546
			mode_option = this_opt;
2540
	}
2547
	}
Lines 2574-2576 Link Here
2574
MODULE_PARM_DESC(panel_yres, "int: set panel yres");
2581
MODULE_PARM_DESC(panel_yres, "int: set panel yres");
2575
module_param(mode_option, charp, 0);
2582
module_param(mode_option, charp, 0);
2576
MODULE_PARM_DESC(mode_option, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" ");
2583
MODULE_PARM_DESC(mode_option, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" ");
2584
module_param(radeon_force_sleep, int, 0);
2585
MODULE_PARM_DESC(radeon_force_sleep, "bool: force ACPI sleep mode on untested machines");

Return to bug 3022