diff options
Diffstat (limited to 'meta-moblin/packages/linux/linux-moblin-2.6.28+2.6.29-rc2/i915_split.patch')
-rw-r--r-- | meta-moblin/packages/linux/linux-moblin-2.6.28+2.6.29-rc2/i915_split.patch | 1627 |
1 files changed, 1627 insertions, 0 deletions
diff --git a/meta-moblin/packages/linux/linux-moblin-2.6.28+2.6.29-rc2/i915_split.patch b/meta-moblin/packages/linux/linux-moblin-2.6.28+2.6.29-rc2/i915_split.patch new file mode 100644 index 0000000000..1841a681d2 --- /dev/null +++ b/meta-moblin/packages/linux/linux-moblin-2.6.28+2.6.29-rc2/i915_split.patch | |||
@@ -0,0 +1,1627 @@ | |||
1 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_tv.c | ||
2 | =================================================================== | ||
3 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_tv.c 2009-02-19 12:59:22.000000000 +0000 | ||
4 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_tv.c 2009-02-19 12:59:28.000000000 +0000 | ||
5 | @@ -902,7 +902,7 @@ | ||
6 | intel_tv_dpms(struct drm_encoder *encoder, int mode) | ||
7 | { | ||
8 | struct drm_device *dev = encoder->dev; | ||
9 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
10 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
11 | |||
12 | switch(mode) { | ||
13 | case DRM_MODE_DPMS_ON: | ||
14 | @@ -920,7 +920,7 @@ | ||
15 | intel_tv_save(struct drm_connector *connector) | ||
16 | { | ||
17 | struct drm_device *dev = connector->dev; | ||
18 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
19 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
20 | struct intel_output *intel_output = to_intel_output(connector); | ||
21 | struct intel_tv_priv *tv_priv = intel_output->dev_priv; | ||
22 | int i; | ||
23 | @@ -970,7 +970,7 @@ | ||
24 | intel_tv_restore(struct drm_connector *connector) | ||
25 | { | ||
26 | struct drm_device *dev = connector->dev; | ||
27 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
28 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
29 | struct intel_output *intel_output = to_intel_output(connector); | ||
30 | struct intel_tv_priv *tv_priv = intel_output->dev_priv; | ||
31 | struct drm_crtc *crtc = connector->encoder->crtc; | ||
32 | @@ -1117,7 +1117,7 @@ | ||
33 | struct drm_display_mode *adjusted_mode) | ||
34 | { | ||
35 | struct drm_device *dev = encoder->dev; | ||
36 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
37 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
38 | struct drm_crtc *crtc = encoder->crtc; | ||
39 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
40 | struct intel_output *intel_output = enc_to_intel_output(encoder); | ||
41 | @@ -1362,6 +1362,7 @@ | ||
42 | struct drm_encoder *encoder = &intel_output->enc; | ||
43 | struct drm_device *dev = encoder->dev; | ||
44 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
45 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
46 | unsigned long irqflags; | ||
47 | u32 tv_ctl, save_tv_ctl; | ||
48 | u32 tv_dac, save_tv_dac; | ||
49 | @@ -1626,6 +1627,7 @@ | ||
50 | intel_tv_init(struct drm_device *dev) | ||
51 | { | ||
52 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
53 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
54 | struct drm_connector *connector; | ||
55 | struct intel_output *intel_output; | ||
56 | struct intel_tv_priv *tv_priv; | ||
57 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_modes.c | ||
58 | =================================================================== | ||
59 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_modes.c 2009-02-19 12:59:22.000000000 +0000 | ||
60 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_modes.c 2009-02-19 12:59:28.000000000 +0000 | ||
61 | @@ -81,3 +81,6 @@ | ||
62 | |||
63 | return ret; | ||
64 | } | ||
65 | +EXPORT_SYMBOL(intel_ddc_get_modes); | ||
66 | + | ||
67 | +MODULE_LICENSE("GPL and additional rights"); | ||
68 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_i2c.c | ||
69 | =================================================================== | ||
70 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_i2c.c 2009-02-19 12:59:22.000000000 +0000 | ||
71 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_i2c.c 2009-02-20 14:50:20.000000000 +0000 | ||
72 | @@ -43,7 +43,7 @@ | ||
73 | static int get_clock(void *data) | ||
74 | { | ||
75 | struct intel_i2c_chan *chan = data; | ||
76 | - struct drm_i915_private *dev_priv = chan->drm_dev->dev_private; | ||
77 | + struct drm_i915_common_private *dev_priv_common = chan->drm_dev->dev_private; | ||
78 | u32 val; | ||
79 | |||
80 | val = I915_READ(chan->reg); | ||
81 | @@ -53,7 +53,7 @@ | ||
82 | static int get_data(void *data) | ||
83 | { | ||
84 | struct intel_i2c_chan *chan = data; | ||
85 | - struct drm_i915_private *dev_priv = chan->drm_dev->dev_private; | ||
86 | + struct drm_i915_common_private *dev_priv_common = chan->drm_dev->dev_private; | ||
87 | u32 val; | ||
88 | |||
89 | val = I915_READ(chan->reg); | ||
90 | @@ -64,7 +64,7 @@ | ||
91 | { | ||
92 | struct intel_i2c_chan *chan = data; | ||
93 | struct drm_device *dev = chan->drm_dev; | ||
94 | - struct drm_i915_private *dev_priv = chan->drm_dev->dev_private; | ||
95 | + struct drm_i915_common_private *dev_priv_common = chan->drm_dev->dev_private; | ||
96 | u32 reserved = 0, clock_bits; | ||
97 | |||
98 | /* On most chips, these bits must be preserved in software. */ | ||
99 | @@ -85,7 +85,7 @@ | ||
100 | { | ||
101 | struct intel_i2c_chan *chan = data; | ||
102 | struct drm_device *dev = chan->drm_dev; | ||
103 | - struct drm_i915_private *dev_priv = chan->drm_dev->dev_private; | ||
104 | + struct drm_i915_common_private *dev_priv_common = chan->drm_dev->dev_private; | ||
105 | u32 reserved = 0, data_bits; | ||
106 | |||
107 | /* On most chips, these bits must be preserved in software. */ | ||
108 | @@ -167,6 +167,7 @@ | ||
109 | kfree(chan); | ||
110 | return NULL; | ||
111 | } | ||
112 | +EXPORT_SYMBOL(intel_i2c_create); | ||
113 | |||
114 | /** | ||
115 | * intel_i2c_destroy - unregister and free i2c bus resources | ||
116 | @@ -182,3 +183,4 @@ | ||
117 | i2c_del_adapter(&chan->adapter); | ||
118 | kfree(chan); | ||
119 | } | ||
120 | +EXPORT_SYMBOL(intel_i2c_destroy); | ||
121 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_dvo.c | ||
122 | =================================================================== | ||
123 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_dvo.c 2009-02-19 12:59:22.000000000 +0000 | ||
124 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_dvo.c 2009-02-19 15:14:20.000000000 +0000 | ||
125 | @@ -78,7 +78,7 @@ | ||
126 | |||
127 | static void intel_dvo_dpms(struct drm_encoder *encoder, int mode) | ||
128 | { | ||
129 | - struct drm_i915_private *dev_priv = encoder->dev->dev_private; | ||
130 | + struct drm_i915_common_private *dev_priv_common = encoder->dev->dev_private; | ||
131 | struct intel_output *intel_output = enc_to_intel_output(encoder); | ||
132 | struct intel_dvo_device *dvo = intel_output->dev_priv; | ||
133 | u32 dvo_reg = dvo->dvo_reg; | ||
134 | @@ -98,15 +98,16 @@ | ||
135 | static void intel_dvo_save(struct drm_connector *connector) | ||
136 | { | ||
137 | struct drm_i915_private *dev_priv = connector->dev->dev_private; | ||
138 | + struct drm_i915_common_private *dev_priv_common = connector->dev->dev_private; | ||
139 | struct intel_output *intel_output = to_intel_output(connector); | ||
140 | struct intel_dvo_device *dvo = intel_output->dev_priv; | ||
141 | |||
142 | /* Each output should probably just save the registers it touches, | ||
143 | * but for now, use more overkill. | ||
144 | */ | ||
145 | - dev_priv->saveDVOA = I915_READ(DVOA); | ||
146 | - dev_priv->saveDVOB = I915_READ(DVOB); | ||
147 | - dev_priv->saveDVOC = I915_READ(DVOC); | ||
148 | + dev_priv->common.saveDVOA = I915_READ(DVOA); | ||
149 | + dev_priv->common.saveDVOB = I915_READ(DVOB); | ||
150 | + dev_priv->common.saveDVOC = I915_READ(DVOC); | ||
151 | |||
152 | dvo->dev_ops->save(dvo); | ||
153 | } | ||
154 | @@ -114,14 +115,15 @@ | ||
155 | static void intel_dvo_restore(struct drm_connector *connector) | ||
156 | { | ||
157 | struct drm_i915_private *dev_priv = connector->dev->dev_private; | ||
158 | + struct drm_i915_common_private *dev_priv_common = connector->dev->dev_private; | ||
159 | struct intel_output *intel_output = to_intel_output(connector); | ||
160 | struct intel_dvo_device *dvo = intel_output->dev_priv; | ||
161 | |||
162 | dvo->dev_ops->restore(dvo); | ||
163 | |||
164 | - I915_WRITE(DVOA, dev_priv->saveDVOA); | ||
165 | - I915_WRITE(DVOB, dev_priv->saveDVOB); | ||
166 | - I915_WRITE(DVOC, dev_priv->saveDVOC); | ||
167 | + I915_WRITE(DVOA, dev_priv->common.saveDVOA); | ||
168 | + I915_WRITE(DVOB, dev_priv->common.saveDVOB); | ||
169 | + I915_WRITE(DVOC, dev_priv->common.saveDVOC); | ||
170 | } | ||
171 | |||
172 | static int intel_dvo_mode_valid(struct drm_connector *connector, | ||
173 | @@ -183,7 +185,7 @@ | ||
174 | struct drm_display_mode *adjusted_mode) | ||
175 | { | ||
176 | struct drm_device *dev = encoder->dev; | ||
177 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
178 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
179 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); | ||
180 | struct intel_output *intel_output = enc_to_intel_output(encoder); | ||
181 | struct intel_dvo_device *dvo = intel_output->dev_priv; | ||
182 | @@ -349,7 +351,7 @@ | ||
183 | intel_dvo_get_current_mode (struct drm_connector *connector) | ||
184 | { | ||
185 | struct drm_device *dev = connector->dev; | ||
186 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
187 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
188 | struct intel_output *intel_output = to_intel_output(connector); | ||
189 | struct intel_dvo_device *dvo = intel_output->dev_priv; | ||
190 | uint32_t dvo_reg = dvo->dvo_reg; | ||
191 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_hdmi.c | ||
192 | =================================================================== | ||
193 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_hdmi.c 2009-02-19 12:59:22.000000000 +0000 | ||
194 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_hdmi.c 2009-02-19 12:59:28.000000000 +0000 | ||
195 | @@ -46,7 +46,7 @@ | ||
196 | struct drm_display_mode *adjusted_mode) | ||
197 | { | ||
198 | struct drm_device *dev = encoder->dev; | ||
199 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
200 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
201 | struct drm_crtc *crtc = encoder->crtc; | ||
202 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
203 | struct intel_output *intel_output = enc_to_intel_output(encoder); | ||
204 | @@ -71,7 +71,7 @@ | ||
205 | static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode) | ||
206 | { | ||
207 | struct drm_device *dev = encoder->dev; | ||
208 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
209 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
210 | struct intel_output *intel_output = enc_to_intel_output(encoder); | ||
211 | struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv; | ||
212 | u32 temp; | ||
213 | @@ -89,7 +89,7 @@ | ||
214 | static void intel_hdmi_save(struct drm_connector *connector) | ||
215 | { | ||
216 | struct drm_device *dev = connector->dev; | ||
217 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
218 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
219 | struct intel_output *intel_output = to_intel_output(connector); | ||
220 | struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv; | ||
221 | |||
222 | @@ -99,7 +99,7 @@ | ||
223 | static void intel_hdmi_restore(struct drm_connector *connector) | ||
224 | { | ||
225 | struct drm_device *dev = connector->dev; | ||
226 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
227 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
228 | struct intel_output *intel_output = to_intel_output(connector); | ||
229 | struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv; | ||
230 | |||
231 | @@ -132,7 +132,7 @@ | ||
232 | intel_hdmi_detect(struct drm_connector *connector) | ||
233 | { | ||
234 | struct drm_device *dev = connector->dev; | ||
235 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
236 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
237 | struct intel_output *intel_output = to_intel_output(connector); | ||
238 | struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv; | ||
239 | u32 temp, bit; | ||
240 | @@ -220,7 +220,7 @@ | ||
241 | |||
242 | void intel_hdmi_init(struct drm_device *dev, int sdvox_reg) | ||
243 | { | ||
244 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
245 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
246 | struct drm_connector *connector; | ||
247 | struct intel_output *intel_output; | ||
248 | struct intel_hdmi_priv *hdmi_priv; | ||
249 | Index: linux-2.6.28/drivers/gpu/drm/i915/i915_suspend.c | ||
250 | =================================================================== | ||
251 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/i915_suspend.c 2009-02-19 12:59:22.000000000 +0000 | ||
252 | +++ linux-2.6.28/drivers/gpu/drm/i915/i915_suspend.c 2009-02-19 12:59:28.000000000 +0000 | ||
253 | @@ -31,7 +31,7 @@ | ||
254 | |||
255 | static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe) | ||
256 | { | ||
257 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
258 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
259 | |||
260 | if (pipe == PIPE_A) | ||
261 | return (I915_READ(DPLL_A) & DPLL_VCO_ENABLE); | ||
262 | @@ -41,7 +41,7 @@ | ||
263 | |||
264 | static void i915_save_palette(struct drm_device *dev, enum pipe pipe) | ||
265 | { | ||
266 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
267 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
268 | unsigned long reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B); | ||
269 | u32 *array; | ||
270 | int i; | ||
271 | @@ -50,9 +50,9 @@ | ||
272 | return; | ||
273 | |||
274 | if (pipe == PIPE_A) | ||
275 | - array = dev_priv->save_palette_a; | ||
276 | + array = dev_priv_common->save_palette_a; | ||
277 | else | ||
278 | - array = dev_priv->save_palette_b; | ||
279 | + array = dev_priv_common->save_palette_b; | ||
280 | |||
281 | for(i = 0; i < 256; i++) | ||
282 | array[i] = I915_READ(reg + (i << 2)); | ||
283 | @@ -60,7 +60,7 @@ | ||
284 | |||
285 | static void i915_restore_palette(struct drm_device *dev, enum pipe pipe) | ||
286 | { | ||
287 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
288 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
289 | unsigned long reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B); | ||
290 | u32 *array; | ||
291 | int i; | ||
292 | @@ -69,9 +69,9 @@ | ||
293 | return; | ||
294 | |||
295 | if (pipe == PIPE_A) | ||
296 | - array = dev_priv->save_palette_a; | ||
297 | + array = dev_priv_common->save_palette_a; | ||
298 | else | ||
299 | - array = dev_priv->save_palette_b; | ||
300 | + array = dev_priv_common->save_palette_b; | ||
301 | |||
302 | for(i = 0; i < 256; i++) | ||
303 | I915_WRITE(reg + (i << 2), array[i]); | ||
304 | @@ -79,7 +79,7 @@ | ||
305 | |||
306 | static u8 i915_read_indexed(struct drm_device *dev, u16 index_port, u16 data_port, u8 reg) | ||
307 | { | ||
308 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
309 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
310 | |||
311 | I915_WRITE8(index_port, reg); | ||
312 | return I915_READ8(data_port); | ||
313 | @@ -87,7 +87,7 @@ | ||
314 | |||
315 | static u8 i915_read_ar(struct drm_device *dev, u16 st01, u8 reg, u16 palette_enable) | ||
316 | { | ||
317 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
318 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
319 | |||
320 | I915_READ8(st01); | ||
321 | I915_WRITE8(VGA_AR_INDEX, palette_enable | reg); | ||
322 | @@ -96,7 +96,7 @@ | ||
323 | |||
324 | static void i915_write_ar(struct drm_device *dev, u16 st01, u8 reg, u8 val, u16 palette_enable) | ||
325 | { | ||
326 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
327 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
328 | |||
329 | I915_READ8(st01); | ||
330 | I915_WRITE8(VGA_AR_INDEX, palette_enable | reg); | ||
331 | @@ -105,7 +105,7 @@ | ||
332 | |||
333 | static void i915_write_indexed(struct drm_device *dev, u16 index_port, u16 data_port, u8 reg, u8 val) | ||
334 | { | ||
335 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
336 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
337 | |||
338 | I915_WRITE8(index_port, reg); | ||
339 | I915_WRITE8(data_port, val); | ||
340 | @@ -113,7 +113,8 @@ | ||
341 | |||
342 | static void i915_save_vga(struct drm_device *dev) | ||
343 | { | ||
344 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
345 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
346 | + struct drm_i915_common_private *dev_priv = dev->dev_private; | ||
347 | int i; | ||
348 | u16 cr_index, cr_data, st01; | ||
349 | |||
350 | @@ -176,7 +177,8 @@ | ||
351 | |||
352 | static void i915_restore_vga(struct drm_device *dev) | ||
353 | { | ||
354 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
355 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
356 | + struct drm_i915_common_private *dev_priv = dev->dev_private; | ||
357 | int i; | ||
358 | u16 cr_index, cr_data, st01; | ||
359 | |||
360 | @@ -235,7 +237,8 @@ | ||
361 | |||
362 | int i915_save_state(struct drm_device *dev) | ||
363 | { | ||
364 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
365 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
366 | + struct drm_i915_common_private *dev_priv = dev->dev_private; | ||
367 | int i; | ||
368 | |||
369 | pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB); | ||
370 | @@ -367,7 +370,8 @@ | ||
371 | |||
372 | int i915_restore_state(struct drm_device *dev) | ||
373 | { | ||
374 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
375 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
376 | + struct drm_i915_common_private *dev_priv = dev->dev_private; | ||
377 | int i; | ||
378 | |||
379 | pci_write_config_byte(dev->pdev, LBB, dev_priv->saveLBB); | ||
380 | Index: linux-2.6.28/drivers/gpu/drm/i915/i915_opregion.c | ||
381 | =================================================================== | ||
382 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/i915_opregion.c 2009-02-19 12:59:22.000000000 +0000 | ||
383 | +++ linux-2.6.28/drivers/gpu/drm/i915/i915_opregion.c 2009-02-19 12:59:28.000000000 +0000 | ||
384 | @@ -139,6 +139,7 @@ | ||
385 | static u32 asle_set_backlight(struct drm_device *dev, u32 bclp) | ||
386 | { | ||
387 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
388 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
389 | struct opregion_asle *asle = dev_priv->opregion.asle; | ||
390 | u32 blc_pwm_ctl, blc_pwm_ctl2; | ||
391 | |||
392 | @@ -172,7 +173,8 @@ | ||
393 | |||
394 | static u32 asle_set_pwm_freq(struct drm_device *dev, u32 pfmb) | ||
395 | { | ||
396 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
397 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
398 | + | ||
399 | if (pfmb & ASLE_PFMB_PWM_VALID) { | ||
400 | u32 blc_pwm_ctl = I915_READ(BLC_PWM_CTL); | ||
401 | u32 pwm = pfmb & ASLE_PFMB_PWM_MASK; | ||
402 | Index: linux-2.6.28/drivers/gpu/drm/i915/i915_gem.c | ||
403 | =================================================================== | ||
404 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/i915_gem.c 2009-02-19 12:59:22.000000000 +0000 | ||
405 | +++ linux-2.6.28/drivers/gpu/drm/i915/i915_gem.c 2009-02-19 12:59:28.000000000 +0000 | ||
406 | @@ -877,6 +877,7 @@ | ||
407 | i915_add_request(struct drm_device *dev, uint32_t flush_domains) | ||
408 | { | ||
409 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
410 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
411 | struct drm_i915_gem_request *request; | ||
412 | uint32_t seqno; | ||
413 | int was_empty; | ||
414 | @@ -942,6 +943,7 @@ | ||
415 | static uint32_t | ||
416 | i915_retire_commands(struct drm_device *dev) | ||
417 | { | ||
418 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
419 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
420 | uint32_t cmd = MI_FLUSH | MI_NO_WRITE_FLUSH; | ||
421 | uint32_t flush_domains = 0; | ||
422 | @@ -1049,12 +1051,14 @@ | ||
423 | void | ||
424 | i915_gem_retire_work_handler(struct work_struct *work) | ||
425 | { | ||
426 | + struct drm_i915_common_private *dev_priv_common; | ||
427 | drm_i915_private_t *dev_priv; | ||
428 | struct drm_device *dev; | ||
429 | |||
430 | dev_priv = container_of(work, drm_i915_private_t, | ||
431 | mm.retire_work.work); | ||
432 | dev = dev_priv->dev; | ||
433 | + dev_priv_common = dev->dev_private; | ||
434 | |||
435 | mutex_lock(&dev->struct_mutex); | ||
436 | i915_gem_retire_requests(dev); | ||
437 | @@ -1109,6 +1113,7 @@ | ||
438 | uint32_t invalidate_domains, | ||
439 | uint32_t flush_domains) | ||
440 | { | ||
441 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
442 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
443 | uint32_t cmd; | ||
444 | RING_LOCALS; | ||
445 | @@ -1422,7 +1427,7 @@ | ||
446 | { | ||
447 | struct drm_gem_object *obj = reg->obj; | ||
448 | struct drm_device *dev = obj->dev; | ||
449 | - drm_i915_private_t *dev_priv = dev->dev_private; | ||
450 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
451 | struct drm_i915_gem_object *obj_priv = obj->driver_private; | ||
452 | int regnum = obj_priv->fence_reg; | ||
453 | uint64_t val; | ||
454 | @@ -1442,8 +1447,8 @@ | ||
455 | { | ||
456 | struct drm_gem_object *obj = reg->obj; | ||
457 | struct drm_device *dev = obj->dev; | ||
458 | - drm_i915_private_t *dev_priv = dev->dev_private; | ||
459 | struct drm_i915_gem_object *obj_priv = obj->driver_private; | ||
460 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
461 | int regnum = obj_priv->fence_reg; | ||
462 | uint32_t val; | ||
463 | uint32_t pitch_val; | ||
464 | @@ -1475,7 +1480,7 @@ | ||
465 | { | ||
466 | struct drm_gem_object *obj = reg->obj; | ||
467 | struct drm_device *dev = obj->dev; | ||
468 | - drm_i915_private_t *dev_priv = dev->dev_private; | ||
469 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
470 | struct drm_i915_gem_object *obj_priv = obj->driver_private; | ||
471 | int regnum = obj_priv->fence_reg; | ||
472 | uint32_t val; | ||
473 | @@ -1605,6 +1610,7 @@ | ||
474 | { | ||
475 | struct drm_device *dev = obj->dev; | ||
476 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
477 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
478 | struct drm_i915_gem_object *obj_priv = obj->driver_private; | ||
479 | |||
480 | if (IS_I965G(dev)) | ||
481 | @@ -2327,6 +2333,7 @@ | ||
482 | uint64_t exec_offset) | ||
483 | { | ||
484 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
485 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
486 | struct drm_clip_rect __user *boxes = (struct drm_clip_rect __user *) | ||
487 | (uintptr_t) exec->cliprects_ptr; | ||
488 | int nbox = exec->num_cliprects; | ||
489 | @@ -3035,6 +3042,7 @@ | ||
490 | i915_gem_init_hws(struct drm_device *dev) | ||
491 | { | ||
492 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
493 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
494 | struct drm_gem_object *obj; | ||
495 | struct drm_i915_gem_object *obj_priv; | ||
496 | int ret; | ||
497 | @@ -3081,6 +3089,7 @@ | ||
498 | i915_gem_init_ringbuffer(struct drm_device *dev) | ||
499 | { | ||
500 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
501 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
502 | struct drm_gem_object *obj; | ||
503 | struct drm_i915_gem_object *obj_priv; | ||
504 | drm_i915_ring_buffer_t *ring = &dev_priv->ring; | ||
505 | @@ -3186,6 +3195,7 @@ | ||
506 | void | ||
507 | i915_gem_cleanup_ringbuffer(struct drm_device *dev) | ||
508 | { | ||
509 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
510 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
511 | |||
512 | if (dev_priv->ring.ring_obj == NULL) | ||
513 | Index: linux-2.6.28/drivers/gpu/drm/i915/i915_gem_proc.c | ||
514 | =================================================================== | ||
515 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/i915_gem_proc.c 2009-02-19 12:59:22.000000000 +0000 | ||
516 | +++ linux-2.6.28/drivers/gpu/drm/i915/i915_gem_proc.c 2009-02-19 12:59:28.000000000 +0000 | ||
517 | @@ -213,6 +213,7 @@ | ||
518 | struct drm_minor *minor = (struct drm_minor *) data; | ||
519 | struct drm_device *dev = minor->dev; | ||
520 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
521 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
522 | int len = 0; | ||
523 | |||
524 | if (offset > DRM_PROC_LIMIT) { | ||
525 | Index: linux-2.6.28/drivers/gpu/drm/i915/i915_gem_tiling.c | ||
526 | =================================================================== | ||
527 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/i915_gem_tiling.c 2009-02-19 12:59:22.000000000 +0000 | ||
528 | +++ linux-2.6.28/drivers/gpu/drm/i915/i915_gem_tiling.c 2009-02-19 12:59:28.000000000 +0000 | ||
529 | @@ -87,6 +87,7 @@ | ||
530 | i915_gem_detect_bit_6_swizzle(struct drm_device *dev) | ||
531 | { | ||
532 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
533 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
534 | uint32_t swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN; | ||
535 | uint32_t swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN; | ||
536 | |||
537 | Index: linux-2.6.28/drivers/gpu/drm/i915/i915_irq.c | ||
538 | =================================================================== | ||
539 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/i915_irq.c 2009-02-19 12:59:22.000000000 +0000 | ||
540 | +++ linux-2.6.28/drivers/gpu/drm/i915/i915_irq.c 2009-02-20 14:53:08.000000000 +0000 | ||
541 | @@ -64,6 +64,8 @@ | ||
542 | void | ||
543 | i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask) | ||
544 | { | ||
545 | + struct drm_i915_common_private *dev_priv_common = (struct drm_i915_common_private *) dev_priv; | ||
546 | + | ||
547 | if ((dev_priv->irq_mask_reg & mask) != 0) { | ||
548 | dev_priv->irq_mask_reg &= ~mask; | ||
549 | I915_WRITE(IMR, dev_priv->irq_mask_reg); | ||
550 | @@ -74,6 +76,8 @@ | ||
551 | static inline void | ||
552 | i915_disable_irq(drm_i915_private_t *dev_priv, u32 mask) | ||
553 | { | ||
554 | + struct drm_i915_common_private *dev_priv_common = (struct drm_i915_common_private *) dev_priv; | ||
555 | + | ||
556 | if ((dev_priv->irq_mask_reg & mask) != mask) { | ||
557 | dev_priv->irq_mask_reg |= mask; | ||
558 | I915_WRITE(IMR, dev_priv->irq_mask_reg); | ||
559 | @@ -94,6 +98,8 @@ | ||
560 | void | ||
561 | i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask) | ||
562 | { | ||
563 | + struct drm_i915_common_private *dev_priv_common = (struct drm_i915_common_private *) dev_priv; | ||
564 | + | ||
565 | if ((dev_priv->pipestat[pipe] & mask) != mask) { | ||
566 | u32 reg = i915_pipestat(pipe); | ||
567 | |||
568 | @@ -107,6 +113,8 @@ | ||
569 | void | ||
570 | i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask) | ||
571 | { | ||
572 | + struct drm_i915_common_private *dev_priv_common = (struct drm_i915_common_private *) dev_priv; | ||
573 | + | ||
574 | if ((dev_priv->pipestat[pipe] & mask) != 0) { | ||
575 | u32 reg = i915_pipestat(pipe); | ||
576 | |||
577 | @@ -128,7 +136,7 @@ | ||
578 | static int | ||
579 | i915_pipe_enabled(struct drm_device *dev, int pipe) | ||
580 | { | ||
581 | - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | ||
582 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
583 | unsigned long pipeconf = pipe ? PIPEBCONF : PIPEACONF; | ||
584 | |||
585 | if (I915_READ(pipeconf) & PIPEACONF_ENABLE) | ||
586 | @@ -142,7 +150,7 @@ | ||
587 | */ | ||
588 | u32 i915_get_vblank_counter(struct drm_device *dev, int pipe) | ||
589 | { | ||
590 | - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | ||
591 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
592 | unsigned long high_frame; | ||
593 | unsigned long low_frame; | ||
594 | u32 high1, high2, low, count; | ||
595 | @@ -178,6 +186,7 @@ | ||
596 | { | ||
597 | struct drm_device *dev = (struct drm_device *) arg; | ||
598 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | ||
599 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
600 | struct drm_i915_master_private *master_priv; | ||
601 | u32 iir, new_iir; | ||
602 | u32 pipea_stats, pipeb_stats; | ||
603 | @@ -284,6 +293,7 @@ | ||
604 | static int i915_emit_irq(struct drm_device * dev) | ||
605 | { | ||
606 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
607 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
608 | struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; | ||
609 | RING_LOCALS; | ||
610 | |||
611 | @@ -409,6 +419,7 @@ | ||
612 | */ | ||
613 | int i915_enable_vblank(struct drm_device *dev, int pipe) | ||
614 | { | ||
615 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
616 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | ||
617 | unsigned long irqflags; | ||
618 | int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF; | ||
619 | @@ -510,6 +521,7 @@ | ||
620 | */ | ||
621 | void i915_driver_irq_preinstall(struct drm_device * dev) | ||
622 | { | ||
623 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
624 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | ||
625 | |||
626 | atomic_set(&dev_priv->irq_received, 0); | ||
627 | @@ -554,6 +566,7 @@ | ||
628 | |||
629 | void i915_driver_irq_uninstall(struct drm_device * dev) | ||
630 | { | ||
631 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
632 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | ||
633 | |||
634 | if (!dev_priv) | ||
635 | Index: linux-2.6.28/drivers/gpu/drm/i915/Makefile | ||
636 | =================================================================== | ||
637 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/Makefile 2009-02-19 12:59:23.000000000 +0000 | ||
638 | +++ linux-2.6.28/drivers/gpu/drm/i915/Makefile 2009-02-19 12:59:28.000000000 +0000 | ||
639 | @@ -9,24 +9,29 @@ | ||
640 | i915_gem_debug.o \ | ||
641 | i915_gem_proc.o \ | ||
642 | i915_gem_tiling.o \ | ||
643 | - intel_display.o \ | ||
644 | - intel_crt.o \ | ||
645 | - intel_lvds.o \ | ||
646 | intel_bios.o \ | ||
647 | - intel_hdmi.o \ | ||
648 | - intel_sdvo.o \ | ||
649 | - intel_modes.o \ | ||
650 | - intel_i2c.o \ | ||
651 | intel_fb.o \ | ||
652 | intel_tv.o \ | ||
653 | + | ||
654 | +intel_gfx_common-y := \ | ||
655 | + intel_display.o \ | ||
656 | + intel_modes.o \ | ||
657 | + intel_i2c.o \ | ||
658 | + intel_crt.o \ | ||
659 | intel_dvo.o \ | ||
660 | + intel_hdmi.o \ | ||
661 | + intel_lvds.o \ | ||
662 | + intel_sdvo.o \ | ||
663 | dvo_ch7xxx.o \ | ||
664 | dvo_ch7017.o \ | ||
665 | dvo_ivch.o \ | ||
666 | dvo_tfp410.o \ | ||
667 | dvo_sil164.o | ||
668 | |||
669 | + | ||
670 | i915-$(CONFIG_ACPI) += i915_opregion.o | ||
671 | i915-$(CONFIG_COMPAT) += i915_ioc32.o | ||
672 | |||
673 | obj-$(CONFIG_DRM_I915) += i915.o | ||
674 | + | ||
675 | +obj-$(CONFIG_DRM_INTEL_COMMON) += intel_gfx_common.o | ||
676 | Index: linux-2.6.28/drivers/gpu/drm/i915/i915_common.h | ||
677 | =================================================================== | ||
678 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
679 | +++ linux-2.6.28/drivers/gpu/drm/i915/i915_common.h 2009-02-20 14:49:42.000000000 +0000 | ||
680 | @@ -0,0 +1,184 @@ | ||
681 | +/* | ||
682 | + * | ||
683 | + * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. | ||
684 | + * All Rights Reserved. | ||
685 | + * | ||
686 | + * Permission is hereby granted, free of charge, to any person obtaining a | ||
687 | + * copy of this software and associated documentation files (the | ||
688 | + * "Software"), to deal in the Software without restriction, including | ||
689 | + * without limitation the rights to use, copy, modify, merge, publish, | ||
690 | + * distribute, sub license, and/or sell copies of the Software, and to | ||
691 | + * permit persons to whom the Software is furnished to do so, subject to | ||
692 | + * the following conditions: | ||
693 | + * | ||
694 | + * The above copyright notice and this permission notice (including the | ||
695 | + * next paragraph) shall be included in all copies or substantial portions | ||
696 | + * of the Software. | ||
697 | + * | ||
698 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
699 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
700 | + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. | ||
701 | + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR | ||
702 | + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
703 | + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
704 | + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
705 | + * | ||
706 | + */ | ||
707 | + | ||
708 | +#ifndef _I915_COMMON_H_ | ||
709 | +#define _I915_COMMON_H_ | ||
710 | + | ||
711 | +typedef struct drm_i915_common_private { | ||
712 | + //struct drm_device *dev; | ||
713 | + | ||
714 | + void __iomem *regs; | ||
715 | + | ||
716 | + //drm_dma_handle_t *status_page_dmah; | ||
717 | + //void *hw_status_page; | ||
718 | + //dma_addr_t dma_status_page; | ||
719 | + //uint32_t counter; | ||
720 | + //unsigned int status_gfx_addr; | ||
721 | + //drm_local_map_t hws_map; | ||
722 | + //struct drm_gem_object *hws_obj; | ||
723 | + | ||
724 | + //unsigned int cpp; | ||
725 | + //int back_offset; | ||
726 | + //int front_offset; | ||
727 | + //int current_page; | ||
728 | + //int page_flipping; | ||
729 | + | ||
730 | + //wait_queue_head_t irq_queue; | ||
731 | + //atomic_t irq_received; | ||
732 | + /** Protects user_irq_refcount and irq_mask_reg */ | ||
733 | + //spinlock_t user_irq_lock; | ||
734 | + /** Refcount for i915_user_irq_get() versus i915_user_irq_put(). */ | ||
735 | + //int user_irq_refcount; | ||
736 | + /** Cached value of IMR to avoid reads in updating the bitfield */ | ||
737 | + //u32 irq_mask_reg; | ||
738 | + //u32 pipestat[2]; | ||
739 | + | ||
740 | + //int tex_lru_log_granularity; | ||
741 | + //int allow_batchbuffer; | ||
742 | + //struct mem_block *agp_heap; | ||
743 | + //unsigned int sr01, adpa, ppcr, dvob, dvoc, lvds; | ||
744 | + //int vblank_pipe; | ||
745 | + | ||
746 | + //bool cursor_needs_physical; | ||
747 | + | ||
748 | + //struct drm_mm vram; | ||
749 | + | ||
750 | + //int irq_enabled; | ||
751 | + | ||
752 | + /* LVDS info */ | ||
753 | + int backlight_duty_cycle; /* restore backlight to this value */ | ||
754 | + bool panel_wants_dither; | ||
755 | + struct drm_display_mode *panel_fixed_mode; | ||
756 | + //struct drm_display_mode *vbt_mode; /* if any */ | ||
757 | + | ||
758 | + /* Feature bits from the VBIOS */ | ||
759 | + //unsigned int int_tv_support:1; | ||
760 | + //unsigned int lvds_dither:1; | ||
761 | + //unsigned int lvds_vbt:1; | ||
762 | + //unsigned int int_crt_support:1; | ||
763 | + | ||
764 | + //int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */ | ||
765 | + //int num_fence_regs; /* 8 on pre-965, 16 otherwise */ | ||
766 | + | ||
767 | + /* Register state */ | ||
768 | + u8 saveLBB; | ||
769 | + u32 saveDSPACNTR; | ||
770 | + u32 saveDSPBCNTR; | ||
771 | + u32 saveDSPARB; | ||
772 | + u32 saveRENDERSTANDBY; | ||
773 | + u32 saveHWS; | ||
774 | + u32 savePIPEACONF; | ||
775 | + u32 savePIPEBCONF; | ||
776 | + u32 savePIPEASRC; | ||
777 | + u32 savePIPEBSRC; | ||
778 | + u32 saveFPA0; | ||
779 | + u32 saveFPA1; | ||
780 | + u32 saveDPLL_A; | ||
781 | + u32 saveDPLL_A_MD; | ||
782 | + u32 saveHTOTAL_A; | ||
783 | + u32 saveHBLANK_A; | ||
784 | + u32 saveHSYNC_A; | ||
785 | + u32 saveVTOTAL_A; | ||
786 | + u32 saveVBLANK_A; | ||
787 | + u32 saveVSYNC_A; | ||
788 | + u32 saveBCLRPAT_A; | ||
789 | + u32 savePIPEASTAT; | ||
790 | + u32 saveDSPASTRIDE; | ||
791 | + u32 saveDSPASIZE; | ||
792 | + u32 saveDSPAPOS; | ||
793 | + u32 saveDSPAADDR; | ||
794 | + u32 saveDSPASURF; | ||
795 | + u32 saveDSPATILEOFF; | ||
796 | + u32 savePFIT_PGM_RATIOS; | ||
797 | + u32 saveBLC_PWM_CTL; | ||
798 | + u32 saveBLC_PWM_CTL2; | ||
799 | + u32 saveFPB0; | ||
800 | + u32 saveFPB1; | ||
801 | + u32 saveDPLL_B; | ||
802 | + u32 saveDPLL_B_MD; | ||
803 | + u32 saveHTOTAL_B; | ||
804 | + u32 saveHBLANK_B; | ||
805 | + u32 saveHSYNC_B; | ||
806 | + u32 saveVTOTAL_B; | ||
807 | + u32 saveVBLANK_B; | ||
808 | + u32 saveVSYNC_B; | ||
809 | + u32 saveBCLRPAT_B; | ||
810 | + u32 savePIPEBSTAT; | ||
811 | + u32 saveDSPBSTRIDE; | ||
812 | + u32 saveDSPBSIZE; | ||
813 | + u32 saveDSPBPOS; | ||
814 | + u32 saveDSPBADDR; | ||
815 | + u32 saveDSPBSURF; | ||
816 | + u32 saveDSPBTILEOFF; | ||
817 | + u32 saveVGA0; | ||
818 | + u32 saveVGA1; | ||
819 | + u32 saveVGA_PD; | ||
820 | + u32 saveVGACNTRL; | ||
821 | + u32 saveADPA; | ||
822 | + u32 saveLVDS; | ||
823 | + u32 savePP_ON_DELAYS; | ||
824 | + u32 savePP_OFF_DELAYS; | ||
825 | + u32 saveDVOA; | ||
826 | + u32 saveDVOB; | ||
827 | + u32 saveDVOC; | ||
828 | + u32 savePP_ON; | ||
829 | + u32 savePP_OFF; | ||
830 | + u32 savePP_CONTROL; | ||
831 | + u32 savePP_DIVISOR; | ||
832 | + u32 savePFIT_CONTROL; | ||
833 | + u32 save_palette_a[256]; | ||
834 | + u32 save_palette_b[256]; | ||
835 | + u32 saveFBC_CFB_BASE; | ||
836 | + u32 saveFBC_LL_BASE; | ||
837 | + u32 saveFBC_CONTROL; | ||
838 | + u32 saveFBC_CONTROL2; | ||
839 | + u32 saveIER; | ||
840 | + u32 saveIIR; | ||
841 | + u32 saveIMR; | ||
842 | + u32 saveCACHE_MODE_0; | ||
843 | + u32 saveD_STATE; | ||
844 | + u32 saveCG_2D_DIS; | ||
845 | + u32 saveMI_ARB_STATE; | ||
846 | + u32 saveSWF0[16]; | ||
847 | + u32 saveSWF1[16]; | ||
848 | + u32 saveSWF2[3]; | ||
849 | + u8 saveMSR; | ||
850 | + u8 saveSR[8]; | ||
851 | + u8 saveGR[25]; | ||
852 | + u8 saveAR_INDEX; | ||
853 | + u8 saveAR[21]; | ||
854 | + u8 saveDACMASK; | ||
855 | + u8 saveDACDATA[256*3]; /* 256 3-byte colors */ | ||
856 | + u8 saveCR[37]; | ||
857 | +} drm_i915_common_private_t; | ||
858 | + | ||
859 | +struct drm_i915_master_private { | ||
860 | + drm_local_map_t *sarea; | ||
861 | + struct _drm_i915_sarea *sarea_priv; | ||
862 | +}; | ||
863 | + | ||
864 | +#endif | ||
865 | Index: linux-2.6.28/drivers/gpu/drm/i915/i915_drv.h | ||
866 | =================================================================== | ||
867 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/i915_drv.h 2009-02-19 12:59:23.000000000 +0000 | ||
868 | +++ linux-2.6.28/drivers/gpu/drm/i915/i915_drv.h 2009-02-19 16:30:19.000000000 +0000 | ||
869 | @@ -32,6 +32,7 @@ | ||
870 | |||
871 | #include "i915_reg.h" | ||
872 | #include "intel_bios.h" | ||
873 | +#include "i915_common.h" | ||
874 | #include <linux/io-mapping.h> | ||
875 | |||
876 | /* General customization: | ||
877 | @@ -116,10 +117,6 @@ | ||
878 | int enabled; | ||
879 | }; | ||
880 | |||
881 | -struct drm_i915_master_private { | ||
882 | - drm_local_map_t *sarea; | ||
883 | - struct _drm_i915_sarea *sarea_priv; | ||
884 | -}; | ||
885 | #define I915_FENCE_REG_NONE -1 | ||
886 | |||
887 | struct drm_i915_fence_reg { | ||
888 | @@ -127,12 +124,15 @@ | ||
889 | }; | ||
890 | |||
891 | typedef struct drm_i915_private { | ||
892 | - struct drm_device *dev; | ||
893 | + /* common is assumed to be the first item in this structure */ | ||
894 | + struct drm_i915_common_private common; | ||
895 | |||
896 | - void __iomem *regs; | ||
897 | - | ||
898 | - drm_i915_ring_buffer_t ring; | ||
899 | + struct drm_device *dev; | ||
900 | |||
901 | + //void __iomem *regs; | ||
902 | + | ||
903 | + drm_i915_ring_buffer_t ring; | ||
904 | + | ||
905 | drm_dma_handle_t *status_page_dmah; | ||
906 | void *hw_status_page; | ||
907 | dma_addr_t dma_status_page; | ||
908 | @@ -169,12 +169,12 @@ | ||
909 | |||
910 | int irq_enabled; | ||
911 | |||
912 | - struct intel_opregion opregion; | ||
913 | - | ||
914 | + struct intel_opregion opregion; | ||
915 | + | ||
916 | /* LVDS info */ | ||
917 | - int backlight_duty_cycle; /* restore backlight to this value */ | ||
918 | - bool panel_wants_dither; | ||
919 | - struct drm_display_mode *panel_fixed_mode; | ||
920 | + //int backlight_duty_cycle; /* restore backlight to this value */ | ||
921 | + //bool panel_wants_dither; | ||
922 | + //struct drm_display_mode *panel_fixed_mode; | ||
923 | struct drm_display_mode *vbt_mode; /* if any */ | ||
924 | |||
925 | /* Feature bits from the VBIOS */ | ||
926 | @@ -183,101 +183,10 @@ | ||
927 | unsigned int lvds_vbt:1; | ||
928 | unsigned int int_crt_support:1; | ||
929 | |||
930 | - struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */ | ||
931 | + struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */ | ||
932 | int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */ | ||
933 | int num_fence_regs; /* 8 on pre-965, 16 otherwise */ | ||
934 | |||
935 | - /* Register state */ | ||
936 | - u8 saveLBB; | ||
937 | - u32 saveDSPACNTR; | ||
938 | - u32 saveDSPBCNTR; | ||
939 | - u32 saveDSPARB; | ||
940 | - u32 saveRENDERSTANDBY; | ||
941 | - u32 saveHWS; | ||
942 | - u32 savePIPEACONF; | ||
943 | - u32 savePIPEBCONF; | ||
944 | - u32 savePIPEASRC; | ||
945 | - u32 savePIPEBSRC; | ||
946 | - u32 saveFPA0; | ||
947 | - u32 saveFPA1; | ||
948 | - u32 saveDPLL_A; | ||
949 | - u32 saveDPLL_A_MD; | ||
950 | - u32 saveHTOTAL_A; | ||
951 | - u32 saveHBLANK_A; | ||
952 | - u32 saveHSYNC_A; | ||
953 | - u32 saveVTOTAL_A; | ||
954 | - u32 saveVBLANK_A; | ||
955 | - u32 saveVSYNC_A; | ||
956 | - u32 saveBCLRPAT_A; | ||
957 | - u32 savePIPEASTAT; | ||
958 | - u32 saveDSPASTRIDE; | ||
959 | - u32 saveDSPASIZE; | ||
960 | - u32 saveDSPAPOS; | ||
961 | - u32 saveDSPAADDR; | ||
962 | - u32 saveDSPASURF; | ||
963 | - u32 saveDSPATILEOFF; | ||
964 | - u32 savePFIT_PGM_RATIOS; | ||
965 | - u32 saveBLC_PWM_CTL; | ||
966 | - u32 saveBLC_PWM_CTL2; | ||
967 | - u32 saveFPB0; | ||
968 | - u32 saveFPB1; | ||
969 | - u32 saveDPLL_B; | ||
970 | - u32 saveDPLL_B_MD; | ||
971 | - u32 saveHTOTAL_B; | ||
972 | - u32 saveHBLANK_B; | ||
973 | - u32 saveHSYNC_B; | ||
974 | - u32 saveVTOTAL_B; | ||
975 | - u32 saveVBLANK_B; | ||
976 | - u32 saveVSYNC_B; | ||
977 | - u32 saveBCLRPAT_B; | ||
978 | - u32 savePIPEBSTAT; | ||
979 | - u32 saveDSPBSTRIDE; | ||
980 | - u32 saveDSPBSIZE; | ||
981 | - u32 saveDSPBPOS; | ||
982 | - u32 saveDSPBADDR; | ||
983 | - u32 saveDSPBSURF; | ||
984 | - u32 saveDSPBTILEOFF; | ||
985 | - u32 saveVGA0; | ||
986 | - u32 saveVGA1; | ||
987 | - u32 saveVGA_PD; | ||
988 | - u32 saveVGACNTRL; | ||
989 | - u32 saveADPA; | ||
990 | - u32 saveLVDS; | ||
991 | - u32 savePP_ON_DELAYS; | ||
992 | - u32 savePP_OFF_DELAYS; | ||
993 | - u32 saveDVOA; | ||
994 | - u32 saveDVOB; | ||
995 | - u32 saveDVOC; | ||
996 | - u32 savePP_ON; | ||
997 | - u32 savePP_OFF; | ||
998 | - u32 savePP_CONTROL; | ||
999 | - u32 savePP_DIVISOR; | ||
1000 | - u32 savePFIT_CONTROL; | ||
1001 | - u32 save_palette_a[256]; | ||
1002 | - u32 save_palette_b[256]; | ||
1003 | - u32 saveFBC_CFB_BASE; | ||
1004 | - u32 saveFBC_LL_BASE; | ||
1005 | - u32 saveFBC_CONTROL; | ||
1006 | - u32 saveFBC_CONTROL2; | ||
1007 | - u32 saveIER; | ||
1008 | - u32 saveIIR; | ||
1009 | - u32 saveIMR; | ||
1010 | - u32 saveCACHE_MODE_0; | ||
1011 | - u32 saveD_STATE; | ||
1012 | - u32 saveCG_2D_DIS; | ||
1013 | - u32 saveMI_ARB_STATE; | ||
1014 | - u32 saveSWF0[16]; | ||
1015 | - u32 saveSWF1[16]; | ||
1016 | - u32 saveSWF2[3]; | ||
1017 | - u8 saveMSR; | ||
1018 | - u8 saveSR[8]; | ||
1019 | - u8 saveGR[25]; | ||
1020 | - u8 saveAR_INDEX; | ||
1021 | - u8 saveAR[21]; | ||
1022 | - u8 saveDACMASK; | ||
1023 | - u8 saveDACDATA[256*3]; /* 256 3-byte colors */ | ||
1024 | - u8 saveCR[37]; | ||
1025 | - | ||
1026 | struct { | ||
1027 | struct drm_mm gtt_space; | ||
1028 | |||
1029 | @@ -672,17 +581,18 @@ | ||
1030 | LOCK_TEST_WITH_RETURN(dev, file_priv); \ | ||
1031 | } while (0) | ||
1032 | |||
1033 | -#define I915_READ(reg) readl(dev_priv->regs + (reg)) | ||
1034 | -#define I915_WRITE(reg, val) writel(val, dev_priv->regs + (reg)) | ||
1035 | -#define I915_READ16(reg) readw(dev_priv->regs + (reg)) | ||
1036 | -#define I915_WRITE16(reg, val) writel(val, dev_priv->regs + (reg)) | ||
1037 | -#define I915_READ8(reg) readb(dev_priv->regs + (reg)) | ||
1038 | -#define I915_WRITE8(reg, val) writeb(val, dev_priv->regs + (reg)) | ||
1039 | + | ||
1040 | +#define I915_READ(reg) readl(dev_priv_common->regs + (reg)) | ||
1041 | +#define I915_WRITE(reg, val) writel(val, dev_priv_common->regs + (reg)) | ||
1042 | +#define I915_READ16(reg) readw(dev_priv_common->regs + (reg)) | ||
1043 | +#define I915_WRITE16(reg, val) writel(val, dev_priv_common->regs + (reg)) | ||
1044 | +#define I915_READ8(reg) readb(dev_priv_common->regs + (reg)) | ||
1045 | +#define I915_WRITE8(reg, val) writeb(val, dev_priv_common->regs + (reg)) | ||
1046 | #ifdef writeq | ||
1047 | -#define I915_WRITE64(reg, val) writeq(val, dev_priv->regs + (reg)) | ||
1048 | +#define I915_WRITE64(reg, val) writeq(val, dev_priv_common->regs + (reg)) | ||
1049 | #else | ||
1050 | -#define I915_WRITE64(reg, val) (writel(val, dev_priv->regs + (reg)), \ | ||
1051 | - writel(upper_32_bits(val), dev_priv->regs + \ | ||
1052 | +#define I915_WRITE64(reg, val) (writel(val, dev_priv_common->regs + (reg)), \ | ||
1053 | + writel(upper_32_bits(val), dev_priv_common->regs + \ | ||
1054 | (reg) + 4)) | ||
1055 | #endif | ||
1056 | #define POSTING_READ(reg) (void)I915_READ(reg) | ||
1057 | @@ -776,10 +686,15 @@ | ||
1058 | (dev)->pci_device == 0x29D2) | ||
1059 | |||
1060 | #define IS_I9XX(dev) (IS_I915G(dev) || IS_I915GM(dev) || IS_I945G(dev) || \ | ||
1061 | - IS_I945GM(dev) || IS_I965G(dev) || IS_G33(dev)) | ||
1062 | + IS_I945GM(dev) || IS_I965G(dev) || IS_G33(dev) || \ | ||
1063 | + IS_POULSBO(dev)) | ||
1064 | + | ||
1065 | +#define IS_POULSBO(dev) (((dev)->pci_device == 0x8108) || \ | ||
1066 | + ((dev)->pci_device == 0x8109)) | ||
1067 | |||
1068 | #define IS_MOBILE(dev) (IS_I830(dev) || IS_I85X(dev) || IS_I915GM(dev) || \ | ||
1069 | - IS_I945GM(dev) || IS_I965GM(dev) || IS_GM45(dev)) | ||
1070 | + IS_I945GM(dev) || IS_I965GM(dev) || IS_GM45(dev) || \ | ||
1071 | + IS_POULSBO(dev)) | ||
1072 | |||
1073 | #define I915_NEED_GFX_HWS(dev) (IS_G33(dev) || IS_GM45(dev) || IS_G4X(dev)) | ||
1074 | #define SUPPORTS_INTEGRATED_HDMI(dev) (IS_G4X(dev)) | ||
1075 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_display.c | ||
1076 | =================================================================== | ||
1077 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_display.c 2009-02-19 12:59:23.000000000 +0000 | ||
1078 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_display.c 2009-02-20 14:53:08.000000000 +0000 | ||
1079 | @@ -282,7 +282,7 @@ | ||
1080 | int refclk, intel_clock_t *best_clock) | ||
1081 | { | ||
1082 | struct drm_device *dev = crtc->dev; | ||
1083 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1084 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1085 | intel_clock_t clock; | ||
1086 | const intel_limit_t *limit = intel_limit(crtc); | ||
1087 | int err = target; | ||
1088 | @@ -475,7 +475,7 @@ | ||
1089 | { | ||
1090 | struct drm_device *dev = crtc->dev; | ||
1091 | struct drm_i915_master_private *master_priv; | ||
1092 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1093 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1094 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
1095 | int pipe = intel_crtc->pipe; | ||
1096 | int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B; | ||
1097 | @@ -613,6 +613,7 @@ | ||
1098 | /* lvds has its own version of prepare see intel_lvds_prepare */ | ||
1099 | encoder_funcs->dpms(encoder, DRM_MODE_DPMS_OFF); | ||
1100 | } | ||
1101 | +EXPORT_SYMBOL(intel_encoder_prepare); | ||
1102 | |||
1103 | void intel_encoder_commit (struct drm_encoder *encoder) | ||
1104 | { | ||
1105 | @@ -620,6 +621,7 @@ | ||
1106 | /* lvds has its own version of commit see intel_lvds_commit */ | ||
1107 | encoder_funcs->dpms(encoder, DRM_MODE_DPMS_ON); | ||
1108 | } | ||
1109 | +EXPORT_SYMBOL(intel_encoder_commit); | ||
1110 | |||
1111 | static bool intel_crtc_mode_fixup(struct drm_crtc *crtc, | ||
1112 | struct drm_display_mode *mode, | ||
1113 | @@ -687,7 +689,7 @@ | ||
1114 | */ | ||
1115 | static int intel_panel_fitter_pipe (struct drm_device *dev) | ||
1116 | { | ||
1117 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1118 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1119 | u32 pfit_control; | ||
1120 | |||
1121 | /* i830 doesn't have a panel fitter */ | ||
1122 | @@ -715,7 +717,7 @@ | ||
1123 | struct drm_framebuffer *old_fb) | ||
1124 | { | ||
1125 | struct drm_device *dev = crtc->dev; | ||
1126 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1127 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1128 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
1129 | int pipe = intel_crtc->pipe; | ||
1130 | int fp_reg = (pipe == 0) ? FPA0 : FPB0; | ||
1131 | @@ -980,7 +982,7 @@ | ||
1132 | uint32_t width, uint32_t height) | ||
1133 | { | ||
1134 | struct drm_device *dev = crtc->dev; | ||
1135 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1136 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1137 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
1138 | struct drm_gem_object *bo; | ||
1139 | struct drm_i915_gem_object *obj_priv; | ||
1140 | @@ -1071,7 +1073,7 @@ | ||
1141 | static int intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) | ||
1142 | { | ||
1143 | struct drm_device *dev = crtc->dev; | ||
1144 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1145 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1146 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
1147 | int pipe = intel_crtc->pipe; | ||
1148 | uint32_t temp = 0; | ||
1149 | @@ -1106,6 +1108,7 @@ | ||
1150 | intel_crtc->lut_g[regno] = green >> 8; | ||
1151 | intel_crtc->lut_b[regno] = blue >> 8; | ||
1152 | } | ||
1153 | +EXPORT_SYMBOL(intel_crtc_fb_gamma_set); | ||
1154 | |||
1155 | static void intel_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, | ||
1156 | u16 *blue, uint32_t size) | ||
1157 | @@ -1228,6 +1231,7 @@ | ||
1158 | |||
1159 | return crtc; | ||
1160 | } | ||
1161 | +EXPORT_SYMBOL(intel_get_load_detect_pipe); | ||
1162 | |||
1163 | void intel_release_load_detect_pipe(struct intel_output *intel_output, int dpms_mode) | ||
1164 | { | ||
1165 | @@ -1251,11 +1255,12 @@ | ||
1166 | crtc_funcs->dpms(crtc, dpms_mode); | ||
1167 | } | ||
1168 | } | ||
1169 | +EXPORT_SYMBOL(intel_release_load_detect_pipe); | ||
1170 | |||
1171 | /* Returns the clock of the currently programmed mode of the given pipe. */ | ||
1172 | static int intel_crtc_clock_get(struct drm_device *dev, struct drm_crtc *crtc) | ||
1173 | { | ||
1174 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1175 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1176 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
1177 | int pipe = intel_crtc->pipe; | ||
1178 | u32 dpll = I915_READ((pipe == 0) ? DPLL_A : DPLL_B); | ||
1179 | @@ -1333,7 +1338,7 @@ | ||
1180 | struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev, | ||
1181 | struct drm_crtc *crtc) | ||
1182 | { | ||
1183 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1184 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1185 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
1186 | int pipe = intel_crtc->pipe; | ||
1187 | struct drm_display_mode *mode; | ||
1188 | @@ -1361,6 +1366,7 @@ | ||
1189 | |||
1190 | return mode; | ||
1191 | } | ||
1192 | +EXPORT_SYMBOL(intel_crtc_mode_get); | ||
1193 | |||
1194 | static void intel_crtc_destroy(struct drm_crtc *crtc) | ||
1195 | { | ||
1196 | @@ -1415,11 +1421,6 @@ | ||
1197 | intel_crtc->mode_set.connectors = (struct drm_connector **)(intel_crtc + 1); | ||
1198 | intel_crtc->mode_set.num_connectors = 0; | ||
1199 | |||
1200 | - if (i915_fbpercrtc) { | ||
1201 | - | ||
1202 | - | ||
1203 | - | ||
1204 | - } | ||
1205 | } | ||
1206 | |||
1207 | struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe) | ||
1208 | @@ -1433,6 +1434,7 @@ | ||
1209 | } | ||
1210 | return crtc; | ||
1211 | } | ||
1212 | +EXPORT_SYMBOL(intel_get_crtc_from_pipe); | ||
1213 | |||
1214 | static int intel_connector_clones(struct drm_device *dev, int type_mask) | ||
1215 | { | ||
1216 | @@ -1575,7 +1577,7 @@ | ||
1217 | |||
1218 | return 0; | ||
1219 | } | ||
1220 | - | ||
1221 | +EXPORT_SYMBOL(intel_framebuffer_create); | ||
1222 | |||
1223 | static struct drm_framebuffer * | ||
1224 | intel_user_framebuffer_create(struct drm_device *dev, | ||
1225 | @@ -1643,12 +1645,13 @@ | ||
1226 | |||
1227 | intel_setup_outputs(dev); | ||
1228 | } | ||
1229 | +EXPORT_SYMBOL(intel_modeset_init); | ||
1230 | |||
1231 | void intel_modeset_cleanup(struct drm_device *dev) | ||
1232 | { | ||
1233 | drm_mode_config_cleanup(dev); | ||
1234 | } | ||
1235 | - | ||
1236 | +EXPORT_SYMBOL(intel_modeset_cleanup); | ||
1237 | |||
1238 | /* current intel driver doesn't take advantage of encoders | ||
1239 | always give back the encoder for the connector | ||
1240 | @@ -1659,3 +1662,5 @@ | ||
1241 | |||
1242 | return &intel_output->enc; | ||
1243 | } | ||
1244 | +EXPORT_SYMBOL(intel_best_encoder); | ||
1245 | + | ||
1246 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_crt.c | ||
1247 | =================================================================== | ||
1248 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_crt.c 2009-02-19 12:59:23.000000000 +0000 | ||
1249 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_crt.c 2009-02-20 14:53:08.000000000 +0000 | ||
1250 | @@ -36,7 +36,7 @@ | ||
1251 | static void intel_crt_dpms(struct drm_encoder *encoder, int mode) | ||
1252 | { | ||
1253 | struct drm_device *dev = encoder->dev; | ||
1254 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1255 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1256 | u32 temp; | ||
1257 | |||
1258 | temp = I915_READ(ADPA); | ||
1259 | @@ -88,7 +88,7 @@ | ||
1260 | struct drm_device *dev = encoder->dev; | ||
1261 | struct drm_crtc *crtc = encoder->crtc; | ||
1262 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
1263 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1264 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1265 | int dpll_md_reg; | ||
1266 | u32 adpa, dpll_md; | ||
1267 | |||
1268 | @@ -132,7 +132,7 @@ | ||
1269 | static bool intel_crt_detect_hotplug(struct drm_connector *connector) | ||
1270 | { | ||
1271 | struct drm_device *dev = connector->dev; | ||
1272 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1273 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1274 | u32 temp; | ||
1275 | |||
1276 | unsigned long timeout = jiffies + msecs_to_jiffies(1000); | ||
1277 | Index: linux-2.6.28/drivers/gpu/drm/i915/i915_dma.c | ||
1278 | =================================================================== | ||
1279 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/i915_dma.c 2009-02-19 12:59:23.000000000 +0000 | ||
1280 | +++ linux-2.6.28/drivers/gpu/drm/i915/i915_dma.c 2009-02-20 12:12:41.000000000 +0000 | ||
1281 | @@ -41,6 +41,7 @@ | ||
1282 | int i915_wait_ring(struct drm_device * dev, int n, const char *caller) | ||
1283 | { | ||
1284 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
1285 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1286 | struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; | ||
1287 | drm_i915_ring_buffer_t *ring = &(dev_priv->ring); | ||
1288 | u32 acthd_reg = IS_I965G(dev) ? ACTHD_I965 : ACTHD; | ||
1289 | @@ -82,6 +83,7 @@ | ||
1290 | static int i915_init_phys_hws(struct drm_device *dev) | ||
1291 | { | ||
1292 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
1293 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1294 | /* Program Hardware Status Page */ | ||
1295 | dev_priv->status_page_dmah = | ||
1296 | drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff); | ||
1297 | @@ -107,6 +109,8 @@ | ||
1298 | static void i915_free_hws(struct drm_device *dev) | ||
1299 | { | ||
1300 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
1301 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1302 | + | ||
1303 | if (dev_priv->status_page_dmah) { | ||
1304 | drm_pci_free(dev, dev_priv->status_page_dmah); | ||
1305 | dev_priv->status_page_dmah = NULL; | ||
1306 | @@ -124,6 +128,7 @@ | ||
1307 | void i915_kernel_lost_context(struct drm_device * dev) | ||
1308 | { | ||
1309 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
1310 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1311 | struct drm_i915_master_private *master_priv; | ||
1312 | drm_i915_ring_buffer_t *ring = &(dev_priv->ring); | ||
1313 | |||
1314 | @@ -231,6 +236,7 @@ | ||
1315 | static int i915_dma_resume(struct drm_device * dev) | ||
1316 | { | ||
1317 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | ||
1318 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1319 | |||
1320 | DRM_DEBUG("%s\n", __func__); | ||
1321 | |||
1322 | @@ -358,6 +364,7 @@ | ||
1323 | |||
1324 | static int i915_emit_cmds(struct drm_device * dev, int __user * buffer, int dwords) | ||
1325 | { | ||
1326 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1327 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
1328 | int i; | ||
1329 | RING_LOCALS; | ||
1330 | @@ -401,6 +408,7 @@ | ||
1331 | int i, int DR1, int DR4) | ||
1332 | { | ||
1333 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
1334 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1335 | struct drm_clip_rect box; | ||
1336 | RING_LOCALS; | ||
1337 | |||
1338 | @@ -442,6 +450,7 @@ | ||
1339 | static void i915_emit_breadcrumb(struct drm_device *dev) | ||
1340 | { | ||
1341 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
1342 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1343 | struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; | ||
1344 | RING_LOCALS; | ||
1345 | |||
1346 | @@ -495,6 +504,7 @@ | ||
1347 | drm_i915_batchbuffer_t * batch) | ||
1348 | { | ||
1349 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
1350 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1351 | struct drm_clip_rect __user *boxes = batch->cliprects; | ||
1352 | int nbox = batch->num_cliprects; | ||
1353 | int i = 0, count; | ||
1354 | @@ -544,6 +554,7 @@ | ||
1355 | |||
1356 | static int i915_dispatch_flip(struct drm_device * dev) | ||
1357 | { | ||
1358 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1359 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
1360 | struct drm_i915_master_private *master_priv = | ||
1361 | dev->primary->master->driver_priv; | ||
1362 | @@ -775,6 +786,7 @@ | ||
1363 | static int i915_set_status_page(struct drm_device *dev, void *data, | ||
1364 | struct drm_file *file_priv) | ||
1365 | { | ||
1366 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1367 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
1368 | drm_i915_hws_addr_t *hws = data; | ||
1369 | |||
1370 | @@ -930,6 +942,7 @@ | ||
1371 | |||
1372 | static int i915_load_modeset_init(struct drm_device *dev) | ||
1373 | { | ||
1374 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1375 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1376 | unsigned long agp_size, prealloc_size; | ||
1377 | int fb_bar = IS_I9XX(dev) ? 2 : 0; | ||
1378 | @@ -1073,8 +1086,8 @@ | ||
1379 | base = drm_get_resource_start(dev, mmio_bar); | ||
1380 | size = drm_get_resource_len(dev, mmio_bar); | ||
1381 | |||
1382 | - dev_priv->regs = ioremap(base, size); | ||
1383 | - if (!dev_priv->regs) { | ||
1384 | + dev_priv->common.regs = ioremap(base, size); | ||
1385 | + if (!dev_priv->common.regs) { | ||
1386 | DRM_ERROR("failed to map registers\n"); | ||
1387 | ret = -EIO; | ||
1388 | goto free_priv; | ||
1389 | @@ -1126,7 +1139,7 @@ | ||
1390 | return 0; | ||
1391 | |||
1392 | out_rmmap: | ||
1393 | - iounmap(dev_priv->regs); | ||
1394 | + iounmap(dev_priv->common.regs); | ||
1395 | free_priv: | ||
1396 | drm_free(dev_priv, sizeof(struct drm_i915_private), DRM_MEM_DRIVER); | ||
1397 | return ret; | ||
1398 | @@ -1144,8 +1157,8 @@ | ||
1399 | if (dev->pdev->msi_enabled) | ||
1400 | pci_disable_msi(dev->pdev); | ||
1401 | |||
1402 | - if (dev_priv->regs != NULL) | ||
1403 | - iounmap(dev_priv->regs); | ||
1404 | + if (dev_priv->common.regs != NULL) | ||
1405 | + iounmap(dev_priv->common.regs); | ||
1406 | |||
1407 | intel_opregion_free(dev); | ||
1408 | |||
1409 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_sdvo.c | ||
1410 | =================================================================== | ||
1411 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_sdvo.c 2009-02-19 12:59:23.000000000 +0000 | ||
1412 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_sdvo.c 2009-02-20 14:53:08.000000000 +0000 | ||
1413 | @@ -62,7 +62,7 @@ | ||
1414 | static void intel_sdvo_write_sdvox(struct intel_output *intel_output, u32 val) | ||
1415 | { | ||
1416 | struct drm_device *dev = intel_output->base.dev; | ||
1417 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1418 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1419 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | ||
1420 | u32 bval = val, cval = val; | ||
1421 | int i; | ||
1422 | @@ -552,7 +552,7 @@ | ||
1423 | struct drm_display_mode *adjusted_mode) | ||
1424 | { | ||
1425 | struct drm_device *dev = encoder->dev; | ||
1426 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1427 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1428 | struct drm_crtc *crtc = encoder->crtc; | ||
1429 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
1430 | struct intel_output *intel_output = enc_to_intel_output(encoder); | ||
1431 | @@ -659,7 +659,7 @@ | ||
1432 | if (IS_I965G(dev)) { | ||
1433 | /* done in crtc_mode_set as the dpll_md reg must be written | ||
1434 | early */ | ||
1435 | - } else if (IS_I945G(dev) || IS_I945GM(dev)) { | ||
1436 | + } else if (IS_POULSBO(dev) || IS_I945G(dev) || IS_I945GM(dev)) { | ||
1437 | /* done in crtc_mode_set as it lives inside the | ||
1438 | dpll register */ | ||
1439 | } else { | ||
1440 | @@ -672,7 +672,7 @@ | ||
1441 | static void intel_sdvo_dpms(struct drm_encoder *encoder, int mode) | ||
1442 | { | ||
1443 | struct drm_device *dev = encoder->dev; | ||
1444 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1445 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1446 | struct intel_output *intel_output = enc_to_intel_output(encoder); | ||
1447 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | ||
1448 | u32 temp; | ||
1449 | @@ -722,7 +722,7 @@ | ||
1450 | static void intel_sdvo_save(struct drm_connector *connector) | ||
1451 | { | ||
1452 | struct drm_device *dev = connector->dev; | ||
1453 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1454 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1455 | struct intel_output *intel_output = to_intel_output(connector); | ||
1456 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | ||
1457 | int o; | ||
1458 | @@ -759,7 +759,7 @@ | ||
1459 | static void intel_sdvo_restore(struct drm_connector *connector) | ||
1460 | { | ||
1461 | struct drm_device *dev = connector->dev; | ||
1462 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1463 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1464 | struct intel_output *intel_output = to_intel_output(connector); | ||
1465 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | ||
1466 | int o; | ||
1467 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | ||
1468 | =================================================================== | ||
1469 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_lvds.c 2009-02-19 12:59:23.000000000 +0000 | ||
1470 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c 2009-02-20 14:53:08.000000000 +0000 | ||
1471 | @@ -67,7 +67,7 @@ | ||
1472 | */ | ||
1473 | static void intel_lvds_set_power(struct drm_device *dev, bool on) | ||
1474 | { | ||
1475 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1476 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1477 | u32 pp_status; | ||
1478 | |||
1479 | if (on) { | ||
1480 | @@ -104,35 +104,35 @@ | ||
1481 | static void intel_lvds_save(struct drm_connector *connector) | ||
1482 | { | ||
1483 | struct drm_device *dev = connector->dev; | ||
1484 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1485 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1486 | |||
1487 | - dev_priv->savePP_ON = I915_READ(PP_ON_DELAYS); | ||
1488 | - dev_priv->savePP_OFF = I915_READ(PP_OFF_DELAYS); | ||
1489 | - dev_priv->savePP_CONTROL = I915_READ(PP_CONTROL); | ||
1490 | - dev_priv->savePP_DIVISOR = I915_READ(PP_DIVISOR); | ||
1491 | - dev_priv->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL); | ||
1492 | - dev_priv->backlight_duty_cycle = (dev_priv->saveBLC_PWM_CTL & | ||
1493 | + dev_priv_common->savePP_ON = I915_READ(PP_ON_DELAYS); | ||
1494 | + dev_priv_common->savePP_OFF = I915_READ(PP_OFF_DELAYS); | ||
1495 | + dev_priv_common->savePP_CONTROL = I915_READ(PP_CONTROL); | ||
1496 | + dev_priv_common->savePP_DIVISOR = I915_READ(PP_DIVISOR); | ||
1497 | + dev_priv_common->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL); | ||
1498 | + dev_priv_common->backlight_duty_cycle = (dev_priv_common->saveBLC_PWM_CTL & | ||
1499 | BACKLIGHT_DUTY_CYCLE_MASK); | ||
1500 | |||
1501 | /* | ||
1502 | * If the light is off at server startup, just make it full brightness | ||
1503 | */ | ||
1504 | - if (dev_priv->backlight_duty_cycle == 0) | ||
1505 | - dev_priv->backlight_duty_cycle = | ||
1506 | + if (dev_priv_common->backlight_duty_cycle == 0) | ||
1507 | + lvds_backlight= | ||
1508 | intel_lvds_get_max_backlight(dev); | ||
1509 | } | ||
1510 | |||
1511 | static void intel_lvds_restore(struct drm_connector *connector) | ||
1512 | { | ||
1513 | struct drm_device *dev = connector->dev; | ||
1514 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1515 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1516 | |||
1517 | - I915_WRITE(BLC_PWM_CTL, dev_priv->saveBLC_PWM_CTL); | ||
1518 | - I915_WRITE(PP_ON_DELAYS, dev_priv->savePP_ON); | ||
1519 | - I915_WRITE(PP_OFF_DELAYS, dev_priv->savePP_OFF); | ||
1520 | - I915_WRITE(PP_DIVISOR, dev_priv->savePP_DIVISOR); | ||
1521 | - I915_WRITE(PP_CONTROL, dev_priv->savePP_CONTROL); | ||
1522 | - if (dev_priv->savePP_CONTROL & POWER_TARGET_ON) | ||
1523 | + I915_WRITE(BLC_PWM_CTL, dev_priv_common->saveBLC_PWM_CTL); | ||
1524 | + I915_WRITE(PP_ON_DELAYS, dev_priv_common->savePP_ON); | ||
1525 | + I915_WRITE(PP_OFF_DELAYS, dev_priv_common->savePP_OFF); | ||
1526 | + I915_WRITE(PP_DIVISOR, dev_priv_common->savePP_DIVISOR); | ||
1527 | + I915_WRITE(PP_CONTROL, dev_priv_common->savePP_CONTROL); | ||
1528 | + if (dev_priv_common->savePP_CONTROL & POWER_TARGET_ON) | ||
1529 | intel_lvds_set_power(dev, true); | ||
1530 | else | ||
1531 | intel_lvds_set_power(dev, false); | ||
1532 | @@ -142,8 +142,8 @@ | ||
1533 | struct drm_display_mode *mode) | ||
1534 | { | ||
1535 | struct drm_device *dev = connector->dev; | ||
1536 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1537 | - struct drm_display_mode *fixed_mode = dev_priv->panel_fixed_mode; | ||
1538 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1539 | + struct drm_display_mode *fixed_mode = dev_priv_common->panel_fixed_mode; | ||
1540 | |||
1541 | if (fixed_mode) { | ||
1542 | if (mode->hdisplay > fixed_mode->hdisplay) | ||
1543 | @@ -160,7 +160,7 @@ | ||
1544 | struct drm_display_mode *adjusted_mode) | ||
1545 | { | ||
1546 | struct drm_device *dev = encoder->dev; | ||
1547 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1548 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1549 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); | ||
1550 | struct drm_encoder *tmp_encoder; | ||
1551 | |||
1552 | @@ -240,7 +240,7 @@ | ||
1553 | struct drm_display_mode *adjusted_mode) | ||
1554 | { | ||
1555 | struct drm_device *dev = encoder->dev; | ||
1556 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
1557 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; | ||
1558 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); | ||
1559 | u32 pfit_control; | ||
1560 | |||
1561 | @@ -264,7 +264,7 @@ | ||
1562 | pfit_control = 0; | ||
1563 | |||
1564 | if (!IS_I965G(dev)) { | ||
1565 | - if (dev_priv->panel_wants_dither) | ||
1566 | + if (dev_priv_common->panel_wants_dither) | ||
1567 | pfit_control |= PANEL_8TO6_DITHER_ENABLE; | ||
1568 | } | ||
1569 | else | ||
1570 | @@ -475,16 +475,16 @@ | ||
1571 | crtc = intel_get_crtc_from_pipe(dev, pipe); | ||
1572 | |||
1573 | if (crtc && (lvds & LVDS_PORT_EN)) { | ||
1574 | - dev_priv->panel_fixed_mode = intel_crtc_mode_get(dev, crtc); | ||
1575 | - if (dev_priv->panel_fixed_mode) { | ||
1576 | - dev_priv->panel_fixed_mode->type |= | ||
1577 | + dev_priv_common->panel_fixed_mode = intel_crtc_mode_get(dev, crtc); | ||
1578 | + if (dev_priv_common->panel_fixed_mode) { | ||
1579 | + dev_priv_common->panel_fixed_mode->type |= | ||
1580 | DRM_MODE_TYPE_PREFERRED; | ||
1581 | goto out; /* FIXME: check for quirks */ | ||
1582 | } | ||
1583 | } | ||
1584 | |||
1585 | /* If we still don't have a mode after all that, give up. */ | ||
1586 | - if (!dev_priv->panel_fixed_mode) | ||
1587 | + if (!dev_priv_common->panel_fixed_mode) | ||
1588 | goto failed; | ||
1589 | |||
1590 | /* FIXME: detect aopen & mac mini type stuff automatically? */ | ||
1591 | @@ -509,9 +509,9 @@ | ||
1592 | * 800x600 display. | ||
1593 | */ | ||
1594 | |||
1595 | - if (dev_priv->panel_fixed_mode != NULL && | ||
1596 | - dev_priv->panel_fixed_mode->hdisplay == 800 && | ||
1597 | - dev_priv->panel_fixed_mode->vdisplay == 600) { | ||
1598 | + if (dev_priv_common->panel_fixed_mode != NULL && | ||
1599 | + dev_priv_common->panel_fixed_mode->hdisplay == 800 && | ||
1600 | + dev_priv_common->panel_fixed_mode->vdisplay == 600) { | ||
1601 | DRM_DEBUG("Suspected Mac Mini, ignoring the LVDS\n"); | ||
1602 | goto failed; | ||
1603 | } | ||
1604 | Index: linux-2.6.28/drivers/gpu/drm/Kconfig | ||
1605 | =================================================================== | ||
1606 | --- linux-2.6.28.orig/drivers/gpu/drm/Kconfig 2009-02-19 12:59:22.000000000 +0000 | ||
1607 | +++ linux-2.6.28/drivers/gpu/drm/Kconfig 2009-02-20 14:53:08.000000000 +0000 | ||
1608 | @@ -43,6 +43,11 @@ | ||
1609 | |||
1610 | If M is selected, the module will be called radeon. | ||
1611 | |||
1612 | +config DRM_INTEL_COMMON | ||
1613 | + tristate | ||
1614 | + help | ||
1615 | + Code common to several Intel drivers (autoselected) | ||
1616 | + | ||
1617 | config DRM_I810 | ||
1618 | tristate "Intel I810" | ||
1619 | depends on DRM && AGP && AGP_INTEL | ||
1620 | @@ -70,6 +75,7 @@ | ||
1621 | select FB_CFB_FILLRECT | ||
1622 | select FB_CFB_COPYAREA | ||
1623 | select FB_CFB_IMAGEBLIT | ||
1624 | + select DRM_INTEL_COMMON | ||
1625 | depends on FB | ||
1626 | tristate "i915 driver" | ||
1627 | help | ||