diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-02-25 14:05:59 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-02-25 14:05:59 +0000 |
commit | 00dccf496e975e814d44ded7f43d29e7ea1b6126 (patch) | |
tree | 3f3bf6b3862b2c655b01afc2fa5248a7988e6fc1 /meta-moblin/packages | |
parent | 440ac105bd8c5005180b23aaf0b005f25be71ccf (diff) | |
download | poky-00dccf496e975e814d44ded7f43d29e7ea1b6126.tar.gz |
linux-moblin: Update psb driver
Diffstat (limited to 'meta-moblin/packages')
3 files changed, 2113 insertions, 2283 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 | ||
diff --git a/meta-moblin/packages/linux/linux-moblin-2.6.28+2.6.29-rc2/psb-driver.patch b/meta-moblin/packages/linux/linux-moblin-2.6.28+2.6.29-rc2/psb-driver.patch index ca449c6cf5..5b20badffa 100644 --- a/meta-moblin/packages/linux/linux-moblin-2.6.28+2.6.29-rc2/psb-driver.patch +++ b/meta-moblin/packages/linux/linux-moblin-2.6.28+2.6.29-rc2/psb-driver.patch | |||
@@ -1,7 +1,7 @@ | |||
1 | Index: linux-2.6.28/include/drm/drm.h | 1 | Index: linux-2.6.28/include/drm/drm.h |
2 | =================================================================== | 2 | =================================================================== |
3 | --- linux-2.6.28.orig/include/drm/drm.h 2009-02-12 09:14:40.000000000 +0000 | 3 | --- linux-2.6.28.orig/include/drm/drm.h 2009-02-20 12:22:53.000000000 +0000 |
4 | +++ linux-2.6.28/include/drm/drm.h 2009-02-12 09:14:41.000000000 +0000 | 4 | +++ linux-2.6.28/include/drm/drm.h 2009-02-20 12:23:06.000000000 +0000 |
5 | @@ -174,6 +174,7 @@ | 5 | @@ -174,6 +174,7 @@ |
6 | _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ | 6 | _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ |
7 | _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */ | 7 | _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */ |
@@ -336,8 +336,8 @@ Index: linux-2.6.28/include/drm/drm.h | |||
336 | #endif | 336 | #endif |
337 | Index: linux-2.6.28/include/drm/drmP.h | 337 | Index: linux-2.6.28/include/drm/drmP.h |
338 | =================================================================== | 338 | =================================================================== |
339 | --- linux-2.6.28.orig/include/drm/drmP.h 2009-02-12 09:14:40.000000000 +0000 | 339 | --- linux-2.6.28.orig/include/drm/drmP.h 2009-02-20 12:22:53.000000000 +0000 |
340 | +++ linux-2.6.28/include/drm/drmP.h 2009-02-12 15:59:51.000000000 +0000 | 340 | +++ linux-2.6.28/include/drm/drmP.h 2009-02-20 12:30:10.000000000 +0000 |
341 | @@ -57,6 +57,7 @@ | 341 | @@ -57,6 +57,7 @@ |
342 | #include <linux/dma-mapping.h> | 342 | #include <linux/dma-mapping.h> |
343 | #include <linux/mm.h> | 343 | #include <linux/mm.h> |
@@ -422,60 +422,7 @@ Index: linux-2.6.28/include/drm/drmP.h | |||
422 | /** | 422 | /** |
423 | * DRM driver structure. This structure represent the common code for | 423 | * DRM driver structure. This structure represent the common code for |
424 | * a family of cards. There will one drm_device for each card present | 424 | * a family of cards. There will one drm_device for each card present |
425 | @@ -684,50 +723,8 @@ | 425 | @@ -766,6 +805,13 @@ |
426 | void (*kernel_context_switch_unlock) (struct drm_device *dev); | ||
427 | int (*dri_library_name) (struct drm_device *dev, char *buf); | ||
428 | |||
429 | - /** | ||
430 | - * get_vblank_counter - get raw hardware vblank counter | ||
431 | - * @dev: DRM device | ||
432 | - * @crtc: counter to fetch | ||
433 | - * | ||
434 | - * Driver callback for fetching a raw hardware vblank counter | ||
435 | - * for @crtc. If a device doesn't have a hardware counter, the | ||
436 | - * driver can simply return the value of drm_vblank_count and | ||
437 | - * make the enable_vblank() and disable_vblank() hooks into no-ops, | ||
438 | - * leaving interrupts enabled at all times. | ||
439 | - * | ||
440 | - * Wraparound handling and loss of events due to modesetting is dealt | ||
441 | - * with in the DRM core code. | ||
442 | - * | ||
443 | - * RETURNS | ||
444 | - * Raw vblank counter value. | ||
445 | - */ | ||
446 | - u32 (*get_vblank_counter) (struct drm_device *dev, int crtc); | ||
447 | - | ||
448 | - /** | ||
449 | - * enable_vblank - enable vblank interrupt events | ||
450 | - * @dev: DRM device | ||
451 | - * @crtc: which irq to enable | ||
452 | - * | ||
453 | - * Enable vblank interrupts for @crtc. If the device doesn't have | ||
454 | - * a hardware vblank counter, this routine should be a no-op, since | ||
455 | - * interrupts will have to stay on to keep the count accurate. | ||
456 | - * | ||
457 | - * RETURNS | ||
458 | - * Zero on success, appropriate errno if the given @crtc's vblank | ||
459 | - * interrupt cannot be enabled. | ||
460 | - */ | ||
461 | - int (*enable_vblank) (struct drm_device *dev, int crtc); | ||
462 | - | ||
463 | - /** | ||
464 | - * disable_vblank - disable vblank interrupt events | ||
465 | - * @dev: DRM device | ||
466 | - * @crtc: which irq to enable | ||
467 | - * | ||
468 | - * Disable vblank interrupts for @crtc. If the device doesn't have | ||
469 | - * a hardware vblank counter, this routine should be a no-op, since | ||
470 | - * interrupts will have to stay on to keep the count accurate. | ||
471 | - */ | ||
472 | - void (*disable_vblank) (struct drm_device *dev, int crtc); | ||
473 | + int (*vblank_wait) (struct drm_device *dev, unsigned int *sequence); | ||
474 | + int (*vblank_wait2) (struct drm_device *dev, unsigned int *sequence); | ||
475 | |||
476 | /** | ||
477 | * Called by \c drm_device_is_agp. Typically used to determine if a | ||
478 | @@ -766,6 +763,13 @@ | ||
479 | int (*proc_init)(struct drm_minor *minor); | 426 | int (*proc_init)(struct drm_minor *minor); |
480 | void (*proc_cleanup)(struct drm_minor *minor); | 427 | void (*proc_cleanup)(struct drm_minor *minor); |
481 | 428 | ||
@@ -489,19 +436,19 @@ Index: linux-2.6.28/include/drm/drmP.h | |||
489 | /** | 436 | /** |
490 | * Driver-specific constructor for drm_gem_objects, to set up | 437 | * Driver-specific constructor for drm_gem_objects, to set up |
491 | * obj->driver_private. | 438 | * obj->driver_private. |
492 | @@ -821,8 +825,11 @@ | 439 | @@ -821,8 +867,11 @@ |
493 | */ | 440 | */ |
494 | struct drm_device { | 441 | struct drm_device { |
495 | struct list_head driver_item; /**< list of devices per driver */ | 442 | struct list_head driver_item; /**< list of devices per driver */ |
496 | + char *unique; /**< Unique identifier: e.g., busid */ | 443 | + //char *unique; /**< Unique identifier: e.g., busid */ |
497 | + int unique_len; /**< Length of unique field */ | 444 | + //int unique_len; /**< Length of unique field */ |
498 | char *devname; /**< For /proc/interrupts */ | 445 | char *devname; /**< For /proc/interrupts */ |
499 | int if_version; /**< Highest interface version set */ | 446 | int if_version; /**< Highest interface version set */ |
500 | + int blocked; /**< Blocked due to VC switch? */ | 447 | + //int blocked; /**< Blocked due to VC switch? */ |
501 | 448 | ||
502 | /** \name Locks */ | 449 | /** \name Locks */ |
503 | /*@{ */ | 450 | /*@{ */ |
504 | @@ -847,12 +854,18 @@ | 451 | @@ -847,12 +896,18 @@ |
505 | /*@} */ | 452 | /*@} */ |
506 | 453 | ||
507 | struct list_head filelist; | 454 | struct list_head filelist; |
@@ -520,7 +467,7 @@ Index: linux-2.6.28/include/drm/drmP.h | |||
520 | 467 | ||
521 | /** \name Context handle management */ | 468 | /** \name Context handle management */ |
522 | /*@{ */ | 469 | /*@{ */ |
523 | @@ -864,6 +877,7 @@ | 470 | @@ -864,6 +919,7 @@ |
524 | 471 | ||
525 | struct list_head vmalist; /**< List of vmas (for debugging) */ | 472 | struct list_head vmalist; /**< List of vmas (for debugging) */ |
526 | 473 | ||
@@ -528,45 +475,7 @@ Index: linux-2.6.28/include/drm/drmP.h | |||
528 | /*@} */ | 475 | /*@} */ |
529 | 476 | ||
530 | /** \name DMA queues (contexts) */ | 477 | /** \name DMA queues (contexts) */ |
531 | @@ -877,6 +891,7 @@ | 478 | @@ -936,7 +992,6 @@ |
532 | |||
533 | /** \name Context support */ | ||
534 | /*@{ */ | ||
535 | + int irq; /**< Interrupt used by board */ | ||
536 | int irq_enabled; /**< True if irq handler is enabled */ | ||
537 | __volatile__ long context_flag; /**< Context swapping flag */ | ||
538 | __volatile__ long interrupt_flag; /**< Interruption handler flag */ | ||
539 | @@ -900,21 +915,15 @@ | ||
540 | */ | ||
541 | int vblank_disable_allowed; | ||
542 | |||
543 | - wait_queue_head_t *vbl_queue; /**< VBLANK wait queue */ | ||
544 | - atomic_t *_vblank_count; /**< number of VBLANK interrupts (driver must alloc the right number of counters) */ | ||
545 | + wait_queue_head_t vbl_queue; /**< VBLANK wait queue */ | ||
546 | + atomic_t vbl_received; | ||
547 | + atomic_t vbl_received2; /**< number of secondary VBLANK interrupts */ | ||
548 | spinlock_t vbl_lock; | ||
549 | - struct list_head *vbl_sigs; /**< signal list to send on VBLANK */ | ||
550 | - atomic_t vbl_signal_pending; /* number of signals pending on all crtcs*/ | ||
551 | - atomic_t *vblank_refcount; /* number of users of vblank interruptsper crtc */ | ||
552 | - u32 *last_vblank; /* protected by dev->vbl_lock, used */ | ||
553 | - /* for wraparound handling */ | ||
554 | - int *vblank_enabled; /* so we don't call enable more than | ||
555 | - once per disable */ | ||
556 | - int *vblank_inmodeset; /* Display driver is setting mode */ | ||
557 | - u32 *last_vblank_wait; /* Last vblank seqno waited per CRTC */ | ||
558 | - struct timer_list vblank_disable_timer; | ||
559 | - | ||
560 | - u32 max_vblank_count; /**< size of vblank counter register */ | ||
561 | + struct list_head vbl_sigs; /**< signal list to send on VBLANK */ | ||
562 | + struct list_head vbl_sigs2; /**< signals to send on secondary VBLANK */ | ||
563 | + unsigned int vbl_pending; | ||
564 | + spinlock_t tasklet_lock; /**< For drm_locked_tasklet */ | ||
565 | + void (*locked_tasklet_func)(struct drm_device *dev); | ||
566 | |||
567 | /*@} */ | ||
568 | cycles_t ctx_start; | ||
569 | @@ -936,7 +945,6 @@ | ||
570 | int num_crtcs; /**< Number of CRTCs on this device */ | 479 | int num_crtcs; /**< Number of CRTCs on this device */ |
571 | void *dev_private; /**< device private data */ | 480 | void *dev_private; /**< device private data */ |
572 | void *mm_private; | 481 | void *mm_private; |
@@ -574,7 +483,7 @@ Index: linux-2.6.28/include/drm/drmP.h | |||
574 | struct drm_sigdata sigdata; /**< For block_all_signals */ | 483 | struct drm_sigdata sigdata; /**< For block_all_signals */ |
575 | sigset_t sigmask; | 484 | sigset_t sigmask; |
576 | 485 | ||
577 | @@ -945,6 +953,8 @@ | 486 | @@ -945,6 +1000,8 @@ |
578 | unsigned int agp_buffer_token; | 487 | unsigned int agp_buffer_token; |
579 | struct drm_minor *control; /**< Control node for card */ | 488 | struct drm_minor *control; /**< Control node for card */ |
580 | struct drm_minor *primary; /**< render type primary screen head */ | 489 | struct drm_minor *primary; /**< render type primary screen head */ |
@@ -583,7 +492,7 @@ Index: linux-2.6.28/include/drm/drmP.h | |||
583 | 492 | ||
584 | /** \name Drawable information */ | 493 | /** \name Drawable information */ |
585 | /*@{ */ | 494 | /*@{ */ |
586 | @@ -976,6 +986,27 @@ | 495 | @@ -976,6 +1033,27 @@ |
587 | return dev->pdev->irq; | 496 | return dev->pdev->irq; |
588 | } | 497 | } |
589 | 498 | ||
@@ -611,37 +520,20 @@ Index: linux-2.6.28/include/drm/drmP.h | |||
611 | static __inline__ int drm_core_check_feature(struct drm_device *dev, | 520 | static __inline__ int drm_core_check_feature(struct drm_device *dev, |
612 | int feature) | 521 | int feature) |
613 | { | 522 | { |
614 | @@ -1042,6 +1073,9 @@ | 523 | @@ -1042,6 +1120,9 @@ |
615 | /* Driver support (drm_drv.h) */ | 524 | /* Driver support (drm_drv.h) */ |
616 | extern int drm_init(struct drm_driver *driver); | 525 | extern int drm_init(struct drm_driver *driver); |
617 | extern void drm_exit(struct drm_driver *driver); | 526 | extern void drm_exit(struct drm_driver *driver); |
618 | +extern void drm_cleanup_pci(struct pci_dev *pdev); | 527 | +extern void drm_cleanup_pci(struct pci_dev *pdev); |
619 | +extern void drm_vbl_send_signals(struct drm_device *dev); | 528 | +extern void drm_vbl_send_signals(struct drm_device *dev, int crtc); |
620 | +extern struct drm_ttm_backend *drm_agp_init_ttm(struct drm_device *dev); | 529 | +extern struct drm_ttm_backend *drm_agp_init_ttm(struct drm_device *dev); |
621 | extern int drm_ioctl(struct inode *inode, struct file *filp, | 530 | extern int drm_ioctl(struct inode *inode, struct file *filp, |
622 | unsigned int cmd, unsigned long arg); | 531 | unsigned int cmd, unsigned long arg); |
623 | extern long drm_compat_ioctl(struct file *filp, | 532 | extern long drm_compat_ioctl(struct file *filp, |
624 | @@ -1208,6 +1242,8 @@ | ||
625 | extern int drm_wait_vblank(struct drm_device *dev, void *data, | ||
626 | struct drm_file *filp); | ||
627 | extern int drm_vblank_wait(struct drm_device *dev, unsigned int *vbl_seq); | ||
628 | +extern void drm_locked_tasklet(struct drm_device *dev, | ||
629 | + void(*func)(struct drm_device *)); | ||
630 | extern u32 drm_vblank_count(struct drm_device *dev, int crtc); | ||
631 | extern void drm_handle_vblank(struct drm_device *dev, int crtc); | ||
632 | extern int drm_vblank_get(struct drm_device *dev, int crtc); | ||
633 | @@ -1218,6 +1254,7 @@ | ||
634 | extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc); | ||
635 | extern int drm_modeset_ctl(struct drm_device *dev, void *data, | ||
636 | struct drm_file *file_priv); | ||
637 | +extern void drm_locked_tasklet(struct drm_device *dev, void(*func)(struct drm_device*)); | ||
638 | |||
639 | /* AGP/GART support (drm_agpsupport.h) */ | ||
640 | extern struct drm_agp_head *drm_agp_init(struct drm_device *dev); | ||
641 | Index: linux-2.6.28/include/drm/drm_pciids.h | 533 | Index: linux-2.6.28/include/drm/drm_pciids.h |
642 | =================================================================== | 534 | =================================================================== |
643 | --- linux-2.6.28.orig/include/drm/drm_pciids.h 2009-02-12 09:14:31.000000000 +0000 | 535 | --- linux-2.6.28.orig/include/drm/drm_pciids.h 2009-02-20 12:22:53.000000000 +0000 |
644 | +++ linux-2.6.28/include/drm/drm_pciids.h 2009-02-12 09:14:41.000000000 +0000 | 536 | +++ linux-2.6.28/include/drm/drm_pciids.h 2009-02-20 12:23:06.000000000 +0000 |
645 | @@ -419,3 +419,9 @@ | 537 | @@ -419,3 +419,9 @@ |
646 | {0x8086, 0x2e12, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | 538 | {0x8086, 0x2e12, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ |
647 | {0x8086, 0x2e22, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | 539 | {0x8086, 0x2e22, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ |
@@ -654,8 +546,8 @@ Index: linux-2.6.28/include/drm/drm_pciids.h | |||
654 | + | 546 | + |
655 | Index: linux-2.6.28/drivers/gpu/drm/Makefile | 547 | Index: linux-2.6.28/drivers/gpu/drm/Makefile |
656 | =================================================================== | 548 | =================================================================== |
657 | --- linux-2.6.28.orig/drivers/gpu/drm/Makefile 2009-02-12 09:14:37.000000000 +0000 | 549 | --- linux-2.6.28.orig/drivers/gpu/drm/Makefile 2009-02-20 12:22:53.000000000 +0000 |
658 | +++ linux-2.6.28/drivers/gpu/drm/Makefile 2009-02-12 16:00:51.000000000 +0000 | 550 | +++ linux-2.6.28/drivers/gpu/drm/Makefile 2009-02-20 12:23:06.000000000 +0000 |
659 | @@ -10,6 +10,8 @@ | 551 | @@ -10,6 +10,8 @@ |
660 | drm_lock.o drm_memory.o drm_proc.o drm_stub.o drm_vm.o \ | 552 | drm_lock.o drm_memory.o drm_proc.o drm_stub.o drm_vm.o \ |
661 | drm_agpsupport.o drm_scatter.o ati_pcigart.o drm_pci.o \ | 553 | drm_agpsupport.o drm_scatter.o ati_pcigart.o drm_pci.o \ |
@@ -675,8 +567,8 @@ Index: linux-2.6.28/drivers/gpu/drm/Makefile | |||
675 | obj-$(CONFIG_DRM_VIA) +=via/ | 567 | obj-$(CONFIG_DRM_VIA) +=via/ |
676 | Index: linux-2.6.28/drivers/gpu/drm/drm_agpsupport.c | 568 | Index: linux-2.6.28/drivers/gpu/drm/drm_agpsupport.c |
677 | =================================================================== | 569 | =================================================================== |
678 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_agpsupport.c 2009-02-12 09:14:31.000000000 +0000 | 570 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_agpsupport.c 2009-02-20 12:22:53.000000000 +0000 |
679 | +++ linux-2.6.28/drivers/gpu/drm/drm_agpsupport.c 2009-02-12 09:14:41.000000000 +0000 | 571 | +++ linux-2.6.28/drivers/gpu/drm/drm_agpsupport.c 2009-02-20 12:23:06.000000000 +0000 |
680 | @@ -502,4 +502,156 @@ | 572 | @@ -502,4 +502,156 @@ |
681 | } | 573 | } |
682 | EXPORT_SYMBOL(drm_agp_chipset_flush); | 574 | EXPORT_SYMBOL(drm_agp_chipset_flush); |
@@ -837,7 +729,7 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_agpsupport.c | |||
837 | Index: linux-2.6.28/drivers/gpu/drm/drm_bo.c | 729 | Index: linux-2.6.28/drivers/gpu/drm/drm_bo.c |
838 | =================================================================== | 730 | =================================================================== |
839 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 731 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
840 | +++ linux-2.6.28/drivers/gpu/drm/drm_bo.c 2009-02-12 09:14:41.000000000 +0000 | 732 | +++ linux-2.6.28/drivers/gpu/drm/drm_bo.c 2009-02-20 12:23:06.000000000 +0000 |
841 | @@ -0,0 +1,2660 @@ | 733 | @@ -0,0 +1,2660 @@ |
842 | +/************************************************************************** | 734 | +/************************************************************************** |
843 | + * | 735 | + * |
@@ -3502,7 +3394,7 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_bo.c | |||
3502 | Index: linux-2.6.28/drivers/gpu/drm/drm_bo_lock.c | 3394 | Index: linux-2.6.28/drivers/gpu/drm/drm_bo_lock.c |
3503 | =================================================================== | 3395 | =================================================================== |
3504 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 3396 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
3505 | +++ linux-2.6.28/drivers/gpu/drm/drm_bo_lock.c 2009-02-12 09:14:41.000000000 +0000 | 3397 | +++ linux-2.6.28/drivers/gpu/drm/drm_bo_lock.c 2009-02-20 12:23:06.000000000 +0000 |
3506 | @@ -0,0 +1,175 @@ | 3398 | @@ -0,0 +1,175 @@ |
3507 | +/************************************************************************** | 3399 | +/************************************************************************** |
3508 | + * | 3400 | + * |
@@ -3682,8 +3574,8 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_bo_lock.c | |||
3682 | Index: linux-2.6.28/drivers/gpu/drm/drm_bo_move.c | 3574 | Index: linux-2.6.28/drivers/gpu/drm/drm_bo_move.c |
3683 | =================================================================== | 3575 | =================================================================== |
3684 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 3576 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
3685 | +++ linux-2.6.28/drivers/gpu/drm/drm_bo_move.c 2009-02-12 09:14:41.000000000 +0000 | 3577 | +++ linux-2.6.28/drivers/gpu/drm/drm_bo_move.c 2009-02-20 12:23:06.000000000 +0000 |
3686 | @@ -0,0 +1,597 @@ | 3578 | @@ -0,0 +1,590 @@ |
3687 | +/************************************************************************** | 3579 | +/************************************************************************** |
3688 | + * | 3580 | + * |
3689 | + * Copyright (c) 2007 Tungsten Graphics, Inc., Cedar Park, TX., USA | 3581 | + * Copyright (c) 2007 Tungsten Graphics, Inc., Cedar Park, TX., USA |
@@ -4111,13 +4003,6 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_bo_move.c | |||
4111 | + pgprot_t tmp = PAGE_KERNEL; | 4003 | + pgprot_t tmp = PAGE_KERNEL; |
4112 | + | 4004 | + |
4113 | +#if defined(__i386__) || defined(__x86_64__) | 4005 | +#if defined(__i386__) || defined(__x86_64__) |
4114 | +#ifdef USE_PAT_WC | ||
4115 | +#warning using pat | ||
4116 | + if (drm_use_pat() && map_type == _DRM_TTM) { | ||
4117 | + pgprot_val(tmp) |= _PAGE_PAT; | ||
4118 | + return tmp; | ||
4119 | + } | ||
4120 | +#endif | ||
4121 | + if (boot_cpu_data.x86 > 3 && map_type != _DRM_AGP) { | 4006 | + if (boot_cpu_data.x86 > 3 && map_type != _DRM_AGP) { |
4122 | + pgprot_val(tmp) |= _PAGE_PCD; | 4007 | + pgprot_val(tmp) |= _PAGE_PCD; |
4123 | + pgprot_val(tmp) &= ~_PAGE_PWT; | 4008 | + pgprot_val(tmp) &= ~_PAGE_PWT; |
@@ -4283,8 +4168,8 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_bo_move.c | |||
4283 | +EXPORT_SYMBOL(drm_bo_kunmap); | 4168 | +EXPORT_SYMBOL(drm_bo_kunmap); |
4284 | Index: linux-2.6.28/drivers/gpu/drm/drm_bufs.c | 4169 | Index: linux-2.6.28/drivers/gpu/drm/drm_bufs.c |
4285 | =================================================================== | 4170 | =================================================================== |
4286 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_bufs.c 2009-02-12 09:14:37.000000000 +0000 | 4171 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_bufs.c 2009-02-20 12:22:53.000000000 +0000 |
4287 | +++ linux-2.6.28/drivers/gpu/drm/drm_bufs.c 2009-02-12 09:14:41.000000000 +0000 | 4172 | +++ linux-2.6.28/drivers/gpu/drm/drm_bufs.c 2009-02-20 12:23:06.000000000 +0000 |
4288 | @@ -435,6 +435,8 @@ | 4173 | @@ -435,6 +435,8 @@ |
4289 | case _DRM_GEM: | 4174 | case _DRM_GEM: |
4290 | DRM_ERROR("tried to rmmap GEM object\n"); | 4175 | DRM_ERROR("tried to rmmap GEM object\n"); |
@@ -4296,50 +4181,9 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_bufs.c | |||
4296 | 4181 | ||
4297 | Index: linux-2.6.28/drivers/gpu/drm/drm_drv.c | 4182 | Index: linux-2.6.28/drivers/gpu/drm/drm_drv.c |
4298 | =================================================================== | 4183 | =================================================================== |
4299 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_drv.c 2009-02-12 09:14:37.000000000 +0000 | 4184 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_drv.c 2009-02-20 12:22:53.000000000 +0000 |
4300 | +++ linux-2.6.28/drivers/gpu/drm/drm_drv.c 2009-02-12 09:14:41.000000000 +0000 | 4185 | +++ linux-2.6.28/drivers/gpu/drm/drm_drv.c 2009-02-20 12:27:53.000000000 +0000 |
4301 | @@ -1,3 +1,4 @@ | 4186 | @@ -143,6 +143,34 @@ |
4302 | + | ||
4303 | /** | ||
4304 | * \file drm_drv.c | ||
4305 | * Generic driver template | ||
4306 | @@ -49,6 +50,9 @@ | ||
4307 | #include "drmP.h" | ||
4308 | #include "drm_core.h" | ||
4309 | |||
4310 | +static void drm_cleanup(struct drm_device * dev); | ||
4311 | +int drm_fb_loaded = 0; | ||
4312 | + | ||
4313 | static int drm_version(struct drm_device *dev, void *data, | ||
4314 | struct drm_file *file_priv); | ||
4315 | |||
4316 | @@ -119,7 +123,7 @@ | ||
4317 | |||
4318 | DRM_IOCTL_DEF(DRM_IOCTL_WAIT_VBLANK, drm_wait_vblank, 0), | ||
4319 | |||
4320 | - DRM_IOCTL_DEF(DRM_IOCTL_MODESET_CTL, drm_modeset_ctl, 0), | ||
4321 | + | ||
4322 | |||
4323 | DRM_IOCTL_DEF(DRM_IOCTL_UPDATE_DRAW, drm_update_drawable_info, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), | ||
4324 | |||
4325 | @@ -130,19 +134,48 @@ | ||
4326 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETRESOURCES, drm_mode_getresources, DRM_MASTER|DRM_CONTROL_ALLOW), | ||
4327 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETCRTC, drm_mode_getcrtc, DRM_MASTER|DRM_CONTROL_ALLOW), | ||
4328 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_SETCRTC, drm_mode_setcrtc, DRM_MASTER|DRM_CONTROL_ALLOW), | ||
4329 | - DRM_IOCTL_DEF(DRM_IOCTL_MODE_CURSOR, drm_mode_cursor_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW), | ||
4330 | +/* DRM_IOCTL_DEF(DRM_IOCTL_MODE_CURSOR, drm_mode_cursor_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW), | ||
4331 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETGAMMA, drm_mode_gamma_get_ioctl, DRM_MASTER), | ||
4332 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_SETGAMMA, drm_mode_gamma_set_ioctl, DRM_MASTER), | ||
4333 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETENCODER, drm_mode_getencoder, DRM_MASTER|DRM_CONTROL_ALLOW), | ||
4334 | - DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETCONNECTOR, drm_mode_getconnector, DRM_MASTER|DRM_CONTROL_ALLOW), | ||
4335 | + DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETCONNECTOR, drm_mode_getconnector, DRM_MASTER|DRM_CONTROL_ALLOW),*/ | ||
4336 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_ATTACHMODE, drm_mode_attachmode_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW), | ||
4337 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_DETACHMODE, drm_mode_detachmode_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW), | ||
4338 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETPROPERTY, drm_mode_getproperty_ioctl, DRM_MASTER | DRM_CONTROL_ALLOW), | ||
4339 | - DRM_IOCTL_DEF(DRM_IOCTL_MODE_SETPROPERTY, drm_mode_connector_property_set_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW), | ||
4340 | - DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETPROPBLOB, drm_mode_getblob_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW), | ||
4341 | +/* DRM_IOCTL_DEF(DRM_IOCTL_MODE_SETPROPERTY, drm_mode_connector_property_set_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW), | ||
4342 | + DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETPROPBLOB, drm_mode_getblob_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW),*/ | ||
4343 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETFB, drm_mode_getfb, DRM_MASTER|DRM_CONTROL_ALLOW), | 4187 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETFB, drm_mode_getfb, DRM_MASTER|DRM_CONTROL_ALLOW), |
4344 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB, drm_mode_addfb, DRM_MASTER|DRM_CONTROL_ALLOW), | 4188 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB, drm_mode_addfb, DRM_MASTER|DRM_CONTROL_ALLOW), |
4345 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_RMFB, drm_mode_rmfb, DRM_MASTER|DRM_CONTROL_ALLOW), | 4189 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_RMFB, drm_mode_rmfb, DRM_MASTER|DRM_CONTROL_ALLOW), |
@@ -4371,41 +4215,10 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_drv.c | |||
4371 | + DRM_IOCTL_DEF(DRM_IOCTL_BO_INFO, drm_bo_info_ioctl, DRM_AUTH), | 4215 | + DRM_IOCTL_DEF(DRM_IOCTL_BO_INFO, drm_bo_info_ioctl, DRM_AUTH), |
4372 | + DRM_IOCTL_DEF(DRM_IOCTL_BO_WAIT_IDLE, drm_bo_wait_idle_ioctl, DRM_AUTH), | 4216 | + DRM_IOCTL_DEF(DRM_IOCTL_BO_WAIT_IDLE, drm_bo_wait_idle_ioctl, DRM_AUTH), |
4373 | + DRM_IOCTL_DEF(DRM_IOCTL_BO_VERSION, drm_bo_version_ioctl, 0), | 4217 | + DRM_IOCTL_DEF(DRM_IOCTL_BO_VERSION, drm_bo_version_ioctl, 0), |
4374 | + | ||
4375 | }; | 4218 | }; |
4376 | 4219 | ||
4377 | #define DRM_CORE_IOCTL_COUNT ARRAY_SIZE( drm_ioctls ) | 4220 | #define DRM_CORE_IOCTL_COUNT ARRAY_SIZE( drm_ioctls ) |
4378 | @@ -236,6 +269,17 @@ | 4221 | @@ -317,6 +345,9 @@ |
4379 | return 0; | ||
4380 | } | ||
4381 | |||
4382 | +void drm_cleanup_pci(struct pci_dev *pdev) | ||
4383 | +{ | ||
4384 | + struct drm_device *dev = pci_get_drvdata(pdev); | ||
4385 | + | ||
4386 | + pci_set_drvdata(pdev, NULL); | ||
4387 | + pci_release_regions(pdev); | ||
4388 | + if (dev) | ||
4389 | + drm_cleanup(dev); | ||
4390 | +} | ||
4391 | +EXPORT_SYMBOL(drm_cleanup_pci); | ||
4392 | + | ||
4393 | /** | ||
4394 | * Module initialization. Called via init_module at module load time, or via | ||
4395 | * linux/init/main.c (this is not currently supported). | ||
4396 | @@ -301,9 +345,10 @@ | ||
4397 | return; | ||
4398 | } | ||
4399 | |||
4400 | - drm_vblank_cleanup(dev); | ||
4401 | + //drm_vblank_cleanup(dev); | ||
4402 | |||
4403 | drm_lastclose(dev); | ||
4404 | + drm_ctxbitmap_cleanup(dev); | ||
4405 | |||
4406 | if (drm_core_has_MTRR(dev) && drm_core_has_AGP(dev) && | ||
4407 | dev->agp && dev->agp->agp_mtrr >= 0) { | ||
4408 | @@ -317,13 +362,21 @@ | ||
4409 | if (dev->driver->unload) | 4222 | if (dev->driver->unload) |
4410 | dev->driver->unload(dev); | 4223 | dev->driver->unload(dev); |
4411 | 4224 | ||
@@ -4415,23 +4228,37 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_drv.c | |||
4415 | if (drm_core_has_AGP(dev) && dev->agp) { | 4228 | if (drm_core_has_AGP(dev) && dev->agp) { |
4416 | drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS); | 4229 | drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS); |
4417 | dev->agp = NULL; | 4230 | dev->agp = NULL; |
4418 | } | 4231 | @@ -324,6 +355,8 @@ |
4419 | 4232 | ||
4420 | drm_ht_remove(&dev->map_hash); | 4233 | drm_ht_remove(&dev->map_hash); |
4421 | - drm_ctxbitmap_cleanup(dev); | 4234 | drm_ctxbitmap_cleanup(dev); |
4422 | + drm_mm_takedown(&dev->offset_manager); | 4235 | + drm_mm_takedown(&dev->offset_manager); |
4423 | + drm_ht_remove(&dev->object_hash); | 4236 | + drm_ht_remove(&dev->object_hash); |
4424 | + | ||
4425 | + | ||
4426 | + if (!drm_fb_loaded) | ||
4427 | + pci_disable_device(dev->pdev); | ||
4428 | 4237 | ||
4429 | if (drm_core_check_feature(dev, DRIVER_MODESET)) | 4238 | if (drm_core_check_feature(dev, DRIVER_MODESET)) |
4430 | drm_put_minor(&dev->control); | 4239 | drm_put_minor(&dev->control); |
4240 | @@ -336,6 +369,17 @@ | ||
4241 | DRM_ERROR("Cannot unload module\n"); | ||
4242 | } | ||
4243 | |||
4244 | +void drm_cleanup_pci(struct pci_dev *pdev) | ||
4245 | +{ | ||
4246 | + struct drm_device *dev = pci_get_drvdata(pdev); | ||
4247 | + | ||
4248 | + pci_set_drvdata(pdev, NULL); | ||
4249 | + pci_release_regions(pdev); | ||
4250 | + if (dev) | ||
4251 | + drm_cleanup(dev); | ||
4252 | +} | ||
4253 | +EXPORT_SYMBOL(drm_cleanup_pci); | ||
4254 | + | ||
4255 | void drm_exit(struct drm_driver *driver) | ||
4256 | { | ||
4257 | struct drm_device *dev, *tmp; | ||
4431 | Index: linux-2.6.28/drivers/gpu/drm/drm_fence.c | 4258 | Index: linux-2.6.28/drivers/gpu/drm/drm_fence.c |
4432 | =================================================================== | 4259 | =================================================================== |
4433 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 4260 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
4434 | +++ linux-2.6.28/drivers/gpu/drm/drm_fence.c 2009-02-12 09:14:41.000000000 +0000 | 4261 | +++ linux-2.6.28/drivers/gpu/drm/drm_fence.c 2009-02-20 12:23:06.000000000 +0000 |
4435 | @@ -0,0 +1,829 @@ | 4262 | @@ -0,0 +1,829 @@ |
4436 | +/************************************************************************** | 4263 | +/************************************************************************** |
4437 | + * | 4264 | + * |
@@ -5264,8 +5091,8 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_fence.c | |||
5264 | +} | 5091 | +} |
5265 | Index: linux-2.6.28/drivers/gpu/drm/drm_fops.c | 5092 | Index: linux-2.6.28/drivers/gpu/drm/drm_fops.c |
5266 | =================================================================== | 5093 | =================================================================== |
5267 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_fops.c 2009-02-12 09:14:37.000000000 +0000 | 5094 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_fops.c 2009-02-20 12:22:53.000000000 +0000 |
5268 | +++ linux-2.6.28/drivers/gpu/drm/drm_fops.c 2009-02-12 09:14:41.000000000 +0000 | 5095 | +++ linux-2.6.28/drivers/gpu/drm/drm_fops.c 2009-02-20 12:31:55.000000000 +0000 |
5269 | @@ -1,3 +1,4 @@ | 5096 | @@ -1,3 +1,4 @@ |
5270 | + | 5097 | + |
5271 | /** | 5098 | /** |
@@ -5304,66 +5131,11 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_fops.c | |||
5304 | if (dev->driver->open) { | 5131 | if (dev->driver->open) { |
5305 | ret = dev->driver->open(dev, priv); | 5132 | ret = dev->driver->open(dev, priv); |
5306 | if (ret < 0) | 5133 | if (ret < 0) |
5307 | @@ -416,6 +432,33 @@ | ||
5308 | } | ||
5309 | } | ||
5310 | |||
5311 | +static void drm_object_release(struct file *filp) | ||
5312 | +{ | ||
5313 | + struct drm_file *priv = filp->private_data; | ||
5314 | + struct list_head *head; | ||
5315 | + struct drm_ref_object *ref_object; | ||
5316 | + int i; | ||
5317 | + | ||
5318 | + /* | ||
5319 | + * Free leftover ref objects created by me. Note that we cannot use | ||
5320 | + * list_for_each() here, as the struct_mutex may be temporarily | ||
5321 | + * released by the remove_() functions, and thus the lists may be | ||
5322 | + * altered. | ||
5323 | + * Also, a drm_remove_ref_object() will not remove it | ||
5324 | + * from the list unless its refcount is 1. | ||
5325 | + */ | ||
5326 | + | ||
5327 | + head = &priv->refd_objects; | ||
5328 | + while (head->next != head) { | ||
5329 | + ref_object = list_entry(head->next, struct drm_ref_object, list); | ||
5330 | + drm_remove_ref_object(priv, ref_object); | ||
5331 | + head = &priv->refd_objects; | ||
5332 | + } | ||
5333 | + | ||
5334 | + for (i = 0; i < _DRM_NO_REF_TYPES; ++i) | ||
5335 | + drm_ht_remove(&priv->refd_object_hash[i]); | ||
5336 | +} | ||
5337 | + | ||
5338 | /** | ||
5339 | * Release file. | ||
5340 | * | ||
5341 | Index: linux-2.6.28/drivers/gpu/drm/drm_irq.c | 5134 | Index: linux-2.6.28/drivers/gpu/drm/drm_irq.c |
5342 | =================================================================== | 5135 | =================================================================== |
5343 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_irq.c 2009-02-12 09:14:37.000000000 +0000 | 5136 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_irq.c 2009-02-20 12:22:53.000000000 +0000 |
5344 | +++ linux-2.6.28/drivers/gpu/drm/drm_irq.c 2009-02-12 09:14:41.000000000 +0000 | 5137 | +++ linux-2.6.28/drivers/gpu/drm/drm_irq.c 2009-02-20 12:23:06.000000000 +0000 |
5345 | @@ -1,3 +1,4 @@ | 5138 | @@ -124,6 +124,7 @@ |
5346 | + | ||
5347 | /** | ||
5348 | * \file drm_irq.c | ||
5349 | * IRQ support | ||
5350 | @@ -70,6 +71,7 @@ | ||
5351 | |||
5352 | return 0; | ||
5353 | } | ||
5354 | +#if 0 | ||
5355 | |||
5356 | static void vblank_disable_fn(unsigned long arg) | ||
5357 | { | ||
5358 | @@ -116,14 +118,12 @@ | ||
5359 | dev->num_crtcs, DRM_MEM_DRIVER); | ||
5360 | drm_free(dev->last_vblank, sizeof(*dev->last_vblank) * dev->num_crtcs, | ||
5361 | DRM_MEM_DRIVER); | ||
5362 | - drm_free(dev->last_vblank_wait, | ||
5363 | - sizeof(*dev->last_vblank_wait) * dev->num_crtcs, | ||
5364 | - DRM_MEM_DRIVER); | ||
5365 | drm_free(dev->vblank_inmodeset, sizeof(*dev->vblank_inmodeset) * | ||
5366 | dev->num_crtcs, DRM_MEM_DRIVER); | ||
5367 | 5139 | ||
5368 | dev->num_crtcs = 0; | 5140 | dev->num_crtcs = 0; |
5369 | } | 5141 | } |
@@ -5371,590 +5143,27 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_irq.c | |||
5371 | 5143 | ||
5372 | int drm_vblank_init(struct drm_device *dev, int num_crtcs) | 5144 | int drm_vblank_init(struct drm_device *dev, int num_crtcs) |
5373 | { | 5145 | { |
5374 | @@ -164,11 +164,6 @@ | 5146 | @@ -697,7 +698,7 @@ |
5375 | if (!dev->last_vblank) | ||
5376 | goto err; | ||
5377 | |||
5378 | - dev->last_vblank_wait = drm_calloc(num_crtcs, sizeof(u32), | ||
5379 | - DRM_MEM_DRIVER); | ||
5380 | - if (!dev->last_vblank_wait) | ||
5381 | - goto err; | ||
5382 | - | ||
5383 | dev->vblank_inmodeset = drm_calloc(num_crtcs, sizeof(int), | ||
5384 | DRM_MEM_DRIVER); | ||
5385 | if (!dev->vblank_inmodeset) | ||
5386 | @@ -192,6 +187,8 @@ | ||
5387 | } | ||
5388 | EXPORT_SYMBOL(drm_vblank_init); | ||
5389 | |||
5390 | +#endif | ||
5391 | + | ||
5392 | /** | ||
5393 | * Install IRQ handler. | ||
5394 | * | ||
5395 | @@ -229,6 +226,17 @@ | ||
5396 | |||
5397 | DRM_DEBUG("irq=%d\n", dev->pdev->irq); | ||
5398 | |||
5399 | + if (drm_core_check_feature(dev, DRIVER_IRQ_VBL)) { | ||
5400 | + init_waitqueue_head(&dev->vbl_queue); | ||
5401 | + | ||
5402 | + spin_lock_init(&dev->vbl_lock); | ||
5403 | + | ||
5404 | + INIT_LIST_HEAD(&dev->vbl_sigs); | ||
5405 | + INIT_LIST_HEAD(&dev->vbl_sigs2); | ||
5406 | + | ||
5407 | + dev->vbl_pending = 0; | ||
5408 | + } | ||
5409 | + | ||
5410 | /* Before installing handler */ | ||
5411 | dev->driver->irq_preinstall(dev); | ||
5412 | |||
5413 | @@ -238,7 +246,10 @@ | ||
5414 | |||
5415 | ret = request_irq(drm_dev_to_irq(dev), dev->driver->irq_handler, | ||
5416 | sh_flags, dev->devname, dev); | ||
5417 | - | ||
5418 | + /* Expose the device irq number to drivers that want to export it for | ||
5419 | + * whatever reason. | ||
5420 | + */ | ||
5421 | + dev->irq = drm_dev_to_irq(dev); | ||
5422 | if (ret < 0) { | ||
5423 | mutex_lock(&dev->struct_mutex); | ||
5424 | dev->irq_enabled = 0; | ||
5425 | @@ -267,8 +278,7 @@ | ||
5426 | */ | ||
5427 | int drm_irq_uninstall(struct drm_device * dev) | ||
5428 | { | ||
5429 | - unsigned long irqflags; | ||
5430 | - int irq_enabled, i; | ||
5431 | + int irq_enabled; | ||
5432 | |||
5433 | if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) | ||
5434 | return -EINVAL; | ||
5435 | @@ -278,16 +288,6 @@ | ||
5436 | dev->irq_enabled = 0; | ||
5437 | mutex_unlock(&dev->struct_mutex); | ||
5438 | |||
5439 | - /* | ||
5440 | - * Wake up any waiters so they don't hang. | ||
5441 | - */ | ||
5442 | - spin_lock_irqsave(&dev->vbl_lock, irqflags); | ||
5443 | - for (i = 0; i < dev->num_crtcs; i++) { | ||
5444 | - DRM_WAKEUP(&dev->vbl_queue[i]); | ||
5445 | - dev->vblank_enabled[i] = 0; | ||
5446 | - } | ||
5447 | - spin_unlock_irqrestore(&dev->vbl_lock, irqflags); | ||
5448 | - | ||
5449 | if (!irq_enabled) | ||
5450 | return -EINVAL; | ||
5451 | |||
5452 | @@ -297,6 +297,8 @@ | ||
5453 | |||
5454 | free_irq(dev->pdev->irq, dev); | ||
5455 | |||
5456 | + dev->locked_tasklet_func = NULL; | ||
5457 | + | ||
5458 | return 0; | ||
5459 | } | ||
5460 | EXPORT_SYMBOL(drm_irq_uninstall); | ||
5461 | @@ -342,196 +344,6 @@ | ||
5462 | } | ||
5463 | |||
5464 | /** | ||
5465 | - * drm_vblank_count - retrieve "cooked" vblank counter value | ||
5466 | - * @dev: DRM device | ||
5467 | - * @crtc: which counter to retrieve | ||
5468 | - * | ||
5469 | - * Fetches the "cooked" vblank count value that represents the number of | ||
5470 | - * vblank events since the system was booted, including lost events due to | ||
5471 | - * modesetting activity. | ||
5472 | - */ | ||
5473 | -u32 drm_vblank_count(struct drm_device *dev, int crtc) | ||
5474 | -{ | ||
5475 | - return atomic_read(&dev->_vblank_count[crtc]); | ||
5476 | -} | ||
5477 | -EXPORT_SYMBOL(drm_vblank_count); | ||
5478 | - | ||
5479 | -/** | ||
5480 | - * drm_update_vblank_count - update the master vblank counter | ||
5481 | - * @dev: DRM device | ||
5482 | - * @crtc: counter to update | ||
5483 | - * | ||
5484 | - * Call back into the driver to update the appropriate vblank counter | ||
5485 | - * (specified by @crtc). Deal with wraparound, if it occurred, and | ||
5486 | - * update the last read value so we can deal with wraparound on the next | ||
5487 | - * call if necessary. | ||
5488 | - * | ||
5489 | - * Only necessary when going from off->on, to account for frames we | ||
5490 | - * didn't get an interrupt for. | ||
5491 | - * | ||
5492 | - * Note: caller must hold dev->vbl_lock since this reads & writes | ||
5493 | - * device vblank fields. | ||
5494 | - */ | ||
5495 | -static void drm_update_vblank_count(struct drm_device *dev, int crtc) | ||
5496 | -{ | ||
5497 | - u32 cur_vblank, diff; | ||
5498 | - | ||
5499 | - /* | ||
5500 | - * Interrupts were disabled prior to this call, so deal with counter | ||
5501 | - * wrap if needed. | ||
5502 | - * NOTE! It's possible we lost a full dev->max_vblank_count events | ||
5503 | - * here if the register is small or we had vblank interrupts off for | ||
5504 | - * a long time. | ||
5505 | - */ | ||
5506 | - cur_vblank = dev->driver->get_vblank_counter(dev, crtc); | ||
5507 | - diff = cur_vblank - dev->last_vblank[crtc]; | ||
5508 | - if (cur_vblank < dev->last_vblank[crtc]) { | ||
5509 | - diff += dev->max_vblank_count; | ||
5510 | - | ||
5511 | - DRM_DEBUG("last_vblank[%d]=0x%x, cur_vblank=0x%x => diff=0x%x\n", | ||
5512 | - crtc, dev->last_vblank[crtc], cur_vblank, diff); | ||
5513 | - } | ||
5514 | - | ||
5515 | - DRM_DEBUG("enabling vblank interrupts on crtc %d, missed %d\n", | ||
5516 | - crtc, diff); | ||
5517 | - | ||
5518 | - atomic_add(diff, &dev->_vblank_count[crtc]); | ||
5519 | -} | ||
5520 | - | ||
5521 | -/** | ||
5522 | - * drm_vblank_get - get a reference count on vblank events | ||
5523 | - * @dev: DRM device | ||
5524 | - * @crtc: which CRTC to own | ||
5525 | - * | ||
5526 | - * Acquire a reference count on vblank events to avoid having them disabled | ||
5527 | - * while in use. | ||
5528 | - * | ||
5529 | - * RETURNS | ||
5530 | - * Zero on success, nonzero on failure. | ||
5531 | - */ | ||
5532 | -int drm_vblank_get(struct drm_device *dev, int crtc) | ||
5533 | -{ | ||
5534 | - unsigned long irqflags; | ||
5535 | - int ret = 0; | ||
5536 | - | ||
5537 | - spin_lock_irqsave(&dev->vbl_lock, irqflags); | ||
5538 | - /* Going from 0->1 means we have to enable interrupts again */ | ||
5539 | - if (atomic_add_return(1, &dev->vblank_refcount[crtc]) == 1 && | ||
5540 | - !dev->vblank_enabled[crtc]) { | ||
5541 | - ret = dev->driver->enable_vblank(dev, crtc); | ||
5542 | - DRM_DEBUG("enabling vblank on crtc %d, ret: %d\n", crtc, ret); | ||
5543 | - if (ret) | ||
5544 | - atomic_dec(&dev->vblank_refcount[crtc]); | ||
5545 | - else { | ||
5546 | - dev->vblank_enabled[crtc] = 1; | ||
5547 | - drm_update_vblank_count(dev, crtc); | ||
5548 | - } | ||
5549 | - } | ||
5550 | - spin_unlock_irqrestore(&dev->vbl_lock, irqflags); | ||
5551 | - | ||
5552 | - return ret; | ||
5553 | -} | ||
5554 | -EXPORT_SYMBOL(drm_vblank_get); | ||
5555 | - | ||
5556 | -/** | ||
5557 | - * drm_vblank_put - give up ownership of vblank events | ||
5558 | - * @dev: DRM device | ||
5559 | - * @crtc: which counter to give up | ||
5560 | - * | ||
5561 | - * Release ownership of a given vblank counter, turning off interrupts | ||
5562 | - * if possible. | ||
5563 | - */ | ||
5564 | -void drm_vblank_put(struct drm_device *dev, int crtc) | ||
5565 | -{ | ||
5566 | - /* Last user schedules interrupt disable */ | ||
5567 | - if (atomic_dec_and_test(&dev->vblank_refcount[crtc])) | ||
5568 | - mod_timer(&dev->vblank_disable_timer, jiffies + 5*DRM_HZ); | ||
5569 | -} | ||
5570 | -EXPORT_SYMBOL(drm_vblank_put); | ||
5571 | - | ||
5572 | -/** | ||
5573 | - * drm_vblank_pre_modeset - account for vblanks across mode sets | ||
5574 | - * @dev: DRM device | ||
5575 | - * @crtc: CRTC in question | ||
5576 | - * @post: post or pre mode set? | ||
5577 | - * | ||
5578 | - * Account for vblank events across mode setting events, which will likely | ||
5579 | - * reset the hardware frame counter. | ||
5580 | - */ | ||
5581 | -void drm_vblank_pre_modeset(struct drm_device *dev, int crtc) | ||
5582 | -{ | ||
5583 | - /* | ||
5584 | - * To avoid all the problems that might happen if interrupts | ||
5585 | - * were enabled/disabled around or between these calls, we just | ||
5586 | - * have the kernel take a reference on the CRTC (just once though | ||
5587 | - * to avoid corrupting the count if multiple, mismatch calls occur), | ||
5588 | - * so that interrupts remain enabled in the interim. | ||
5589 | - */ | ||
5590 | - if (!dev->vblank_inmodeset[crtc]) { | ||
5591 | - dev->vblank_inmodeset[crtc] = 1; | ||
5592 | - drm_vblank_get(dev, crtc); | ||
5593 | - } | ||
5594 | -} | ||
5595 | -EXPORT_SYMBOL(drm_vblank_pre_modeset); | ||
5596 | - | ||
5597 | -void drm_vblank_post_modeset(struct drm_device *dev, int crtc) | ||
5598 | -{ | ||
5599 | - unsigned long irqflags; | ||
5600 | - | ||
5601 | - if (dev->vblank_inmodeset[crtc]) { | ||
5602 | - spin_lock_irqsave(&dev->vbl_lock, irqflags); | ||
5603 | - dev->vblank_disable_allowed = 1; | ||
5604 | - dev->vblank_inmodeset[crtc] = 0; | ||
5605 | - spin_unlock_irqrestore(&dev->vbl_lock, irqflags); | ||
5606 | - drm_vblank_put(dev, crtc); | ||
5607 | - } | ||
5608 | -} | ||
5609 | -EXPORT_SYMBOL(drm_vblank_post_modeset); | ||
5610 | - | ||
5611 | -/** | ||
5612 | - * drm_modeset_ctl - handle vblank event counter changes across mode switch | ||
5613 | - * @DRM_IOCTL_ARGS: standard ioctl arguments | ||
5614 | - * | ||
5615 | - * Applications should call the %_DRM_PRE_MODESET and %_DRM_POST_MODESET | ||
5616 | - * ioctls around modesetting so that any lost vblank events are accounted for. | ||
5617 | - * | ||
5618 | - * Generally the counter will reset across mode sets. If interrupts are | ||
5619 | - * enabled around this call, we don't have to do anything since the counter | ||
5620 | - * will have already been incremented. | ||
5621 | - */ | ||
5622 | -int drm_modeset_ctl(struct drm_device *dev, void *data, | ||
5623 | - struct drm_file *file_priv) | ||
5624 | -{ | ||
5625 | - struct drm_modeset_ctl *modeset = data; | ||
5626 | - int crtc, ret = 0; | ||
5627 | - | ||
5628 | - /* If drm_vblank_init() hasn't been called yet, just no-op */ | ||
5629 | - if (!dev->num_crtcs) | ||
5630 | - goto out; | ||
5631 | - | ||
5632 | - crtc = modeset->crtc; | ||
5633 | - if (crtc >= dev->num_crtcs) { | ||
5634 | - ret = -EINVAL; | ||
5635 | - goto out; | ||
5636 | - } | ||
5637 | - | ||
5638 | - switch (modeset->cmd) { | ||
5639 | - case _DRM_PRE_MODESET: | ||
5640 | - drm_vblank_pre_modeset(dev, crtc); | ||
5641 | - break; | ||
5642 | - case _DRM_POST_MODESET: | ||
5643 | - drm_vblank_post_modeset(dev, crtc); | ||
5644 | - break; | ||
5645 | - default: | ||
5646 | - ret = -EINVAL; | ||
5647 | - break; | ||
5648 | - } | ||
5649 | - | ||
5650 | -out: | ||
5651 | - return ret; | ||
5652 | -} | ||
5653 | - | ||
5654 | -/** | ||
5655 | * Wait for VBLANK. | ||
5656 | * | ||
5657 | * \param inode device inode. | ||
5658 | @@ -550,14 +362,14 @@ | ||
5659 | * | ||
5660 | * If a signal is not requested, then calls vblank_wait(). | ||
5661 | */ | ||
5662 | -int drm_wait_vblank(struct drm_device *dev, void *data, | ||
5663 | - struct drm_file *file_priv) | ||
5664 | +int drm_wait_vblank(struct drm_device *dev, void *data, struct drm_file *file_priv) | ||
5665 | { | ||
5666 | union drm_wait_vblank *vblwait = data; | ||
5667 | + struct timeval now; | ||
5668 | int ret = 0; | ||
5669 | - unsigned int flags, seq, crtc; | ||
5670 | + unsigned int flags, seq; | ||
5671 | |||
5672 | - if ((!dev->pdev->irq) || (!dev->irq_enabled)) | ||
5673 | + if ((!dev->irq) || (!dev->irq_enabled)) | ||
5674 | return -EINVAL; | ||
5675 | |||
5676 | if (vblwait->request.type & | ||
5677 | @@ -569,17 +381,13 @@ | ||
5678 | } | ||
5679 | |||
5680 | flags = vblwait->request.type & _DRM_VBLANK_FLAGS_MASK; | ||
5681 | - crtc = flags & _DRM_VBLANK_SECONDARY ? 1 : 0; | ||
5682 | |||
5683 | - if (crtc >= dev->num_crtcs) | ||
5684 | + if (!drm_core_check_feature(dev, (flags & _DRM_VBLANK_SECONDARY) ? | ||
5685 | + DRIVER_IRQ_VBL2 : DRIVER_IRQ_VBL)) | ||
5686 | return -EINVAL; | ||
5687 | |||
5688 | - ret = drm_vblank_get(dev, crtc); | ||
5689 | - if (ret) { | ||
5690 | - DRM_ERROR("failed to acquire vblank counter, %d\n", ret); | ||
5691 | - return ret; | ||
5692 | - } | ||
5693 | - seq = drm_vblank_count(dev, crtc); | ||
5694 | + seq = atomic_read((flags & _DRM_VBLANK_SECONDARY) ? &dev->vbl_received2 | ||
5695 | + : &dev->vbl_received); | ||
5696 | |||
5697 | switch (vblwait->request.type & _DRM_VBLANK_TYPES_MASK) { | ||
5698 | case _DRM_VBLANK_RELATIVE: | ||
5699 | @@ -588,8 +396,7 @@ | ||
5700 | case _DRM_VBLANK_ABSOLUTE: | ||
5701 | break; | ||
5702 | default: | ||
5703 | - ret = -EINVAL; | ||
5704 | - goto done; | ||
5705 | + return -EINVAL; | ||
5706 | } | ||
5707 | |||
5708 | if ((flags & _DRM_VBLANK_NEXTONMISS) && | ||
5709 | @@ -599,7 +406,8 @@ | ||
5710 | |||
5711 | if (flags & _DRM_VBLANK_SIGNAL) { | ||
5712 | unsigned long irqflags; | ||
5713 | - struct list_head *vbl_sigs = &dev->vbl_sigs[crtc]; | ||
5714 | + struct list_head *vbl_sigs = (flags & _DRM_VBLANK_SECONDARY) | ||
5715 | + ? &dev->vbl_sigs2 : &dev->vbl_sigs; | ||
5716 | struct drm_vbl_sig *vbl_sig; | ||
5717 | |||
5718 | spin_lock_irqsave(&dev->vbl_lock, irqflags); | ||
5719 | @@ -620,32 +428,22 @@ | ||
5720 | } | ||
5721 | } | ||
5722 | |||
5723 | - if (atomic_read(&dev->vbl_signal_pending) >= 100) { | ||
5724 | + if (dev->vbl_pending >= 100) { | ||
5725 | spin_unlock_irqrestore(&dev->vbl_lock, irqflags); | ||
5726 | - ret = -EBUSY; | ||
5727 | - goto done; | ||
5728 | + return -EBUSY; | ||
5729 | } | ||
5730 | |||
5731 | - spin_unlock_irqrestore(&dev->vbl_lock, irqflags); | ||
5732 | + dev->vbl_pending++; | ||
5733 | |||
5734 | - vbl_sig = drm_calloc(1, sizeof(struct drm_vbl_sig), | ||
5735 | - DRM_MEM_DRIVER); | ||
5736 | - if (!vbl_sig) { | ||
5737 | - ret = -ENOMEM; | ||
5738 | - goto done; | ||
5739 | - } | ||
5740 | + spin_unlock_irqrestore(&dev->vbl_lock, irqflags); | ||
5741 | |||
5742 | - /* Get a refcount on the vblank, which will be released by | ||
5743 | - * drm_vbl_send_signals(). | ||
5744 | - */ | ||
5745 | - ret = drm_vblank_get(dev, crtc); | ||
5746 | - if (ret) { | ||
5747 | - drm_free(vbl_sig, sizeof(struct drm_vbl_sig), | ||
5748 | - DRM_MEM_DRIVER); | ||
5749 | - goto done; | ||
5750 | + if (! | ||
5751 | + (vbl_sig = | ||
5752 | + drm_alloc(sizeof(struct drm_vbl_sig), DRM_MEM_DRIVER))) { | ||
5753 | + return -ENOMEM; | ||
5754 | } | ||
5755 | |||
5756 | - atomic_inc(&dev->vbl_signal_pending); | ||
5757 | + memset((void *)vbl_sig, 0, sizeof(*vbl_sig)); | ||
5758 | |||
5759 | vbl_sig->sequence = vblwait->request.sequence; | ||
5760 | vbl_sig->info.si_signo = vblwait->request.signal; | ||
5761 | @@ -659,31 +457,20 @@ | ||
5762 | |||
5763 | vblwait->reply.sequence = seq; | ||
5764 | } else { | ||
5765 | - DRM_DEBUG("waiting on vblank count %d, crtc %d\n", | ||
5766 | - vblwait->request.sequence, crtc); | ||
5767 | - dev->last_vblank_wait[crtc] = vblwait->request.sequence; | ||
5768 | - DRM_WAIT_ON(ret, dev->vbl_queue[crtc], 3 * DRM_HZ, | ||
5769 | - (((drm_vblank_count(dev, crtc) - | ||
5770 | - vblwait->request.sequence) <= (1 << 23)) || | ||
5771 | - !dev->irq_enabled)); | ||
5772 | - | ||
5773 | - if (ret != -EINTR) { | ||
5774 | - struct timeval now; | ||
5775 | - | ||
5776 | - do_gettimeofday(&now); | ||
5777 | - | ||
5778 | - vblwait->reply.tval_sec = now.tv_sec; | ||
5779 | - vblwait->reply.tval_usec = now.tv_usec; | ||
5780 | - vblwait->reply.sequence = drm_vblank_count(dev, crtc); | ||
5781 | - DRM_DEBUG("returning %d to client\n", | ||
5782 | - vblwait->reply.sequence); | ||
5783 | - } else { | ||
5784 | - DRM_DEBUG("vblank wait interrupted by signal\n"); | ||
5785 | - } | ||
5786 | + if (flags & _DRM_VBLANK_SECONDARY) { | ||
5787 | + if (dev->driver->vblank_wait2) | ||
5788 | + ret = dev->driver->vblank_wait2(dev, &vblwait->request.sequence); | ||
5789 | + } else if (dev->driver->vblank_wait) | ||
5790 | + ret = | ||
5791 | + dev->driver->vblank_wait(dev, | ||
5792 | + &vblwait->request.sequence); | ||
5793 | + | ||
5794 | + do_gettimeofday(&now); | ||
5795 | + vblwait->reply.tval_sec = now.tv_sec; | ||
5796 | + vblwait->reply.tval_usec = now.tv_usec; | ||
5797 | } | ||
5798 | |||
5799 | -done: | ||
5800 | - drm_vblank_put(dev, crtc); | ||
5801 | + done: | ||
5802 | return ret; | ||
5803 | } | ||
5804 | |||
5805 | @@ -691,54 +478,118 @@ | ||
5806 | * Send the VBLANK signals. | ||
5807 | * | ||
5808 | * \param dev DRM device. | ||
5809 | - * \param crtc CRTC where the vblank event occurred | ||
5810 | * | ||
5811 | * Sends a signal for each task in drm_device::vbl_sigs and empties the list. | ||
5812 | * | 5147 | * |
5813 | * If a signal is not requested, then calls vblank_wait(). | 5148 | * If a signal is not requested, then calls vblank_wait(). |
5814 | */ | 5149 | */ |
5815 | -static void drm_vbl_send_signals(struct drm_device *dev, int crtc) | 5150 | -static void drm_vbl_send_signals(struct drm_device *dev, int crtc) |
5816 | +void drm_vbl_send_signals(struct drm_device * dev) | 5151 | +void drm_vbl_send_signals(struct drm_device *dev, int crtc) |
5817 | { | 5152 | { |
5818 | - struct drm_vbl_sig *vbl_sig, *tmp; | 5153 | struct drm_vbl_sig *vbl_sig, *tmp; |
5819 | - struct list_head *vbl_sigs; | 5154 | struct list_head *vbl_sigs; |
5820 | - unsigned int vbl_seq; | 5155 | @@ -726,6 +727,7 @@ |
5821 | unsigned long flags; | ||
5822 | + int i; | ||
5823 | |||
5824 | spin_lock_irqsave(&dev->vbl_lock, flags); | ||
5825 | |||
5826 | - vbl_sigs = &dev->vbl_sigs[crtc]; | ||
5827 | - vbl_seq = drm_vblank_count(dev, crtc); | ||
5828 | + for (i = 0; i < 2; i++) { | ||
5829 | + struct drm_vbl_sig *vbl_sig, *tmp; | ||
5830 | + struct list_head *vbl_sigs = i ? &dev->vbl_sigs2 : &dev->vbl_sigs; | ||
5831 | + unsigned int vbl_seq = atomic_read(i ? &dev->vbl_received2 : | ||
5832 | + &dev->vbl_received); | ||
5833 | + | ||
5834 | + list_for_each_entry_safe(vbl_sig, tmp, vbl_sigs, head) { | ||
5835 | + if ((vbl_seq - vbl_sig->sequence) <= (1 << 23)) { | ||
5836 | + vbl_sig->info.si_code = vbl_seq; | ||
5837 | + send_sig_info(vbl_sig->info.si_signo, | ||
5838 | + &vbl_sig->info, vbl_sig->task); | ||
5839 | |||
5840 | - list_for_each_entry_safe(vbl_sig, tmp, vbl_sigs, head) { | ||
5841 | - if ((vbl_seq - vbl_sig->sequence) <= (1 << 23)) { | ||
5842 | - vbl_sig->info.si_code = vbl_seq; | ||
5843 | - send_sig_info(vbl_sig->info.si_signo, | ||
5844 | - &vbl_sig->info, vbl_sig->task); | ||
5845 | - | ||
5846 | - list_del(&vbl_sig->head); | ||
5847 | - | ||
5848 | - drm_free(vbl_sig, sizeof(*vbl_sig), | ||
5849 | - DRM_MEM_DRIVER); | ||
5850 | - atomic_dec(&dev->vbl_signal_pending); | ||
5851 | - drm_vblank_put(dev, crtc); | ||
5852 | - } | ||
5853 | + list_del(&vbl_sig->head); | ||
5854 | + | ||
5855 | + drm_free(vbl_sig, sizeof(*vbl_sig), | ||
5856 | + DRM_MEM_DRIVER); | ||
5857 | + | ||
5858 | + dev->vbl_pending--; | ||
5859 | + } | ||
5860 | + } | ||
5861 | } | ||
5862 | 5156 | ||
5863 | spin_unlock_irqrestore(&dev->vbl_lock, flags); | 5157 | spin_unlock_irqrestore(&dev->vbl_lock, flags); |
5864 | } | 5158 | } |
5865 | +EXPORT_SYMBOL(drm_vbl_send_signals); | 5159 | +EXPORT_SYMBOL(drm_vbl_send_signals); |
5866 | 5160 | ||
5867 | /** | 5161 | /** |
5868 | - * drm_handle_vblank - handle a vblank event | 5162 | * drm_handle_vblank - handle a vblank event |
5869 | - * @dev: DRM device | ||
5870 | - * @crtc: where this event occurred | ||
5871 | + * Tasklet wrapper function. | ||
5872 | * | ||
5873 | - * Drivers should call this routine in their vblank interrupt handlers to | ||
5874 | - * update the vblank counter and send any signals that may be pending. | ||
5875 | + * \param data DRM device in disguise. | ||
5876 | + * | ||
5877 | + * Attempts to grab the HW lock and calls the driver callback on success. On | ||
5878 | + * failure, leave the lock marked as contended so the callback can be called | ||
5879 | + * from drm_unlock(). | ||
5880 | */ | ||
5881 | -void drm_handle_vblank(struct drm_device *dev, int crtc) | ||
5882 | +static void drm_locked_tasklet_func(unsigned long data) | ||
5883 | { | ||
5884 | - atomic_inc(&dev->_vblank_count[crtc]); | ||
5885 | - DRM_WAKEUP(&dev->vbl_queue[crtc]); | ||
5886 | - drm_vbl_send_signals(dev, crtc); | ||
5887 | + struct drm_device *dev = (struct drm_device *)data; | ||
5888 | + unsigned long irqflags; | ||
5889 | + void (*tasklet_func)(struct drm_device *); | ||
5890 | + | ||
5891 | + spin_lock_irqsave(&dev->tasklet_lock, irqflags); | ||
5892 | + tasklet_func = dev->locked_tasklet_func; | ||
5893 | + spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); | ||
5894 | + | ||
5895 | + if (!tasklet_func || | ||
5896 | + !drm_lock_take(&dev->lock, | ||
5897 | + DRM_KERNEL_CONTEXT)) { | ||
5898 | + return; | ||
5899 | + } | ||
5900 | + | ||
5901 | + dev->lock.lock_time = jiffies; | ||
5902 | + atomic_inc(&dev->counts[_DRM_STAT_LOCKS]); | ||
5903 | + | ||
5904 | + spin_lock_irqsave(&dev->tasklet_lock, irqflags); | ||
5905 | + tasklet_func = dev->locked_tasklet_func; | ||
5906 | + dev->locked_tasklet_func = NULL; | ||
5907 | + spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); | ||
5908 | + | ||
5909 | + if (tasklet_func != NULL) | ||
5910 | + tasklet_func(dev); | ||
5911 | + | ||
5912 | + drm_lock_free(&dev->lock, | ||
5913 | + DRM_KERNEL_CONTEXT); | ||
5914 | +} | ||
5915 | + | ||
5916 | +/** | ||
5917 | + * Schedule a tasklet to call back a driver hook with the HW lock held. | ||
5918 | + * | ||
5919 | + * \param dev DRM device. | ||
5920 | + * \param func Driver callback. | ||
5921 | + * | ||
5922 | + * This is intended for triggering actions that require the HW lock from an | ||
5923 | + * interrupt handler. The lock will be grabbed ASAP after the interrupt handler | ||
5924 | + * completes. Note that the callback may be called from interrupt or process | ||
5925 | + * context, it must not make any assumptions about this. Also, the HW lock will | ||
5926 | + * be held with the kernel context or any client context. | ||
5927 | + */ | ||
5928 | +void drm_locked_tasklet(struct drm_device *dev, void (*func)(struct drm_device *)) | ||
5929 | +{ | ||
5930 | + unsigned long irqflags; | ||
5931 | + static DECLARE_TASKLET(drm_tasklet, drm_locked_tasklet_func, 0); | ||
5932 | + | ||
5933 | + if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ) || | ||
5934 | + test_bit(TASKLET_STATE_SCHED, &drm_tasklet.state)) | ||
5935 | + return; | ||
5936 | + | ||
5937 | + spin_lock_irqsave(&dev->tasklet_lock, irqflags); | ||
5938 | + | ||
5939 | + if (dev->locked_tasklet_func) { | ||
5940 | + spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); | ||
5941 | + return; | ||
5942 | + } | ||
5943 | + | ||
5944 | + dev->locked_tasklet_func = func; | ||
5945 | + | ||
5946 | + spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); | ||
5947 | + | ||
5948 | + drm_tasklet.data = (unsigned long)dev; | ||
5949 | + | ||
5950 | + tasklet_hi_schedule(&drm_tasklet); | ||
5951 | } | ||
5952 | -EXPORT_SYMBOL(drm_handle_vblank); | ||
5953 | +EXPORT_SYMBOL(drm_locked_tasklet); | ||
5954 | Index: linux-2.6.28/drivers/gpu/drm/drm_object.c | 5163 | Index: linux-2.6.28/drivers/gpu/drm/drm_object.c |
5955 | =================================================================== | 5164 | =================================================================== |
5956 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 5165 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
5957 | +++ linux-2.6.28/drivers/gpu/drm/drm_object.c 2009-02-12 09:14:41.000000000 +0000 | 5166 | +++ linux-2.6.28/drivers/gpu/drm/drm_object.c 2009-02-20 12:23:06.000000000 +0000 |
5958 | @@ -0,0 +1,294 @@ | 5167 | @@ -0,0 +1,294 @@ |
5959 | +/************************************************************************** | 5168 | +/************************************************************************** |
5960 | + * | 5169 | + * |
@@ -6253,7 +5462,7 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_object.c | |||
6253 | Index: linux-2.6.28/drivers/gpu/drm/drm_regman.c | 5462 | Index: linux-2.6.28/drivers/gpu/drm/drm_regman.c |
6254 | =================================================================== | 5463 | =================================================================== |
6255 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 5464 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
6256 | +++ linux-2.6.28/drivers/gpu/drm/drm_regman.c 2009-02-12 09:14:41.000000000 +0000 | 5465 | +++ linux-2.6.28/drivers/gpu/drm/drm_regman.c 2009-02-20 12:23:06.000000000 +0000 |
6257 | @@ -0,0 +1,200 @@ | 5466 | @@ -0,0 +1,200 @@ |
6258 | +/************************************************************************** | 5467 | +/************************************************************************** |
6259 | + * Copyright (c) 2007 Tungsten Graphics, Inc., Cedar Park, TX., USA | 5468 | + * Copyright (c) 2007 Tungsten Graphics, Inc., Cedar Park, TX., USA |
@@ -6457,8 +5666,8 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_regman.c | |||
6457 | +EXPORT_SYMBOL(drm_regs_init); | 5666 | +EXPORT_SYMBOL(drm_regs_init); |
6458 | Index: linux-2.6.28/drivers/gpu/drm/drm_stub.c | 5667 | Index: linux-2.6.28/drivers/gpu/drm/drm_stub.c |
6459 | =================================================================== | 5668 | =================================================================== |
6460 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_stub.c 2009-02-12 09:14:37.000000000 +0000 | 5669 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_stub.c 2009-02-20 12:22:53.000000000 +0000 |
6461 | +++ linux-2.6.28/drivers/gpu/drm/drm_stub.c 2009-02-12 09:14:41.000000000 +0000 | 5670 | +++ linux-2.6.28/drivers/gpu/drm/drm_stub.c 2009-02-20 12:33:16.000000000 +0000 |
6462 | @@ -201,6 +201,7 @@ | 5671 | @@ -201,6 +201,7 @@ |
6463 | init_timer(&dev->timer); | 5672 | init_timer(&dev->timer); |
6464 | mutex_init(&dev->struct_mutex); | 5673 | mutex_init(&dev->struct_mutex); |
@@ -6486,38 +5695,15 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_stub.c | |||
6486 | /* the DRM has 6 basic counters */ | 5695 | /* the DRM has 6 basic counters */ |
6487 | dev->counters = 6; | 5696 | dev->counters = 6; |
6488 | dev->types[0] = _DRM_STAT_LOCK; | 5697 | dev->types[0] = _DRM_STAT_LOCK; |
6489 | @@ -252,15 +265,7 @@ | 5698 | @@ -261,6 +274,7 @@ |
6490 | goto error_out_unreg; | 5699 | } |
6491 | } | 5700 | } |
6492 | 5701 | ||
6493 | - if (driver->driver_features & DRIVER_GEM) { | ||
6494 | - retcode = drm_gem_init(dev); | ||
6495 | - if (retcode) { | ||
6496 | - DRM_ERROR("Cannot initialize graphics execution " | ||
6497 | - "manager (GEM)\n"); | ||
6498 | - goto error_out_unreg; | ||
6499 | - } | ||
6500 | - } | ||
6501 | - | ||
6502 | + drm_fence_manager_init(dev); | 5702 | + drm_fence_manager_init(dev); |
6503 | return 0; | 5703 | return 0; |
6504 | 5704 | ||
6505 | error_out_unreg: | 5705 | error_out_unreg: |
6506 | @@ -386,13 +391,6 @@ | 5706 | @@ -409,6 +423,8 @@ |
6507 | goto err_g3; | ||
6508 | } | ||
6509 | |||
6510 | - /* setup the grouping for the legacy output */ | ||
6511 | - if (drm_core_check_feature(dev, DRIVER_MODESET)) { | ||
6512 | - ret = drm_mode_group_init_legacy_group(dev, &dev->primary->mode_group); | ||
6513 | - if (ret) | ||
6514 | - goto err_g3; | ||
6515 | - } | ||
6516 | - | ||
6517 | list_add_tail(&dev->driver_item, &driver->device_list); | ||
6518 | |||
6519 | DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", | ||
6520 | @@ -409,6 +407,8 @@ | ||
6521 | drm_free(dev, sizeof(*dev), DRM_MEM_STUB); | 5707 | drm_free(dev, sizeof(*dev), DRM_MEM_STUB); |
6522 | return ret; | 5708 | return ret; |
6523 | } | 5709 | } |
@@ -6529,7 +5715,7 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_stub.c | |||
6529 | Index: linux-2.6.28/drivers/gpu/drm/drm_ttm.c | 5715 | Index: linux-2.6.28/drivers/gpu/drm/drm_ttm.c |
6530 | =================================================================== | 5716 | =================================================================== |
6531 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 5717 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
6532 | +++ linux-2.6.28/drivers/gpu/drm/drm_ttm.c 2009-02-12 09:14:41.000000000 +0000 | 5718 | +++ linux-2.6.28/drivers/gpu/drm/drm_ttm.c 2009-02-20 12:23:06.000000000 +0000 |
6533 | @@ -0,0 +1,430 @@ | 5719 | @@ -0,0 +1,430 @@ |
6534 | +/************************************************************************** | 5720 | +/************************************************************************** |
6535 | + * | 5721 | + * |
@@ -6963,8 +6149,8 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_ttm.c | |||
6963 | +EXPORT_SYMBOL(drm_bind_ttm); | 6149 | +EXPORT_SYMBOL(drm_bind_ttm); |
6964 | Index: linux-2.6.28/drivers/gpu/drm/drm_vm.c | 6150 | Index: linux-2.6.28/drivers/gpu/drm/drm_vm.c |
6965 | =================================================================== | 6151 | =================================================================== |
6966 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_vm.c 2009-02-12 09:14:37.000000000 +0000 | 6152 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_vm.c 2009-02-20 12:22:53.000000000 +0000 |
6967 | +++ linux-2.6.28/drivers/gpu/drm/drm_vm.c 2009-02-12 09:14:41.000000000 +0000 | 6153 | +++ linux-2.6.28/drivers/gpu/drm/drm_vm.c 2009-02-20 12:23:06.000000000 +0000 |
6968 | @@ -40,6 +40,10 @@ | 6154 | @@ -40,6 +40,10 @@ |
6969 | 6155 | ||
6970 | static void drm_vm_open(struct vm_area_struct *vma); | 6156 | static void drm_vm_open(struct vm_area_struct *vma); |
@@ -7212,7 +6398,7 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_vm.c | |||
7212 | Index: linux-2.6.28/drivers/gpu/drm/psb/Makefile | 6398 | Index: linux-2.6.28/drivers/gpu/drm/psb/Makefile |
7213 | =================================================================== | 6399 | =================================================================== |
7214 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 6400 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
7215 | +++ linux-2.6.28/drivers/gpu/drm/psb/Makefile 2009-02-12 09:14:41.000000000 +0000 | 6401 | +++ linux-2.6.28/drivers/gpu/drm/psb/Makefile 2009-02-20 14:48:03.000000000 +0000 |
7216 | @@ -0,0 +1,12 @@ | 6402 | @@ -0,0 +1,12 @@ |
7217 | +# | 6403 | +# |
7218 | +# Makefile for the drm device driver. This driver provides support for the | 6404 | +# Makefile for the drm device driver. This driver provides support for the |
@@ -7221,7 +6407,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/Makefile | |||
7221 | +ccflags-y := -Iinclude/drm | 6407 | +ccflags-y := -Iinclude/drm |
7222 | + | 6408 | + |
7223 | +psb-y := psb_drv.o psb_mmu.o psb_sgx.o psb_irq.o psb_fence.o psb_buffer.o \ | 6409 | +psb-y := psb_drv.o psb_mmu.o psb_sgx.o psb_irq.o psb_fence.o psb_buffer.o \ |
7224 | + psb_gtt.o psb_setup.o psb_i2c.o psb_fb.o psb_msvdx.o \ | 6410 | + psb_gtt.o psb_fb.o psb_msvdx.o \ |
7225 | + psb_msvdxinit.o psb_regman.o psb_reset.o psb_scene.o \ | 6411 | + psb_msvdxinit.o psb_regman.o psb_reset.o psb_scene.o \ |
7226 | + psb_schedule.o psb_xhw.o | 6412 | + psb_schedule.o psb_xhw.o |
7227 | + | 6413 | + |
@@ -7229,7 +6415,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/Makefile | |||
7229 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_buffer.c | 6415 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_buffer.c |
7230 | =================================================================== | 6416 | =================================================================== |
7231 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 6417 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
7232 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_buffer.c 2009-02-12 09:14:41.000000000 +0000 | 6418 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_buffer.c 2009-02-20 12:23:06.000000000 +0000 |
7233 | @@ -0,0 +1,437 @@ | 6419 | @@ -0,0 +1,437 @@ |
7234 | +/************************************************************************** | 6420 | +/************************************************************************** |
7235 | + * Copyright (c) 2007, Intel Corporation. | 6421 | + * Copyright (c) 2007, Intel Corporation. |
@@ -7671,7 +6857,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_buffer.c | |||
7671 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drm.h | 6857 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drm.h |
7672 | =================================================================== | 6858 | =================================================================== |
7673 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 6859 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
7674 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_drm.h 2009-02-12 09:14:41.000000000 +0000 | 6860 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_drm.h 2009-02-20 12:23:06.000000000 +0000 |
7675 | @@ -0,0 +1,370 @@ | 6861 | @@ -0,0 +1,370 @@ |
7676 | +/************************************************************************** | 6862 | +/************************************************************************** |
7677 | + * Copyright (c) 2007, Intel Corporation. | 6863 | + * Copyright (c) 2007, Intel Corporation. |
@@ -8046,8 +7232,8 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drm.h | |||
8046 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.c | 7232 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.c |
8047 | =================================================================== | 7233 | =================================================================== |
8048 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 7234 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
8049 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_drv.c 2009-02-12 10:11:59.000000000 +0000 | 7235 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_drv.c 2009-02-20 14:48:16.000000000 +0000 |
8050 | @@ -0,0 +1,1096 @@ | 7236 | @@ -0,0 +1,1028 @@ |
8051 | +/************************************************************************** | 7237 | +/************************************************************************** |
8052 | + * Copyright (c) 2007, Intel Corporation. | 7238 | + * Copyright (c) 2007, Intel Corporation. |
8053 | + * All Rights Reserved. | 7239 | + * All Rights Reserved. |
@@ -8098,13 +7284,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.c | |||
8098 | +int drm_psb_no_fb = 0; | 7284 | +int drm_psb_no_fb = 0; |
8099 | +int drm_psb_force_pipeb = 0; | 7285 | +int drm_psb_force_pipeb = 0; |
8100 | +char* psb_init_mode; | 7286 | +char* psb_init_mode; |
8101 | +/* | 7287 | + |
8102 | + * | ||
8103 | + */ | ||
8104 | +#define SII_1392_WA | ||
8105 | +#ifdef SII_1392_WA | ||
8106 | +extern int SII_1392; | ||
8107 | +#endif | ||
8108 | + | 7288 | + |
8109 | +MODULE_PARM_DESC(debug, "Enable debug output"); | 7289 | +MODULE_PARM_DESC(debug, "Enable debug output"); |
8110 | +MODULE_PARM_DESC(clock_gating, "clock gating"); | 7290 | +MODULE_PARM_DESC(clock_gating, "clock gating"); |
@@ -8160,24 +7340,6 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.c | |||
8160 | + | 7340 | + |
8161 | +static int probe(struct pci_dev *pdev, const struct pci_device_id *ent); | 7341 | +static int probe(struct pci_dev *pdev, const struct pci_device_id *ent); |
8162 | + | 7342 | + |
8163 | +#ifdef USE_PAT_WC | ||
8164 | +#warning Init pat | ||
8165 | +static int __cpuinit psb_cpu_callback(struct notifier_block *nfb, | ||
8166 | + unsigned long action, | ||
8167 | + void *hcpu) | ||
8168 | +{ | ||
8169 | + if (action == CPU_ONLINE) | ||
8170 | + drm_init_pat(); | ||
8171 | + | ||
8172 | + return 0; | ||
8173 | +} | ||
8174 | + | ||
8175 | +static struct notifier_block __cpuinitdata psb_nb = { | ||
8176 | + .notifier_call = psb_cpu_callback, | ||
8177 | + .priority = 1 | ||
8178 | +}; | ||
8179 | +#endif | ||
8180 | + | ||
8181 | +static int dri_library_name(struct drm_device *dev, char *buf) | 7343 | +static int dri_library_name(struct drm_device *dev, char *buf) |
8182 | +{ | 7344 | +{ |
8183 | + return snprintf(buf, PAGE_SIZE, "psb\n"); | 7345 | + return snprintf(buf, PAGE_SIZE, "psb\n"); |
@@ -8298,6 +7460,31 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.c | |||
8298 | + (void)PSB_RSGX32(PSB_CR_CLKGATECTL); | 7460 | + (void)PSB_RSGX32(PSB_CR_CLKGATECTL); |
8299 | +} | 7461 | +} |
8300 | + | 7462 | + |
7463 | +static int psb_master_create(struct drm_device *dev, struct drm_master *master) | ||
7464 | +{ | ||
7465 | + struct drm_i915_master_private *master_priv; | ||
7466 | + | ||
7467 | + master_priv = drm_calloc(1, sizeof(*master_priv), DRM_MEM_DRIVER); | ||
7468 | + if (!master_priv) | ||
7469 | + return -ENOMEM; | ||
7470 | + | ||
7471 | + master->driver_priv = master_priv; | ||
7472 | + return 0; | ||
7473 | +} | ||
7474 | + | ||
7475 | +static void psb_master_destroy(struct drm_device *dev, struct drm_master *master) | ||
7476 | +{ | ||
7477 | + struct drm_i915_master_private *master_priv = master->driver_priv; | ||
7478 | + | ||
7479 | + if (!master_priv) | ||
7480 | + return; | ||
7481 | + | ||
7482 | + drm_free(master_priv, sizeof(*master_priv), DRM_MEM_DRIVER); | ||
7483 | + | ||
7484 | + master->driver_priv = NULL; | ||
7485 | +} | ||
7486 | + | ||
7487 | + | ||
8301 | +static int psb_do_init(struct drm_device *dev) | 7488 | +static int psb_do_init(struct drm_device *dev) |
8302 | +{ | 7489 | +{ |
8303 | + struct drm_psb_private *dev_priv = | 7490 | + struct drm_psb_private *dev_priv = |
@@ -8478,9 +7665,9 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.c | |||
8478 | + dev_priv->scratch_page = NULL; | 7665 | + dev_priv->scratch_page = NULL; |
8479 | + } | 7666 | + } |
8480 | + psb_takedown_use_base(dev_priv); | 7667 | + psb_takedown_use_base(dev_priv); |
8481 | + if (dev_priv->vdc_reg) { | 7668 | + if (dev_priv->common.regs) { |
8482 | + iounmap(dev_priv->vdc_reg); | 7669 | + iounmap(dev_priv->common.regs); |
8483 | + dev_priv->vdc_reg = NULL; | 7670 | + dev_priv->common.regs = NULL; |
8484 | + } | 7671 | + } |
8485 | + if (dev_priv->sgx_reg) { | 7672 | + if (dev_priv->sgx_reg) { |
8486 | + iounmap(dev_priv->sgx_reg); | 7673 | + iounmap(dev_priv->sgx_reg); |
@@ -8497,64 +7684,6 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.c | |||
8497 | + return 0; | 7684 | + return 0; |
8498 | +} | 7685 | +} |
8499 | + | 7686 | + |
8500 | + | ||
8501 | +extern int drm_pick_crtcs(struct drm_device *dev); | ||
8502 | +extern char drm_init_mode[32]; | ||
8503 | + | ||
8504 | +static int psb_initial_config(struct drm_device *dev, bool can_grow) | ||
8505 | +{ | ||
8506 | + struct drm_psb_private *dev_priv = dev->dev_private; | ||
8507 | + struct drm_connector *output; | ||
8508 | + struct drm_crtc *crtc; | ||
8509 | + int ret = false; | ||
8510 | + | ||
8511 | + mutex_lock(&dev->mode_config.mutex); | ||
8512 | + | ||
8513 | + drm_helper_probe_connector_modes(dev, 2048, 2048); | ||
8514 | + | ||
8515 | + /* strncpy(drm_init_mode, psb_init_mode, strlen(psb_init_mode)); */ | ||
8516 | + | ||
8517 | + drm_pick_crtcs(dev); | ||
8518 | + | ||
8519 | + if ((I915_READ(PIPEACONF) & PIPEACONF_ENABLE) && !drm_psb_force_pipeb) | ||
8520 | + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | ||
8521 | + if (!crtc->desired_mode) | ||
8522 | + continue; | ||
8523 | + | ||
8524 | + dev->driver->fb_probe(dev, crtc); | ||
8525 | + } else | ||
8526 | + list_for_each_entry_reverse(crtc, &dev->mode_config.crtc_list, | ||
8527 | + head) { | ||
8528 | + if (!crtc->desired_mode) | ||
8529 | + continue; | ||
8530 | + | ||
8531 | + dev->driver->fb_probe(dev, crtc); | ||
8532 | + } | ||
8533 | + | ||
8534 | + list_for_each_entry(output, &dev->mode_config.connector_list, head) { | ||
8535 | + | ||
8536 | + if (!output->encoder->crtc || !output->encoder->crtc->desired_mode) | ||
8537 | + continue; | ||
8538 | + | ||
8539 | + if (output->encoder->crtc->fb) | ||
8540 | + drm_crtc_helper_set_mode(output->encoder->crtc, | ||
8541 | + output->encoder->crtc->desired_mode, 0, 0, NULL); | ||
8542 | + } | ||
8543 | + | ||
8544 | +#ifdef SII_1392_WA | ||
8545 | + if((SII_1392 != 1) || (drm_psb_no_fb==0)) | ||
8546 | + drm_helper_disable_unused_functions(dev); | ||
8547 | +#else | ||
8548 | + drm_helper_disable_unused_functions(dev); | ||
8549 | +#endif | ||
8550 | + | ||
8551 | + | ||
8552 | + mutex_unlock(&dev->mode_config.mutex); | ||
8553 | + | ||
8554 | + return ret; | ||
8555 | + | ||
8556 | +} | ||
8557 | + | ||
8558 | +static void psb_user_framebuffer_destroy(struct drm_framebuffer *fb) | 7687 | +static void psb_user_framebuffer_destroy(struct drm_framebuffer *fb) |
8559 | +{ | 7688 | +{ |
8560 | + struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); | 7689 | + struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); |
@@ -8695,9 +7824,9 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.c | |||
8695 | + if (!dev_priv->msvdx_reg) | 7824 | + if (!dev_priv->msvdx_reg) |
8696 | + goto out_err; | 7825 | + goto out_err; |
8697 | + | 7826 | + |
8698 | + dev_priv->vdc_reg = | 7827 | + dev_priv->common.regs = |
8699 | + ioremap(resource_start + PSB_VDC_OFFSET, PSB_VDC_SIZE); | 7828 | + ioremap(resource_start + PSB_VDC_OFFSET, PSB_VDC_SIZE); |
8700 | + if (!dev_priv->vdc_reg) | 7829 | + if (!dev_priv->common.regs) |
8701 | + goto out_err; | 7830 | + goto out_err; |
8702 | + | 7831 | + |
8703 | + dev_priv->sgx_reg = | 7832 | + dev_priv->sgx_reg = |
@@ -8797,12 +7926,6 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.c | |||
8797 | + | 7926 | + |
8798 | + drm_helper_initial_config(dev, false); | 7927 | + drm_helper_initial_config(dev, false); |
8799 | + | 7928 | + |
8800 | + | ||
8801 | +#ifdef USE_PAT_WC | ||
8802 | +#warning Init pat | ||
8803 | + register_cpu_notifier(&psb_nb); | ||
8804 | +#endif | ||
8805 | + | ||
8806 | + return 0; | 7929 | + return 0; |
8807 | + out_err: | 7930 | + out_err: |
8808 | + psb_driver_unload(dev); | 7931 | + psb_driver_unload(dev); |
@@ -8913,14 +8036,6 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.c | |||
8913 | + if (ret) | 8036 | + if (ret) |
8914 | + return ret; | 8037 | + return ret; |
8915 | + | 8038 | + |
8916 | +#ifdef USE_PAT_WC | ||
8917 | +#warning Init pat | ||
8918 | + /* for single CPU's we do it here, then for more than one CPU we | ||
8919 | + * use the CPU notifier to reinit PAT on those CPU's. | ||
8920 | + */ | ||
8921 | + drm_init_pat(); | ||
8922 | +#endif | ||
8923 | + | ||
8924 | + INIT_LIST_HEAD(&dev_priv->resume_buf.head); | 8039 | + INIT_LIST_HEAD(&dev_priv->resume_buf.head); |
8925 | + dev_priv->msvdx_needs_reset = 1; | 8040 | + dev_priv->msvdx_needs_reset = 1; |
8926 | + | 8041 | + |
@@ -9084,12 +8199,15 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.c | |||
9084 | + .get_reg_ofs = drm_core_get_reg_ofs, | 8199 | + .get_reg_ofs = drm_core_get_reg_ofs, |
9085 | + .ioctls = psb_ioctls, | 8200 | + .ioctls = psb_ioctls, |
9086 | + .device_is_agp = psb_driver_device_is_agp, | 8201 | + .device_is_agp = psb_driver_device_is_agp, |
9087 | + .vblank_wait = psb_vblank_wait, | 8202 | + .get_vblank_counter = psb_get_vblank_counter, |
9088 | + .vblank_wait2 = psb_vblank_wait2, | 8203 | + .enable_vblank = psb_enable_vblank, |
8204 | + .disable_vblank = psb_disable_vblank, | ||
9089 | + .irq_preinstall = psb_irq_preinstall, | 8205 | + .irq_preinstall = psb_irq_preinstall, |
9090 | + .irq_postinstall = psb_irq_postinstall, | 8206 | + .irq_postinstall = psb_irq_postinstall, |
9091 | + .irq_uninstall = psb_irq_uninstall, | 8207 | + .irq_uninstall = psb_irq_uninstall, |
9092 | + .irq_handler = psb_irq_handler, | 8208 | + .irq_handler = psb_irq_handler, |
8209 | + .master_create = psb_master_create, | ||
8210 | + .master_destroy = psb_master_destroy, | ||
9093 | + .fb_probe = psbfb_probe, | 8211 | + .fb_probe = psbfb_probe, |
9094 | + .fb_remove = psbfb_remove, | 8212 | + .fb_remove = psbfb_remove, |
9095 | + .firstopen = NULL, | 8213 | + .firstopen = NULL, |
@@ -9147,7 +8265,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.c | |||
9147 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.h | 8265 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.h |
9148 | =================================================================== | 8266 | =================================================================== |
9149 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 8267 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
9150 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_drv.h 2009-02-12 10:10:55.000000000 +0000 | 8268 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_drv.h 2009-02-20 12:23:06.000000000 +0000 |
9151 | @@ -0,0 +1,549 @@ | 8269 | @@ -0,0 +1,549 @@ |
9152 | +/************************************************************************** | 8270 | +/************************************************************************** |
9153 | + * Copyright (c) 2007, Intel Corporation. | 8271 | + * Copyright (c) 2007, Intel Corporation. |
@@ -9297,10 +8415,8 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.h | |||
9297 | +#define VCLK_DIVISOR_VGA1 0x6004 | 8415 | +#define VCLK_DIVISOR_VGA1 0x6004 |
9298 | +#define VCLK_POST_DIV 0x6010 | 8416 | +#define VCLK_POST_DIV 0x6010 |
9299 | + | 8417 | + |
9300 | +#define I915_WRITE(_offs, _val) \ | 8418 | +#define I915_READ(reg) readl(dev_priv->common.regs + (reg)) |
9301 | + iowrite32(_val, dev_priv->vdc_reg + (_offs)) | 8419 | +#define I915_WRITE(reg, val) writel(val, dev_priv->common.regs + (reg)) |
9302 | +#define I915_READ(_offs) \ | ||
9303 | + ioread32(dev_priv->vdc_reg + (_offs)) | ||
9304 | + | 8420 | + |
9305 | +#define PSB_COMM_2D (PSB_ENGINE_2D << 4) | 8421 | +#define PSB_COMM_2D (PSB_ENGINE_2D << 4) |
9306 | +#define PSB_COMM_3D (PSB_ENGINE_3D << 4) | 8422 | +#define PSB_COMM_3D (PSB_ENGINE_3D << 4) |
@@ -9453,12 +8569,13 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.h | |||
9453 | + * psb_irq.c | 8569 | + * psb_irq.c |
9454 | + */ | 8570 | + */ |
9455 | + | 8571 | + |
8572 | +extern u32 psb_get_vblank_counter(struct drm_device *dev, int pipe); | ||
8573 | +extern int psb_enable_vblank(struct drm_device *dev, int crtc); | ||
8574 | +extern void psb_disable_vblank(struct drm_device *dev, int crtc); | ||
9456 | +extern irqreturn_t psb_irq_handler(DRM_IRQ_ARGS); | 8575 | +extern irqreturn_t psb_irq_handler(DRM_IRQ_ARGS); |
9457 | +extern void psb_irq_preinstall(struct drm_device *dev); | 8576 | +extern void psb_irq_preinstall(struct drm_device *dev); |
9458 | +extern int psb_irq_postinstall(struct drm_device *dev); | 8577 | +extern int psb_irq_postinstall(struct drm_device *dev); |
9459 | +extern void psb_irq_uninstall(struct drm_device *dev); | 8578 | +extern void psb_irq_uninstall(struct drm_device *dev); |
9460 | +extern int psb_vblank_wait2(struct drm_device *dev, unsigned int *sequence); | ||
9461 | +extern int psb_vblank_wait(struct drm_device *dev, unsigned int *sequence); | ||
9462 | + | 8579 | + |
9463 | +/* | 8580 | +/* |
9464 | + * psb_fence.c | 8581 | + * psb_fence.c |
@@ -9613,6 +8730,8 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.h | |||
9613 | +extern void psb_xhw_clean_buf(struct drm_psb_private *dev_priv, | 8730 | +extern void psb_xhw_clean_buf(struct drm_psb_private *dev_priv, |
9614 | + struct psb_xhw_buf *buf); | 8731 | + struct psb_xhw_buf *buf); |
9615 | + | 8732 | + |
8733 | +extern void psb_i2c_init(struct drm_psb_private *dev_priv); | ||
8734 | + | ||
9616 | +/* | 8735 | +/* |
9617 | + * psb_schedule.c: HW bug fixing. | 8736 | + * psb_schedule.c: HW bug fixing. |
9618 | + */ | 8737 | + */ |
@@ -9634,12 +8753,11 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.h | |||
9634 | + * Utilities | 8753 | + * Utilities |
9635 | + */ | 8754 | + */ |
9636 | + | 8755 | + |
8756 | +#define PSB_WVDC32(_val, _offs) I915_WRITE(_offs, _val) | ||
8757 | +#define PSB_RVDC32(_offs) I915_READ(_offs) | ||
8758 | + | ||
9637 | +#define PSB_ALIGN_TO(_val, _align) \ | 8759 | +#define PSB_ALIGN_TO(_val, _align) \ |
9638 | + (((_val) + ((_align) - 1)) & ~((_align) - 1)) | 8760 | + (((_val) + ((_align) - 1)) & ~((_align) - 1)) |
9639 | +#define PSB_WVDC32(_val, _offs) \ | ||
9640 | + iowrite32(_val, dev_priv->vdc_reg + (_offs)) | ||
9641 | +#define PSB_RVDC32(_offs) \ | ||
9642 | + ioread32(dev_priv->vdc_reg + (_offs)) | ||
9643 | +#define PSB_WSGX32(_val, _offs) \ | 8761 | +#define PSB_WSGX32(_val, _offs) \ |
9644 | + iowrite32(_val, dev_priv->sgx_reg + (_offs)) | 8762 | + iowrite32(_val, dev_priv->sgx_reg + (_offs)) |
9645 | +#define PSB_RSGX32(_offs) \ | 8763 | +#define PSB_RSGX32(_offs) \ |
@@ -9701,8 +8819,8 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_drv.h | |||
9701 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c | 8819 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c |
9702 | =================================================================== | 8820 | =================================================================== |
9703 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 8821 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
9704 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c 2009-02-12 09:14:41.000000000 +0000 | 8822 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c 2009-02-20 12:23:06.000000000 +0000 |
9705 | @@ -0,0 +1,1349 @@ | 8823 | @@ -0,0 +1,1219 @@ |
9706 | +/************************************************************************** | 8824 | +/************************************************************************** |
9707 | + * Copyright (c) 2007, Intel Corporation. | 8825 | + * Copyright (c) 2007, Intel Corporation. |
9708 | + * All Rights Reserved. | 8826 | + * All Rights Reserved. |
@@ -9742,11 +8860,6 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c | |||
9742 | +#include "drm_crtc.h" | 8860 | +#include "drm_crtc.h" |
9743 | +#include "psb_drv.h" | 8861 | +#include "psb_drv.h" |
9744 | + | 8862 | + |
9745 | +#define SII_1392_WA | ||
9746 | +#ifdef SII_1392_WA | ||
9747 | +extern int SII_1392; | ||
9748 | +#endif | ||
9749 | + | ||
9750 | +struct psbfb_vm_info { | 8863 | +struct psbfb_vm_info { |
9751 | + struct drm_buffer_object *bo; | 8864 | + struct drm_buffer_object *bo; |
9752 | + struct address_space *f_mapping; | 8865 | + struct address_space *f_mapping; |
@@ -9806,8 +8919,10 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c | |||
9806 | + if (regno > 255) | 8919 | + if (regno > 255) |
9807 | + return 1; | 8920 | + return 1; |
9808 | + | 8921 | + |
9809 | + if (crtc->funcs->gamma_set) | 8922 | + if (crtc->fb->depth == 8) { |
9810 | + crtc->funcs->gamma_set(crtc, red, green, blue, regno); | 8923 | + intel_crtc_fb_gamma_set(crtc, red, green, blue, regno); |
8924 | + return 0; | ||
8925 | + } | ||
9811 | + | 8926 | + |
9812 | + red = CMAP_TOHW(red, info->var.red.length); | 8927 | + red = CMAP_TOHW(red, info->var.red.length); |
9813 | + blue = CMAP_TOHW(blue, info->var.blue.length); | 8928 | + blue = CMAP_TOHW(blue, info->var.blue.length); |
@@ -9835,10 +8950,10 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c | |||
9835 | +static int psbfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | 8950 | +static int psbfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) |
9836 | +{ | 8951 | +{ |
9837 | + struct psbfb_par *par = info->par; | 8952 | + struct psbfb_par *par = info->par; |
9838 | + struct drm_device *dev = par->dev; | 8953 | + //struct drm_device *dev = par->dev; |
9839 | + struct drm_framebuffer *fb = par->crtc->fb; | 8954 | + struct drm_framebuffer *fb = par->crtc->fb; |
9840 | + struct drm_display_mode *drm_mode; | 8955 | + //struct drm_display_mode *drm_mode; |
9841 | + struct drm_connector *output; | 8956 | + //struct drm_connector *output; |
9842 | + int depth; | 8957 | + int depth; |
9843 | + int pitch; | 8958 | + int pitch; |
9844 | + int bpp = var->bits_per_pixel; | 8959 | + int bpp = var->bits_per_pixel; |
@@ -9877,43 +8992,12 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c | |||
9877 | + | 8992 | + |
9878 | + /* Check that we can resize */ | 8993 | + /* Check that we can resize */ |
9879 | + if ((pitch * var->yres) > (fb->bo->num_pages << PAGE_SHIFT)) { | 8994 | + if ((pitch * var->yres) > (fb->bo->num_pages << PAGE_SHIFT)) { |
9880 | +#if 1 | ||
9881 | + /* Need to resize the fb object. | 8995 | + /* Need to resize the fb object. |
9882 | + * But the generic fbdev code doesn't really understand | 8996 | + * But the generic fbdev code doesn't really understand |
9883 | + * that we can do this. So disable for now. | 8997 | + * that we can do this. So disable for now. |
9884 | + */ | 8998 | + */ |
9885 | + DRM_INFO("Can't support requested size, too big!\n"); | 8999 | + DRM_INFO("Can't support requested size, too big!\n"); |
9886 | + return -EINVAL; | 9000 | + return -EINVAL; |
9887 | +#else | ||
9888 | + int ret; | ||
9889 | + struct drm_buffer_object *fbo = NULL; | ||
9890 | + struct drm_bo_kmap_obj tmp_kmap; | ||
9891 | + | ||
9892 | + /* a temporary BO to check if we could resize in setpar. | ||
9893 | + * Therefore no need to set NO_EVICT. | ||
9894 | + */ | ||
9895 | + ret = drm_buffer_object_create(dev, | ||
9896 | + pitch * var->yres, | ||
9897 | + drm_bo_type_kernel, | ||
9898 | + DRM_BO_FLAG_READ | | ||
9899 | + DRM_BO_FLAG_WRITE | | ||
9900 | + DRM_BO_FLAG_MEM_TT | | ||
9901 | + DRM_BO_FLAG_MEM_VRAM, | ||
9902 | + DRM_BO_HINT_DONT_FENCE, | ||
9903 | + 0, 0, &fbo); | ||
9904 | + if (ret || !fbo) | ||
9905 | + return -ENOMEM; | ||
9906 | + | ||
9907 | + ret = drm_bo_kmap(fbo, 0, fbo->num_pages, &tmp_kmap); | ||
9908 | + if (ret) { | ||
9909 | + drm_bo_usage_deref_unlocked(&fbo); | ||
9910 | + return -EINVAL; | ||
9911 | + } | ||
9912 | + | ||
9913 | + drm_bo_kunmap(&tmp_kmap); | ||
9914 | + /* destroy our current fbo! */ | ||
9915 | + drm_bo_usage_deref_unlocked(&fbo); | ||
9916 | +#endif | ||
9917 | + } | 9001 | + } |
9918 | + | 9002 | + |
9919 | + switch (depth) { | 9003 | + switch (depth) { |
@@ -9971,31 +9055,6 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c | |||
9971 | + return -EINVAL; | 9055 | + return -EINVAL; |
9972 | + } | 9056 | + } |
9973 | + | 9057 | + |
9974 | +#if 0 | ||
9975 | + /* Here we walk the output mode list and look for modes. If we haven't | ||
9976 | + * got it, then bail. Not very nice, so this is disabled. | ||
9977 | + * In the set_par code, we create our mode based on the incoming | ||
9978 | + * parameters. Nicer, but may not be desired by some. | ||
9979 | + */ | ||
9980 | + list_for_each_entry(output, &dev->mode_config.connector_list, head) { | ||
9981 | + if (output->crtc == par->crtc) | ||
9982 | + break; | ||
9983 | + } | ||
9984 | + | ||
9985 | + list_for_each_entry(drm_mode, &output->modes, head) { | ||
9986 | + if (drm_mode->hdisplay == var->xres && | ||
9987 | + drm_mode->vdisplay == var->yres && drm_mode->clock != 0) | ||
9988 | + break; | ||
9989 | + } | ||
9990 | + | ||
9991 | + if (!drm_mode) | ||
9992 | + return -EINVAL; | ||
9993 | +#else | ||
9994 | + (void)dev; /* silence warnings */ | ||
9995 | + (void)output; | ||
9996 | + (void)drm_mode; | ||
9997 | +#endif | ||
9998 | + | ||
9999 | + return 0; | 9058 | + return 0; |
10000 | +} | 9059 | +} |
10001 | + | 9060 | + |
@@ -10037,7 +9096,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c | |||
10037 | + struct drm_display_mode *drm_mode; | 9096 | + struct drm_display_mode *drm_mode; |
10038 | + struct fb_var_screeninfo *var = &info->var; | 9097 | + struct fb_var_screeninfo *var = &info->var; |
10039 | + struct drm_psb_private *dev_priv = dev->dev_private; | 9098 | + struct drm_psb_private *dev_priv = dev->dev_private; |
10040 | + struct drm_connector *output; | 9099 | + //struct drm_connector *output; |
10041 | + int pitch; | 9100 | + int pitch; |
10042 | + int depth; | 9101 | + int depth; |
10043 | + int bpp = var->bits_per_pixel; | 9102 | + int bpp = var->bits_per_pixel; |
@@ -10065,55 +9124,12 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c | |||
10065 | + pitch = ((var->xres * ((bpp + 1) / 8)) + 0x3f) & ~0x3f; | 9124 | + pitch = ((var->xres * ((bpp + 1) / 8)) + 0x3f) & ~0x3f; |
10066 | + | 9125 | + |
10067 | + if ((pitch * var->yres) > (fb->bo->num_pages << PAGE_SHIFT)) { | 9126 | + if ((pitch * var->yres) > (fb->bo->num_pages << PAGE_SHIFT)) { |
10068 | +#if 1 | ||
10069 | + /* Need to resize the fb object. | 9127 | + /* Need to resize the fb object. |
10070 | + * But the generic fbdev code doesn't really understand | 9128 | + * But the generic fbdev code doesn't really understand |
10071 | + * that we can do this. So disable for now. | 9129 | + * that we can do this. So disable for now. |
10072 | + */ | 9130 | + */ |
10073 | + DRM_INFO("Can't support requested size, too big!\n"); | 9131 | + DRM_INFO("Can't support requested size, too big!\n"); |
10074 | + return -EINVAL; | 9132 | + return -EINVAL; |
10075 | +#else | ||
10076 | + int ret; | ||
10077 | + struct drm_buffer_object *fbo = NULL, *tfbo; | ||
10078 | + struct drm_bo_kmap_obj tmp_kmap, tkmap; | ||
10079 | + | ||
10080 | + ret = drm_buffer_object_create(dev, | ||
10081 | + pitch * var->yres, | ||
10082 | + drm_bo_type_kernel, | ||
10083 | + DRM_BO_FLAG_READ | | ||
10084 | + DRM_BO_FLAG_WRITE | | ||
10085 | + DRM_BO_FLAG_MEM_TT | | ||
10086 | + DRM_BO_FLAG_MEM_VRAM | | ||
10087 | + DRM_BO_FLAG_NO_EVICT, | ||
10088 | + DRM_BO_HINT_DONT_FENCE, | ||
10089 | + 0, 0, &fbo); | ||
10090 | + if (ret || !fbo) { | ||
10091 | + DRM_ERROR | ||
10092 | + ("failed to allocate new resized framebuffer\n"); | ||
10093 | + return -ENOMEM; | ||
10094 | + } | ||
10095 | + | ||
10096 | + ret = drm_bo_kmap(fbo, 0, fbo->num_pages, &tmp_kmap); | ||
10097 | + if (ret) { | ||
10098 | + DRM_ERROR("failed to kmap framebuffer.\n"); | ||
10099 | + drm_bo_usage_deref_unlocked(&fbo); | ||
10100 | + return -EINVAL; | ||
10101 | + } | ||
10102 | + | ||
10103 | + DRM_DEBUG("allocated %dx%d fb: 0x%08lx, bo %p\n", fb->width, | ||
10104 | + fb->height, fb->offset, fbo); | ||
10105 | + | ||
10106 | + /* set new screen base */ | ||
10107 | + info->screen_base = tmp_kmap.virtual; | ||
10108 | + | ||
10109 | + tkmap = fb->kmap; | ||
10110 | + fb->kmap = tmp_kmap; | ||
10111 | + drm_bo_kunmap(&tkmap); | ||
10112 | + | ||
10113 | + tfbo = fb->bo; | ||
10114 | + fb->bo = fbo; | ||
10115 | + drm_bo_usage_deref_unlocked(&tfbo); | ||
10116 | +#endif | ||
10117 | + } | 9133 | + } |
10118 | + | 9134 | + |
10119 | + fb->offset = fb->bo->offset - dev_priv->pg->gatt_start; | 9135 | + fb->offset = fb->bo->offset - dev_priv->pg->gatt_start; |
@@ -10136,30 +9152,11 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c | |||
10136 | + window and re-enter the console */ | 9152 | + window and re-enter the console */ |
10137 | + info->screen_base = fb->kmap.virtual; | 9153 | + info->screen_base = fb->kmap.virtual; |
10138 | + | 9154 | + |
10139 | +#if 0 | ||
10140 | + /* relates to resize - disable */ | ||
10141 | + info->fix.smem_len = info->fix.line_length * var->yres; | ||
10142 | + info->screen_size = info->fix.smem_len; /* ??? */ | ||
10143 | +#endif | ||
10144 | + | ||
10145 | + /* Should we walk the output's modelist or just create our own ??? | 9155 | + /* Should we walk the output's modelist or just create our own ??? |
10146 | + * For now, we create and destroy a mode based on the incoming | 9156 | + * For now, we create and destroy a mode based on the incoming |
10147 | + * parameters. But there's commented out code below which scans | 9157 | + * parameters. But there's commented out code below which scans |
10148 | + * the output list too. | 9158 | + * the output list too. |
10149 | + */ | 9159 | + */ |
10150 | +#if 0 | ||
10151 | + list_for_each_entry(output, &dev->mode_config.connector_list, head) { | ||
10152 | + if (output->crtc == par->crtc) | ||
10153 | + break; | ||
10154 | + } | ||
10155 | + | ||
10156 | + list_for_each_entry(drm_mode, &output->modes, head) { | ||
10157 | + if (drm_mode->hdisplay == var->xres && | ||
10158 | + drm_mode->vdisplay == var->yres && drm_mode->clock != 0) | ||
10159 | + break; | ||
10160 | + } | ||
10161 | +#else | ||
10162 | + (void)output; /* silence warning */ | ||
10163 | + | 9160 | + |
10164 | + drm_mode = drm_mode_create(dev); | 9161 | + drm_mode = drm_mode_create(dev); |
10165 | + drm_mode->hdisplay = var->xres; | 9162 | + drm_mode->hdisplay = var->xres; |
@@ -10174,7 +9171,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c | |||
10174 | + drm_mode->vrefresh = drm_mode_vrefresh(drm_mode); | 9171 | + drm_mode->vrefresh = drm_mode_vrefresh(drm_mode); |
10175 | + drm_mode_set_name(drm_mode); | 9172 | + drm_mode_set_name(drm_mode); |
10176 | + drm_mode_set_crtcinfo(drm_mode, CRTC_INTERLACE_HALVE_V); | 9173 | + drm_mode_set_crtcinfo(drm_mode, CRTC_INTERLACE_HALVE_V); |
10177 | +#endif | 9174 | + |
10178 | + | 9175 | + |
10179 | + if (!drm_crtc_helper_set_mode(par->crtc, drm_mode, 0, 0, NULL)) | 9176 | + if (!drm_crtc_helper_set_mode(par->crtc, drm_mode, 0, 0, NULL)) |
10180 | + return -EINVAL; | 9177 | + return -EINVAL; |
@@ -10182,9 +9179,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c | |||
10182 | + /* Have to destroy our created mode if we're not searching the mode | 9179 | + /* Have to destroy our created mode if we're not searching the mode |
10183 | + * list for it. | 9180 | + * list for it. |
10184 | + */ | 9181 | + */ |
10185 | +#if 1 | ||
10186 | + drm_mode_destroy(dev, drm_mode); | 9182 | + drm_mode_destroy(dev, drm_mode); |
10187 | +#endif | ||
10188 | + | 9183 | + |
10189 | + return 0; | 9184 | + return 0; |
10190 | +} | 9185 | +} |
@@ -10664,12 +9659,9 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c | |||
10664 | + acquire_console_sem(); | 9659 | + acquire_console_sem(); |
10665 | + ret = psbfb_kms_on(dev, 0); | 9660 | + ret = psbfb_kms_on(dev, 0); |
10666 | + release_console_sem(); | 9661 | + release_console_sem(); |
10667 | +#ifdef SII_1392_WA | 9662 | + |
10668 | + if((SII_1392 != 1) || (drm_psb_no_fb==0)) | ||
10669 | + drm_helper_disable_unused_functions(dev); | ||
10670 | +#else | ||
10671 | + drm_helper_disable_unused_functions(dev); | 9663 | + drm_helper_disable_unused_functions(dev); |
10672 | +#endif | 9664 | + |
10673 | + return ret; | 9665 | + return ret; |
10674 | +} | 9666 | +} |
10675 | + | 9667 | + |
@@ -10685,12 +9677,8 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c | |||
10685 | + acquire_console_sem(); | 9677 | + acquire_console_sem(); |
10686 | + psbfb_kms_on(dev, 1); | 9678 | + psbfb_kms_on(dev, 1); |
10687 | + release_console_sem(); | 9679 | + release_console_sem(); |
10688 | +#ifdef SII_1392_WA | 9680 | + |
10689 | + if((SII_1392 != 1) || (drm_psb_no_fb==0)) | ||
10690 | + drm_helper_disable_unused_functions(dev); | ||
10691 | +#else | ||
10692 | + drm_helper_disable_unused_functions(dev); | 9681 | + drm_helper_disable_unused_functions(dev); |
10693 | +#endif | ||
10694 | +} | 9682 | +} |
10695 | + | 9683 | + |
10696 | +/* | 9684 | +/* |
@@ -11055,7 +10043,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fb.c | |||
11055 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fence.c | 10043 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fence.c |
11056 | =================================================================== | 10044 | =================================================================== |
11057 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 10045 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
11058 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_fence.c 2009-02-12 09:14:41.000000000 +0000 | 10046 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_fence.c 2009-02-20 12:23:06.000000000 +0000 |
11059 | @@ -0,0 +1,285 @@ | 10047 | @@ -0,0 +1,285 @@ |
11060 | +/************************************************************************** | 10048 | +/************************************************************************** |
11061 | + * Copyright (c) 2007, Intel Corporation. | 10049 | + * Copyright (c) 2007, Intel Corporation. |
@@ -11345,8 +10333,8 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_fence.c | |||
11345 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_gtt.c | 10333 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_gtt.c |
11346 | =================================================================== | 10334 | =================================================================== |
11347 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 10335 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
11348 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_gtt.c 2009-02-12 09:14:41.000000000 +0000 | 10336 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_gtt.c 2009-02-20 12:23:06.000000000 +0000 |
11349 | @@ -0,0 +1,233 @@ | 10337 | @@ -0,0 +1,253 @@ |
11350 | +/************************************************************************** | 10338 | +/************************************************************************** |
11351 | + * Copyright (c) 2007, Intel Corporation. | 10339 | + * Copyright (c) 2007, Intel Corporation. |
11352 | + * All Rights Reserved. | 10340 | + * All Rights Reserved. |
@@ -11434,14 +10422,20 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_gtt.c | |||
11434 | + int ret = 0; | 10422 | + int ret = 0; |
11435 | + uint32_t pte; | 10423 | + uint32_t pte; |
11436 | + | 10424 | + |
10425 | + printk(KERN_ERR "Bar A1\n"); | ||
10426 | + | ||
11437 | + pci_read_config_word(dev->pdev, PSB_GMCH_CTRL, &pg->gmch_ctrl); | 10427 | + pci_read_config_word(dev->pdev, PSB_GMCH_CTRL, &pg->gmch_ctrl); |
11438 | + pci_write_config_word(dev->pdev, PSB_GMCH_CTRL, | 10428 | + pci_write_config_word(dev->pdev, PSB_GMCH_CTRL, |
11439 | + pg->gmch_ctrl | _PSB_GMCH_ENABLED); | 10429 | + pg->gmch_ctrl | _PSB_GMCH_ENABLED); |
11440 | + | 10430 | + |
10431 | + printk(KERN_ERR "Bar A2\n"); | ||
10432 | + | ||
11441 | + pg->pge_ctl = PSB_RVDC32(PSB_PGETBL_CTL); | 10433 | + pg->pge_ctl = PSB_RVDC32(PSB_PGETBL_CTL); |
11442 | + PSB_WVDC32(pg->pge_ctl | _PSB_PGETBL_ENABLED, PSB_PGETBL_CTL); | 10434 | + PSB_WVDC32(pg->pge_ctl | _PSB_PGETBL_ENABLED, PSB_PGETBL_CTL); |
11443 | + (void)PSB_RVDC32(PSB_PGETBL_CTL); | 10435 | + (void)PSB_RVDC32(PSB_PGETBL_CTL); |
11444 | + | 10436 | + |
10437 | + printk(KERN_ERR "Bar A3\n"); | ||
10438 | + | ||
11445 | + pg->initialized = 1; | 10439 | + pg->initialized = 1; |
11446 | + | 10440 | + |
11447 | + pg->gtt_phys_start = pg->pge_ctl & PAGE_MASK; | 10441 | + pg->gtt_phys_start = pg->pge_ctl & PAGE_MASK; |
@@ -11450,9 +10444,13 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_gtt.c | |||
11450 | + gtt_pages = pci_resource_len(dev->pdev, PSB_GTT_RESOURCE) >> PAGE_SHIFT; | 10444 | + gtt_pages = pci_resource_len(dev->pdev, PSB_GTT_RESOURCE) >> PAGE_SHIFT; |
11451 | + pg->gatt_pages = pci_resource_len(dev->pdev, PSB_GATT_RESOURCE) | 10445 | + pg->gatt_pages = pci_resource_len(dev->pdev, PSB_GATT_RESOURCE) |
11452 | + >> PAGE_SHIFT; | 10446 | + >> PAGE_SHIFT; |
10447 | + | ||
10448 | + printk(KERN_ERR "Bar A4\n"); | ||
11453 | + pci_read_config_dword(dev->pdev, PSB_BSM, &pg->stolen_base); | 10449 | + pci_read_config_dword(dev->pdev, PSB_BSM, &pg->stolen_base); |
11454 | + stolen_size = pg->gtt_phys_start - pg->stolen_base - PAGE_SIZE; | 10450 | + stolen_size = pg->gtt_phys_start - pg->stolen_base - PAGE_SIZE; |
11455 | + | 10451 | + |
10452 | + printk(KERN_ERR "Bar A5\n"); | ||
10453 | + | ||
11456 | + PSB_DEBUG_INIT("GTT phys start: 0x%08x.\n", pg->gtt_phys_start); | 10454 | + PSB_DEBUG_INIT("GTT phys start: 0x%08x.\n", pg->gtt_phys_start); |
11457 | + PSB_DEBUG_INIT("GTT start: 0x%08x.\n", pg->gtt_start); | 10455 | + PSB_DEBUG_INIT("GTT start: 0x%08x.\n", pg->gtt_start); |
11458 | + PSB_DEBUG_INIT("GATT start: 0x%08x.\n", pg->gatt_start); | 10456 | + PSB_DEBUG_INIT("GATT start: 0x%08x.\n", pg->gatt_start); |
@@ -11466,6 +10464,8 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_gtt.c | |||
11466 | + goto out_err; | 10464 | + goto out_err; |
11467 | + } | 10465 | + } |
11468 | + | 10466 | + |
10467 | + printk(KERN_ERR "Bar A6\n"); | ||
10468 | + | ||
11469 | + pg->gtt_pages = gtt_pages; | 10469 | + pg->gtt_pages = gtt_pages; |
11470 | + pg->stolen_size = stolen_size; | 10470 | + pg->stolen_size = stolen_size; |
11471 | + pg->gtt_map = | 10471 | + pg->gtt_map = |
@@ -11476,6 +10476,8 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_gtt.c | |||
11476 | + goto out_err; | 10476 | + goto out_err; |
11477 | + } | 10477 | + } |
11478 | + | 10478 | + |
10479 | + printk(KERN_ERR "Bar A7\n"); | ||
10480 | + | ||
11479 | + /* | 10481 | + /* |
11480 | + * insert stolen pages. | 10482 | + * insert stolen pages. |
11481 | + */ | 10483 | + */ |
@@ -11489,6 +10491,8 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_gtt.c | |||
11489 | + iowrite32(pte, pg->gtt_map + i); | 10491 | + iowrite32(pte, pg->gtt_map + i); |
11490 | + } | 10492 | + } |
11491 | + | 10493 | + |
10494 | + printk(KERN_ERR "Bar A8\n"); | ||
10495 | + | ||
11492 | + /* | 10496 | + /* |
11493 | + * Init rest of gtt. | 10497 | + * Init rest of gtt. |
11494 | + */ | 10498 | + */ |
@@ -11498,10 +10502,14 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_gtt.c | |||
11498 | + PSB_DEBUG_INIT("Initializing the rest of a total " | 10502 | + PSB_DEBUG_INIT("Initializing the rest of a total " |
11499 | + "of %d gtt pages.\n", pg->gatt_pages); | 10503 | + "of %d gtt pages.\n", pg->gatt_pages); |
11500 | + | 10504 | + |
10505 | + printk(KERN_ERR "Bar A10\n"); | ||
10506 | + | ||
11501 | + for (; i < pg->gatt_pages; ++i) | 10507 | + for (; i < pg->gatt_pages; ++i) |
11502 | + iowrite32(pte, pg->gtt_map + i); | 10508 | + iowrite32(pte, pg->gtt_map + i); |
11503 | + (void)ioread32(pg->gtt_map + i - 1); | 10509 | + (void)ioread32(pg->gtt_map + i - 1); |
11504 | + | 10510 | + |
10511 | + printk(KERN_ERR "Bar A11\n"); | ||
10512 | + | ||
11505 | + return 0; | 10513 | + return 0; |
11506 | + | 10514 | + |
11507 | + out_err: | 10515 | + out_err: |
@@ -11580,238 +10588,188 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_gtt.c | |||
11580 | + | 10588 | + |
11581 | + return 0; | 10589 | + return 0; |
11582 | +} | 10590 | +} |
11583 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_i2c.c | 10591 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_irq.c |
11584 | =================================================================== | 10592 | =================================================================== |
11585 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 10593 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
11586 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_i2c.c 2009-02-12 10:12:29.000000000 +0000 | 10594 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_irq.c 2009-02-20 12:23:06.000000000 +0000 |
11587 | @@ -0,0 +1,179 @@ | 10595 | @@ -0,0 +1,519 @@ |
11588 | +/* | 10596 | +/************************************************************************** |
11589 | + * Copyright © 2006-2007 Intel Corporation | 10597 | + * Copyright (c) 2007, Intel Corporation. |
10598 | + * All Rights Reserved. | ||
11590 | + * | 10599 | + * |
11591 | + * Permission is hereby granted, free of charge, to any person obtaining a | 10600 | + * This program is free software; you can redistribute it and/or modify it |
11592 | + * copy of this software and associated documentation files (the "Software"), | 10601 | + * under the terms and conditions of the GNU General Public License, |
11593 | + * to deal in the Software without restriction, including without limitation | 10602 | + * version 2, as published by the Free Software Foundation. |
11594 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
11595 | + * and/or sell copies of the Software, and to permit persons to whom the | ||
11596 | + * Software is furnished to do so, subject to the following conditions: | ||
11597 | + * | 10603 | + * |
11598 | + * The above copyright notice and this permission notice (including the next | 10604 | + * This program is distributed in the hope it will be useful, but WITHOUT |
11599 | + * paragraph) shall be included in all copies or substantial portions of the | 10605 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
11600 | + * Software. | 10606 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
10607 | + * more details. | ||
11601 | + * | 10608 | + * |
11602 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 10609 | + * You should have received a copy of the GNU General Public License along with |
11603 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 10610 | + * this program; if not, write to the Free Software Foundation, Inc., |
11604 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | 10611 | + * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. |
11605 | + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
11606 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
11607 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
11608 | + * DEALINGS IN THE SOFTWARE. | ||
11609 | + * | 10612 | + * |
11610 | + * Authors: | 10613 | + * Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to |
11611 | + * Eric Anholt <eric@anholt.net> | 10614 | + * develop this driver. |
11612 | + */ | 10615 | + * |
10616 | + **************************************************************************/ | ||
11613 | +/* | 10617 | +/* |
11614 | + * Copyright (c) 2006 Dave Airlie <airlied@linux.ie> | ||
11615 | + * Jesse Barnes <jesse.barnes@intel.com> | ||
11616 | + */ | 10618 | + */ |
11617 | + | 10619 | + |
11618 | +#include <linux/i2c.h> | ||
11619 | +#include <linux/i2c-id.h> | ||
11620 | +#include <linux/i2c-algo-bit.h> | ||
11621 | +#include "drmP.h" | 10620 | +#include "drmP.h" |
11622 | +#include "drm.h" | ||
11623 | +#include "../i915/intel_drv.h" | ||
11624 | +#include "psb_drv.h" | 10621 | +#include "psb_drv.h" |
10622 | +#include "psb_reg.h" | ||
10623 | +#include "psb_msvdx.h" | ||
10624 | +#include "../i915/i915_reg.h" | ||
11625 | + | 10625 | + |
11626 | +/* | 10626 | +/* |
11627 | + * Intel GPIO access functions | 10627 | + * Video display controller interrupt. |
11628 | + */ | 10628 | + */ |
11629 | + | 10629 | + |
11630 | +#define I2C_RISEFALL_TIME 20 | 10630 | +static inline u32 |
11631 | + | 10631 | +psb_pipestat(int pipe) |
11632 | +static int get_clock(void *data) | ||
11633 | +{ | 10632 | +{ |
11634 | + struct intel_i2c_chan *chan = data; | 10633 | + if (pipe == 0) |
11635 | + struct drm_psb_private *dev_priv = chan->drm_dev->dev_private; | 10634 | + return PIPEASTAT; |
11636 | + uint32_t val; | 10635 | + if (pipe == 1) |
11637 | + | 10636 | + return PIPEBSTAT; |
11638 | + val = PSB_RVDC32(chan->reg); | 10637 | + BUG(); |
11639 | + return ((val & GPIO_CLOCK_VAL_IN) != 0); | ||
11640 | +} | 10638 | +} |
11641 | + | 10639 | + |
11642 | +static int get_data(void *data) | 10640 | +void |
10641 | +psb_enable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask) | ||
11643 | +{ | 10642 | +{ |
11644 | + struct intel_i2c_chan *chan = data; | 10643 | + //struct drm_i915_common_private *dev_priv_common = dev_priv; |
11645 | + struct drm_psb_private *dev_priv = chan->drm_dev->dev_private; | 10644 | + |
11646 | + uint32_t val; | 10645 | + if ((dev_priv->pipestat[pipe] & mask) != mask) { |
10646 | + u32 reg = psb_pipestat(pipe); | ||
11647 | + | 10647 | + |
11648 | + val = PSB_RVDC32(chan->reg); | 10648 | + dev_priv->pipestat[pipe] |= mask; |
11649 | + return ((val & GPIO_DATA_VAL_IN) != 0); | 10649 | + /* Enable the interrupt, clear any pending status */ |
10650 | + I915_WRITE(reg, dev_priv->pipestat[pipe] | (mask >> 16)); | ||
10651 | + (void) I915_READ(reg); | ||
10652 | + } | ||
11650 | +} | 10653 | +} |
11651 | + | 10654 | + |
11652 | +static void set_clock(void *data, int state_high) | 10655 | +void |
10656 | +psb_disable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask) | ||
11653 | +{ | 10657 | +{ |
11654 | + struct intel_i2c_chan *chan = data; | 10658 | + //struct drm_i915_common_private *dev_priv_common = (struct drm_i915_common_private *) dev_priv; |
11655 | + struct drm_psb_private *dev_priv = chan->drm_dev->dev_private; | ||
11656 | + uint32_t reserved = 0, clock_bits; | ||
11657 | + | 10659 | + |
11658 | + /* On most chips, these bits must be preserved in software. */ | 10660 | + if ((dev_priv->pipestat[pipe] & mask) != 0) { |
11659 | + reserved = PSB_RVDC32(chan->reg) & (GPIO_DATA_PULLUP_DISABLE | | 10661 | + u32 reg = psb_pipestat(pipe); |
11660 | + GPIO_CLOCK_PULLUP_DISABLE); | ||
11661 | + | 10662 | + |
11662 | + if (state_high) | 10663 | + dev_priv->pipestat[pipe] &= ~mask; |
11663 | + clock_bits = GPIO_CLOCK_DIR_IN | GPIO_CLOCK_DIR_MASK; | 10664 | + I915_WRITE(reg, dev_priv->pipestat[pipe]); |
11664 | + else | 10665 | + (void) I915_READ(reg); |
11665 | + clock_bits = GPIO_CLOCK_DIR_OUT | GPIO_CLOCK_DIR_MASK | | 10666 | + } |
11666 | + GPIO_CLOCK_VAL_MASK; | ||
11667 | + PSB_WVDC32(reserved | clock_bits, chan->reg); | ||
11668 | + udelay(I2C_RISEFALL_TIME); /* wait for the line to change state */ | ||
11669 | +} | 10667 | +} |
11670 | + | 10668 | + |
11671 | +static void set_data(void *data, int state_high) | ||
11672 | +{ | ||
11673 | + struct intel_i2c_chan *chan = data; | ||
11674 | + struct drm_psb_private *dev_priv = chan->drm_dev->dev_private; | ||
11675 | + uint32_t reserved = 0, data_bits; | ||
11676 | + | 10669 | + |
11677 | + /* On most chips, these bits must be preserved in software. */ | 10670 | +/** |
11678 | + reserved = PSB_RVDC32(chan->reg) & (GPIO_DATA_PULLUP_DISABLE | | 10671 | + * i915_pipe_enabled - check if a pipe is enabled |
11679 | + GPIO_CLOCK_PULLUP_DISABLE); | 10672 | + * @dev: DRM device |
10673 | + * @pipe: pipe to check | ||
10674 | + * | ||
10675 | + * Reading certain registers when the pipe is disabled can hang the chip. | ||
10676 | + * Use this routine to make sure the PLL is running and the pipe is active | ||
10677 | + * before reading such registers if unsure. | ||
10678 | + */ | ||
10679 | +static int | ||
10680 | +i915_pipe_enabled(struct drm_device *dev, int pipe) | ||
10681 | +{ | ||
10682 | + struct drm_psb_private *dev_priv = dev->dev_private; | ||
10683 | + unsigned long pipeconf = pipe ? PIPEBCONF : PIPEACONF; | ||
11680 | + | 10684 | + |
11681 | + if (state_high) | 10685 | + if (I915_READ(pipeconf) & PIPEACONF_ENABLE) |
11682 | + data_bits = GPIO_DATA_DIR_IN | GPIO_DATA_DIR_MASK; | 10686 | + return 1; |
11683 | + else | ||
11684 | + data_bits = GPIO_DATA_DIR_OUT | GPIO_DATA_DIR_MASK | | ||
11685 | + GPIO_DATA_VAL_MASK; | ||
11686 | + | 10687 | + |
11687 | + PSB_WVDC32(data_bits, chan->reg); | 10688 | + return 0; |
11688 | + udelay(I2C_RISEFALL_TIME); /* wait for the line to change state */ | ||
11689 | +} | 10689 | +} |
11690 | + | 10690 | + |
11691 | +/** | 10691 | +/* Called from drm generic code, passed a 'crtc', which |
11692 | + * intel_i2c_create - instantiate an Intel i2c bus using the specified GPIO reg | 10692 | + * we use as a pipe index |
11693 | + * @dev: DRM device | ||
11694 | + * @output: driver specific output device | ||
11695 | + * @reg: GPIO reg to use | ||
11696 | + * @name: name for this bus | ||
11697 | + * | ||
11698 | + * Creates and registers a new i2c bus with the Linux i2c layer, for use | ||
11699 | + * in output probing and control (e.g. DDC or SDVO control functions). | ||
11700 | + * | ||
11701 | + * Possible values for @reg include: | ||
11702 | + * %GPIOA | ||
11703 | + * %GPIOB | ||
11704 | + * %GPIOC | ||
11705 | + * %GPIOD | ||
11706 | + * %GPIOE | ||
11707 | + * %GPIOF | ||
11708 | + * %GPIOG | ||
11709 | + * %GPIOH | ||
11710 | + * see PRM for details on how these different busses are used. | ||
11711 | + */ | 10693 | + */ |
11712 | +struct intel_i2c_chan *intel_i2c_create(struct drm_device *dev, | 10694 | +u32 psb_get_vblank_counter(struct drm_device *dev, int pipe) |
11713 | + const uint32_t reg, const char *name) | ||
11714 | +{ | 10695 | +{ |
11715 | + struct intel_i2c_chan *chan; | 10696 | + struct drm_psb_private *dev_priv = dev->dev_private; |
10697 | + unsigned long high_frame; | ||
10698 | + unsigned long low_frame; | ||
10699 | + u32 high1, high2, low, count; | ||
11716 | + | 10700 | + |
11717 | + chan = kzalloc(sizeof(struct intel_i2c_chan), GFP_KERNEL); | 10701 | + high_frame = pipe ? PIPEBFRAMEHIGH : PIPEAFRAMEHIGH; |
11718 | + if (!chan) | 10702 | + low_frame = pipe ? PIPEBFRAMEPIXEL : PIPEAFRAMEPIXEL; |
11719 | + goto out_free; | ||
11720 | + | 10703 | + |
11721 | + chan->drm_dev = dev; | 10704 | + if (!i915_pipe_enabled(dev, pipe)) { |
11722 | + chan->reg = reg; | 10705 | + DRM_ERROR("trying to get vblank count for disabled pipe %d\n", pipe); |
11723 | + snprintf(chan->adapter.name, I2C_NAME_SIZE, "intel drm %s", name); | 10706 | + return 0; |
11724 | + chan->adapter.owner = THIS_MODULE; | 10707 | + } |
11725 | + chan->adapter.id = I2C_HW_B_INTELFB; | ||
11726 | + chan->adapter.algo_data = &chan->algo; | ||
11727 | + chan->adapter.dev.parent = &dev->pdev->dev; | ||
11728 | + chan->algo.setsda = set_data; | ||
11729 | + chan->algo.setscl = set_clock; | ||
11730 | + chan->algo.getsda = get_data; | ||
11731 | + chan->algo.getscl = get_clock; | ||
11732 | + chan->algo.udelay = 20; | ||
11733 | + chan->algo.timeout = usecs_to_jiffies(2200); | ||
11734 | + chan->algo.data = chan; | ||
11735 | + | ||
11736 | + i2c_set_adapdata(&chan->adapter, chan); | ||
11737 | + | ||
11738 | + if (i2c_bit_add_bus(&chan->adapter)) | ||
11739 | + goto out_free; | ||
11740 | + | 10708 | + |
11741 | + /* JJJ: raise SCL and SDA? */ | 10709 | + /* |
11742 | + set_data(chan, 1); | 10710 | + * High & low register fields aren't synchronized, so make sure |
11743 | + set_clock(chan, 1); | 10711 | + * we get a low value that's stable across two reads of the high |
11744 | + udelay(20); | 10712 | + * register. |
10713 | + */ | ||
10714 | + do { | ||
10715 | + high1 = ((I915_READ(high_frame) & PIPE_FRAME_HIGH_MASK) >> | ||
10716 | + PIPE_FRAME_HIGH_SHIFT); | ||
10717 | + low = ((I915_READ(low_frame) & PIPE_FRAME_LOW_MASK) >> | ||
10718 | + PIPE_FRAME_LOW_SHIFT); | ||
10719 | + high2 = ((I915_READ(high_frame) & PIPE_FRAME_HIGH_MASK) >> | ||
10720 | + PIPE_FRAME_HIGH_SHIFT); | ||
10721 | + } while (high1 != high2); | ||
11745 | + | 10722 | + |
11746 | + return chan; | 10723 | + count = (high1 << 8) | low; |
11747 | + | 10724 | + |
11748 | + out_free: | 10725 | + return count; |
11749 | + kfree(chan); | ||
11750 | + return NULL; | ||
11751 | +} | 10726 | +} |
11752 | + | 10727 | + |
11753 | +/** | 10728 | +/* Called from drm generic code, passed 'crtc' which |
11754 | + * intel_i2c_destroy - unregister and free i2c bus resources | 10729 | + * we use as a pipe index |
11755 | + * @output: channel to free | ||
11756 | + * | ||
11757 | + * Unregister the adapter from the i2c layer, then free the structure. | ||
11758 | + */ | 10730 | + */ |
11759 | +void intel_i2c_destroy(struct intel_i2c_chan *chan) | 10731 | +int psb_enable_vblank(struct drm_device *dev, int pipe) |
11760 | +{ | 10732 | +{ |
11761 | + if (!chan) | 10733 | + struct drm_psb_private *dev_priv = dev->dev_private; |
11762 | + return; | 10734 | + unsigned long irqflags; |
10735 | + int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF; | ||
10736 | + u32 pipeconf; | ||
10737 | + | ||
10738 | + pipeconf = I915_READ(pipeconf_reg); | ||
10739 | + if (!(pipeconf & PIPEACONF_ENABLE)) | ||
10740 | + return -EINVAL; | ||
11763 | + | 10741 | + |
11764 | + i2c_del_adapter(&chan->adapter); | 10742 | + spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags); |
11765 | + kfree(chan); | 10743 | + psb_enable_pipestat(dev_priv, pipe, PIPE_VBLANK_INTERRUPT_ENABLE); |
10744 | + spin_unlock_irqrestore(&dev_priv->user_irq_lock, irqflags); | ||
10745 | + return 0; | ||
11766 | +} | 10746 | +} |
11767 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_irq.c | 10747 | + |
11768 | =================================================================== | 10748 | +/* Called from drm generic code, passed 'crtc' which |
11769 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 10749 | + * we use as a pipe index |
11770 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_irq.c 2009-02-12 09:14:41.000000000 +0000 | ||
11771 | @@ -0,0 +1,382 @@ | ||
11772 | +/************************************************************************** | ||
11773 | + * Copyright (c) 2007, Intel Corporation. | ||
11774 | + * All Rights Reserved. | ||
11775 | + * | ||
11776 | + * This program is free software; you can redistribute it and/or modify it | ||
11777 | + * under the terms and conditions of the GNU General Public License, | ||
11778 | + * version 2, as published by the Free Software Foundation. | ||
11779 | + * | ||
11780 | + * This program is distributed in the hope it will be useful, but WITHOUT | ||
11781 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11782 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11783 | + * more details. | ||
11784 | + * | ||
11785 | + * You should have received a copy of the GNU General Public License along with | ||
11786 | + * this program; if not, write to the Free Software Foundation, Inc., | ||
11787 | + * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
11788 | + * | ||
11789 | + * Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to | ||
11790 | + * develop this driver. | ||
11791 | + * | ||
11792 | + **************************************************************************/ | ||
11793 | +/* | ||
11794 | + */ | 10750 | + */ |
10751 | +void psb_disable_vblank(struct drm_device *dev, int pipe) | ||
10752 | +{ | ||
10753 | + struct drm_psb_private *dev_priv = dev->dev_private; | ||
10754 | + unsigned long irqflags; | ||
10755 | + | ||
10756 | + spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags); | ||
10757 | + psb_disable_pipestat(dev_priv, pipe, | ||
10758 | + PIPE_VBLANK_INTERRUPT_ENABLE | | ||
10759 | + PIPE_START_VBLANK_INTERRUPT_ENABLE); | ||
10760 | + spin_unlock_irqrestore(&dev_priv->user_irq_lock, irqflags); | ||
10761 | +} | ||
11795 | + | 10762 | + |
11796 | +#include "drmP.h" | ||
11797 | +#include "psb_drv.h" | ||
11798 | +#include "psb_reg.h" | ||
11799 | +#include "psb_msvdx.h" | ||
11800 | + | 10763 | + |
11801 | +/* | ||
11802 | + * Video display controller interrupt. | ||
11803 | + */ | ||
11804 | + | 10764 | + |
11805 | +static void psb_vdc_interrupt(struct drm_device *dev, uint32_t vdc_stat) | 10765 | +static void psb_vdc_interrupt(struct drm_device *dev, uint32_t vdc_stat) |
11806 | +{ | 10766 | +{ |
11807 | + struct drm_psb_private *dev_priv = | 10767 | + struct drm_psb_private *dev_priv = dev->dev_private; uint32_t pipe_stats; |
11808 | + (struct drm_psb_private *)dev->dev_private; | ||
11809 | + uint32_t pipe_stats; | ||
11810 | + int wake = 0; | 10768 | + int wake = 0; |
11811 | + | 10769 | + |
11812 | + if (!drm_psb_disable_vsync && (vdc_stat & _PSB_VSYNC_PIPEA_FLAG)) { | 10770 | + if (!drm_psb_disable_vsync && (vdc_stat & _PSB_VSYNC_PIPEA_FLAG)) { |
11813 | + pipe_stats = PSB_RVDC32(PSB_PIPEASTAT); | 10771 | + pipe_stats = PSB_RVDC32(PSB_PIPEASTAT); |
11814 | + atomic_inc(&dev->vbl_received); | 10772 | + atomic_inc(&dev->_vblank_count[0]); |
11815 | + wake = 1; | 10773 | + wake = 1; |
11816 | + PSB_WVDC32(pipe_stats | _PSB_VBLANK_INTERRUPT_ENABLE | | 10774 | + PSB_WVDC32(pipe_stats | _PSB_VBLANK_INTERRUPT_ENABLE | |
11817 | + _PSB_VBLANK_CLEAR, PSB_PIPEASTAT); | 10775 | + _PSB_VBLANK_CLEAR, PSB_PIPEASTAT); |
@@ -11819,7 +10777,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_irq.c | |||
11819 | + | 10777 | + |
11820 | + if (!drm_psb_disable_vsync && (vdc_stat & _PSB_VSYNC_PIPEB_FLAG)) { | 10778 | + if (!drm_psb_disable_vsync && (vdc_stat & _PSB_VSYNC_PIPEB_FLAG)) { |
11821 | + pipe_stats = PSB_RVDC32(PSB_PIPEBSTAT); | 10779 | + pipe_stats = PSB_RVDC32(PSB_PIPEBSTAT); |
11822 | + atomic_inc(&dev->vbl_received2); | 10780 | + atomic_inc(&dev->_vblank_count[1]); |
11823 | + wake = 1; | 10781 | + wake = 1; |
11824 | + PSB_WVDC32(pipe_stats | _PSB_VBLANK_INTERRUPT_ENABLE | | 10782 | + PSB_WVDC32(pipe_stats | _PSB_VBLANK_INTERRUPT_ENABLE | |
11825 | + _PSB_VBLANK_CLEAR, PSB_PIPEBSTAT); | 10783 | + _PSB_VBLANK_CLEAR, PSB_PIPEBSTAT); |
@@ -11830,8 +10788,11 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_irq.c | |||
11830 | + DRM_READMEMORYBARRIER(); | 10788 | + DRM_READMEMORYBARRIER(); |
11831 | + | 10789 | + |
11832 | + if (wake) { | 10790 | + if (wake) { |
11833 | + DRM_WAKEUP(&dev->vbl_queue); | 10791 | + int i; |
11834 | + drm_vbl_send_signals(dev); | 10792 | + DRM_WAKEUP(dev->vbl_queue); |
10793 | + | ||
10794 | + for (i = 0; i < 2; i++) | ||
10795 | + drm_vbl_send_signals(dev, i); | ||
11835 | + } | 10796 | + } |
11836 | +} | 10797 | +} |
11837 | + | 10798 | + |
@@ -11842,8 +10803,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_irq.c | |||
11842 | +static void psb_sgx_interrupt(struct drm_device *dev, uint32_t sgx_stat, | 10803 | +static void psb_sgx_interrupt(struct drm_device *dev, uint32_t sgx_stat, |
11843 | + uint32_t sgx_stat2) | 10804 | + uint32_t sgx_stat2) |
11844 | +{ | 10805 | +{ |
11845 | + struct drm_psb_private *dev_priv = | 10806 | + struct drm_psb_private *dev_priv = dev->dev_private; |
11846 | + (struct drm_psb_private *)dev->dev_private; | ||
11847 | + | 10807 | + |
11848 | + if (sgx_stat & _PSB_CE_TWOD_COMPLETE) { | 10808 | + if (sgx_stat & _PSB_CE_TWOD_COMPLETE) { |
11849 | + DRM_WAKEUP(&dev_priv->event_2d_queue); | 10809 | + DRM_WAKEUP(&dev_priv->event_2d_queue); |
@@ -12094,14 +11054,14 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_irq.c | |||
12094 | + ++dev_priv->irqen_count_2d; | 11054 | + ++dev_priv->irqen_count_2d; |
12095 | + spin_unlock_irqrestore(&dev_priv->irqmask_lock, irqflags); | 11055 | + spin_unlock_irqrestore(&dev_priv->irqmask_lock, irqflags); |
12096 | +} | 11056 | +} |
12097 | + | 11057 | +#if 0 |
12098 | +static int psb_vblank_do_wait(struct drm_device *dev, unsigned int *sequence, | 11058 | +static int psb_vblank_do_wait(struct drm_device *dev, unsigned int *sequence, |
12099 | + atomic_t * counter) | 11059 | + atomic_t * counter, int crtc) |
12100 | +{ | 11060 | +{ |
12101 | + unsigned int cur_vblank; | 11061 | + unsigned int cur_vblank; |
12102 | + int ret = 0; | 11062 | + int ret = 0; |
12103 | + | 11063 | + |
12104 | + DRM_WAIT_ON(ret, dev->vbl_queue, 3 * DRM_HZ, | 11064 | + DRM_WAIT_ON(ret, dev->vbl_queue[crtc], 3 * DRM_HZ, |
12105 | + (((cur_vblank = atomic_read(counter)) | 11065 | + (((cur_vblank = atomic_read(counter)) |
12106 | + - *sequence) <= (1 << 23))); | 11066 | + - *sequence) <= (1 << 23))); |
12107 | + | 11067 | + |
@@ -12114,7 +11074,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_irq.c | |||
12114 | +{ | 11074 | +{ |
12115 | + int ret; | 11075 | + int ret; |
12116 | + | 11076 | + |
12117 | + ret = psb_vblank_do_wait(dev, sequence, &dev->vbl_received); | 11077 | + ret = psb_vblank_do_wait(dev, sequence, &dev->_vblank_count[0], 0); |
12118 | + return ret; | 11078 | + return ret; |
12119 | +} | 11079 | +} |
12120 | + | 11080 | + |
@@ -12122,9 +11082,10 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_irq.c | |||
12122 | +{ | 11082 | +{ |
12123 | + int ret; | 11083 | + int ret; |
12124 | + | 11084 | + |
12125 | + ret = psb_vblank_do_wait(dev, sequence, &dev->vbl_received2); | 11085 | + ret = psb_vblank_do_wait(dev, sequence, &dev->_vblank_count[1], 1); |
12126 | + return ret; | 11086 | + return ret; |
12127 | +} | 11087 | +} |
11088 | +#endif | ||
12128 | + | 11089 | + |
12129 | +void psb_msvdx_irq_off(struct drm_psb_private *dev_priv) | 11090 | +void psb_msvdx_irq_off(struct drm_psb_private *dev_priv) |
12130 | +{ | 11091 | +{ |
@@ -12154,7 +11115,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_irq.c | |||
12154 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_mmu.c | 11115 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_mmu.c |
12155 | =================================================================== | 11116 | =================================================================== |
12156 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 11117 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
12157 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_mmu.c 2009-02-12 09:14:42.000000000 +0000 | 11118 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_mmu.c 2009-02-20 12:23:06.000000000 +0000 |
12158 | @@ -0,0 +1,1037 @@ | 11119 | @@ -0,0 +1,1037 @@ |
12159 | +/************************************************************************** | 11120 | +/************************************************************************** |
12160 | + * Copyright (c) 2007, Intel Corporation. | 11121 | + * Copyright (c) 2007, Intel Corporation. |
@@ -13196,8 +12157,8 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_mmu.c | |||
13196 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_msvdx.c | 12157 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_msvdx.c |
13197 | =================================================================== | 12158 | =================================================================== |
13198 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 12159 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
13199 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_msvdx.c 2009-02-12 09:14:42.000000000 +0000 | 12160 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_msvdx.c 2009-02-20 12:47:58.000000000 +0000 |
13200 | @@ -0,0 +1,678 @@ | 12161 | @@ -0,0 +1,671 @@ |
13201 | +/** | 12162 | +/** |
13202 | + * file psb_msvdx.c | 12163 | + * file psb_msvdx.c |
13203 | + * MSVDX I/O operations and IRQ handling | 12164 | + * MSVDX I/O operations and IRQ handling |
@@ -13517,13 +12478,6 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_msvdx.c | |||
13517 | + return ret; | 12478 | + return ret; |
13518 | +} | 12479 | +} |
13519 | + | 12480 | + |
13520 | +/*********************************************************************************** | ||
13521 | + * Function Name : psb_mtx_send | ||
13522 | + * Inputs : | ||
13523 | + * Outputs : | ||
13524 | + * Returns : | ||
13525 | + * Description : | ||
13526 | + ************************************************************************************/ | ||
13527 | +int | 12481 | +int |
13528 | +psb_mtx_send (struct drm_psb_private *dev_priv, const void *pvMsg) | 12482 | +psb_mtx_send (struct drm_psb_private *dev_priv, const void *pvMsg) |
13529 | +{ | 12483 | +{ |
@@ -13879,7 +12833,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_msvdx.c | |||
13879 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_msvdx.h | 12833 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_msvdx.h |
13880 | =================================================================== | 12834 | =================================================================== |
13881 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 12835 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
13882 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_msvdx.h 2009-02-12 09:14:42.000000000 +0000 | 12836 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_msvdx.h 2009-02-20 12:23:06.000000000 +0000 |
13883 | @@ -0,0 +1,564 @@ | 12837 | @@ -0,0 +1,564 @@ |
13884 | +/************************************************************************** | 12838 | +/************************************************************************** |
13885 | + * | 12839 | + * |
@@ -14448,7 +13402,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_msvdx.h | |||
14448 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_msvdxinit.c | 13402 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_msvdxinit.c |
14449 | =================================================================== | 13403 | =================================================================== |
14450 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 13404 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
14451 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_msvdxinit.c 2009-02-12 09:14:42.000000000 +0000 | 13405 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_msvdxinit.c 2009-02-20 12:23:06.000000000 +0000 |
14452 | @@ -0,0 +1,625 @@ | 13406 | @@ -0,0 +1,625 @@ |
14453 | +/** | 13407 | +/** |
14454 | + * file psb_msvdxinit.c | 13408 | + * file psb_msvdxinit.c |
@@ -15078,7 +14032,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_msvdxinit.c | |||
15078 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_reg.h | 14032 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_reg.h |
15079 | =================================================================== | 14033 | =================================================================== |
15080 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 14034 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
15081 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_reg.h 2009-02-12 09:14:42.000000000 +0000 | 14035 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_reg.h 2009-02-20 12:23:06.000000000 +0000 |
15082 | @@ -0,0 +1,562 @@ | 14036 | @@ -0,0 +1,562 @@ |
15083 | +/************************************************************************** | 14037 | +/************************************************************************** |
15084 | + * | 14038 | + * |
@@ -15645,7 +14599,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_reg.h | |||
15645 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_regman.c | 14599 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_regman.c |
15646 | =================================================================== | 14600 | =================================================================== |
15647 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 14601 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
15648 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_regman.c 2009-02-12 09:14:42.000000000 +0000 | 14602 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_regman.c 2009-02-20 12:23:06.000000000 +0000 |
15649 | @@ -0,0 +1,175 @@ | 14603 | @@ -0,0 +1,175 @@ |
15650 | +/************************************************************************** | 14604 | +/************************************************************************** |
15651 | + * Copyright (c) 2007, Intel Corporation. | 14605 | + * Copyright (c) 2007, Intel Corporation. |
@@ -15825,7 +14779,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_regman.c | |||
15825 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_reset.c | 14779 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_reset.c |
15826 | =================================================================== | 14780 | =================================================================== |
15827 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 14781 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
15828 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_reset.c 2009-02-12 09:14:42.000000000 +0000 | 14782 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_reset.c 2009-02-20 12:23:06.000000000 +0000 |
15829 | @@ -0,0 +1,374 @@ | 14783 | @@ -0,0 +1,374 @@ |
15830 | +/************************************************************************** | 14784 | +/************************************************************************** |
15831 | + * Copyright (c) 2007, Intel Corporation. | 14785 | + * Copyright (c) 2007, Intel Corporation. |
@@ -16204,7 +15158,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_reset.c | |||
16204 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_scene.c | 15158 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_scene.c |
16205 | =================================================================== | 15159 | =================================================================== |
16206 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 15160 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
16207 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_scene.c 2009-02-12 09:14:42.000000000 +0000 | 15161 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_scene.c 2009-02-20 12:23:06.000000000 +0000 |
16208 | @@ -0,0 +1,531 @@ | 15162 | @@ -0,0 +1,531 @@ |
16209 | +/************************************************************************** | 15163 | +/************************************************************************** |
16210 | + * Copyright (c) 2007, Intel Corporation. | 15164 | + * Copyright (c) 2007, Intel Corporation. |
@@ -16740,7 +15694,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_scene.c | |||
16740 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_scene.h | 15694 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_scene.h |
16741 | =================================================================== | 15695 | =================================================================== |
16742 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 15696 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
16743 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_scene.h 2009-02-12 09:14:42.000000000 +0000 | 15697 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_scene.h 2009-02-20 12:23:06.000000000 +0000 |
16744 | @@ -0,0 +1,112 @@ | 15698 | @@ -0,0 +1,112 @@ |
16745 | +/************************************************************************** | 15699 | +/************************************************************************** |
16746 | + * Copyright (c) 2007, Intel Corporation. | 15700 | + * Copyright (c) 2007, Intel Corporation. |
@@ -16857,7 +15811,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_scene.h | |||
16857 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_schedule.c | 15811 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_schedule.c |
16858 | =================================================================== | 15812 | =================================================================== |
16859 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 15813 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
16860 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_schedule.c 2009-02-12 09:14:42.000000000 +0000 | 15814 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_schedule.c 2009-02-20 12:23:06.000000000 +0000 |
16861 | @@ -0,0 +1,1445 @@ | 15815 | @@ -0,0 +1,1445 @@ |
16862 | +/************************************************************************** | 15816 | +/************************************************************************** |
16863 | + * Copyright (c) 2007, Intel Corporation. | 15817 | + * Copyright (c) 2007, Intel Corporation. |
@@ -18307,7 +17261,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_schedule.c | |||
18307 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_schedule.h | 17261 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_schedule.h |
18308 | =================================================================== | 17262 | =================================================================== |
18309 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 17263 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
18310 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_schedule.h 2009-02-12 09:14:42.000000000 +0000 | 17264 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_schedule.h 2009-02-20 12:23:06.000000000 +0000 |
18311 | @@ -0,0 +1,170 @@ | 17265 | @@ -0,0 +1,170 @@ |
18312 | +/************************************************************************** | 17266 | +/************************************************************************** |
18313 | + * Copyright (c) 2007, Intel Corporation. | 17267 | + * Copyright (c) 2007, Intel Corporation. |
@@ -18479,33 +17433,10 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_schedule.h | |||
18479 | +extern int psb_extend_raster_timeout(struct drm_psb_private *dev_priv); | 17433 | +extern int psb_extend_raster_timeout(struct drm_psb_private *dev_priv); |
18480 | + | 17434 | + |
18481 | +#endif | 17435 | +#endif |
18482 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_setup.c | ||
18483 | =================================================================== | ||
18484 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
18485 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_setup.c 2009-02-12 09:59:18.000000000 +0000 | ||
18486 | @@ -0,0 +1,18 @@ | ||
18487 | +#include "drmP.h" | ||
18488 | +#include "drm.h" | ||
18489 | +#include "drm_crtc.h" | ||
18490 | +#include "drm_edid.h" | ||
18491 | +#include "psb_drm.h" | ||
18492 | +#include "psb_priv.h" | ||
18493 | +//#include "i915_reg.h" | ||
18494 | +//#include "intel_drv.h" | ||
18495 | +#include "../i915/intel_crt.c" | ||
18496 | + | ||
18497 | +/* Fixed name */ | ||
18498 | +#define ACPI_EDID_LCD "\\_SB_.PCI0.GFX0.DD04._DDC" | ||
18499 | +#define ACPI_DOD "\\_SB_.PCI0.GFX0._DOD" | ||
18500 | + | ||
18501 | +#include "../i915/intel_lvds.c" | ||
18502 | +#include "../i915/intel_sdvo.c" | ||
18503 | +#include "../i915/intel_display.c" | ||
18504 | +#include "../i915/intel_modes.c" | ||
18505 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_sgx.c | 17436 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_sgx.c |
18506 | =================================================================== | 17437 | =================================================================== |
18507 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 17438 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
18508 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_sgx.c 2009-02-12 09:14:42.000000000 +0000 | 17439 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_sgx.c 2009-02-20 12:23:06.000000000 +0000 |
18509 | @@ -0,0 +1,1422 @@ | 17440 | @@ -0,0 +1,1422 @@ |
18510 | +/************************************************************************** | 17441 | +/************************************************************************** |
18511 | + * Copyright (c) 2007, Intel Corporation. | 17442 | + * Copyright (c) 2007, Intel Corporation. |
@@ -19932,7 +18863,7 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_sgx.c | |||
19932 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_xhw.c | 18863 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_xhw.c |
19933 | =================================================================== | 18864 | =================================================================== |
19934 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 18865 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
19935 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_xhw.c 2009-02-12 09:14:42.000000000 +0000 | 18866 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_xhw.c 2009-02-20 12:23:06.000000000 +0000 |
19936 | @@ -0,0 +1,614 @@ | 18867 | @@ -0,0 +1,614 @@ |
19937 | +/************************************************************************** | 18868 | +/************************************************************************** |
19938 | + * Copyright (c) 2007, Intel Corporation. | 18869 | + * Copyright (c) 2007, Intel Corporation. |
@@ -20550,9 +19481,9 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_xhw.c | |||
20550 | +} | 19481 | +} |
20551 | Index: linux-2.6.28/drivers/gpu/drm/Kconfig | 19482 | Index: linux-2.6.28/drivers/gpu/drm/Kconfig |
20552 | =================================================================== | 19483 | =================================================================== |
20553 | --- linux-2.6.28.orig/drivers/gpu/drm/Kconfig 2009-02-12 09:14:37.000000000 +0000 | 19484 | --- linux-2.6.28.orig/drivers/gpu/drm/Kconfig 2009-02-20 12:22:54.000000000 +0000 |
20554 | +++ linux-2.6.28/drivers/gpu/drm/Kconfig 2009-02-12 09:14:42.000000000 +0000 | 19485 | +++ linux-2.6.28/drivers/gpu/drm/Kconfig 2009-02-20 12:23:06.000000000 +0000 |
20555 | @@ -123,3 +123,9 @@ | 19486 | @@ -129,3 +129,10 @@ |
20556 | help | 19487 | help |
20557 | Choose this option if you have a Savage3D/4/SuperSavage/Pro/Twister | 19488 | Choose this option if you have a Savage3D/4/SuperSavage/Pro/Twister |
20558 | chipset. If M is selected the module will be called savage. | 19489 | chipset. If M is selected the module will be called savage. |
@@ -20560,12 +19491,13 @@ Index: linux-2.6.28/drivers/gpu/drm/Kconfig | |||
20560 | +config DRM_PSB | 19491 | +config DRM_PSB |
20561 | + tristate "Intel Poulsbo" | 19492 | + tristate "Intel Poulsbo" |
20562 | + depends on DRM && PCI && I2C_ALGOBIT | 19493 | + depends on DRM && PCI && I2C_ALGOBIT |
19494 | + select DRM_INTEL_COMMON | ||
20563 | + help | 19495 | + help |
20564 | + Choose this option if you have an Intel Poulsbo chipset. | 19496 | + Choose this option if you have an Intel Poulsbo chipset. |
20565 | Index: linux-2.6.28/include/drm/drm_objects.h | 19497 | Index: linux-2.6.28/include/drm/drm_objects.h |
20566 | =================================================================== | 19498 | =================================================================== |
20567 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 19499 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
20568 | +++ linux-2.6.28/include/drm/drm_objects.h 2009-02-12 09:14:42.000000000 +0000 | 19500 | +++ linux-2.6.28/include/drm/drm_objects.h 2009-02-20 12:23:06.000000000 +0000 |
20569 | @@ -0,0 +1,717 @@ | 19501 | @@ -0,0 +1,717 @@ |
20570 | +/************************************************************************** | 19502 | +/************************************************************************** |
20571 | + * | 19503 | + * |
@@ -21284,32 +20216,10 @@ Index: linux-2.6.28/include/drm/drm_objects.h | |||
21284 | +#define DRM_ASSERT_LOCKED(_mutex) | 20216 | +#define DRM_ASSERT_LOCKED(_mutex) |
21285 | +#endif | 20217 | +#endif |
21286 | +#endif | 20218 | +#endif |
21287 | Index: linux-2.6.28/drivers/gpu/drm/drm_proc.c | ||
21288 | =================================================================== | ||
21289 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_proc.c 2009-02-12 09:14:37.000000000 +0000 | ||
21290 | +++ linux-2.6.28/drivers/gpu/drm/drm_proc.c 2009-02-12 09:14:42.000000000 +0000 | ||
21291 | @@ -489,13 +489,13 @@ | ||
21292 | |||
21293 | for (crtc = 0; crtc < dev->num_crtcs; crtc++) { | ||
21294 | DRM_PROC_PRINT("CRTC %d enable: %d\n", | ||
21295 | - crtc, atomic_read(&dev->vblank_refcount[crtc])); | ||
21296 | + crtc, 1); | ||
21297 | DRM_PROC_PRINT("CRTC %d counter: %d\n", | ||
21298 | - crtc, drm_vblank_count(dev, crtc)); | ||
21299 | + crtc, 1); | ||
21300 | DRM_PROC_PRINT("CRTC %d last wait: %d\n", | ||
21301 | - crtc, dev->last_vblank_wait[crtc]); | ||
21302 | + crtc, 1); | ||
21303 | DRM_PROC_PRINT("CRTC %d in modeset: %d\n", | ||
21304 | - crtc, dev->vblank_inmodeset[crtc]); | ||
21305 | + crtc, 1); | ||
21306 | } | ||
21307 | |||
21308 | if (len > request + offset) | ||
21309 | Index: linux-2.6.28/drivers/gpu/drm/drm_crtc.c | 20219 | Index: linux-2.6.28/drivers/gpu/drm/drm_crtc.c |
21310 | =================================================================== | 20220 | =================================================================== |
21311 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_crtc.c 2009-02-12 09:14:37.000000000 +0000 | 20221 | --- linux-2.6.28.orig/drivers/gpu/drm/drm_crtc.c 2009-02-20 12:22:54.000000000 +0000 |
21312 | +++ linux-2.6.28/drivers/gpu/drm/drm_crtc.c 2009-02-12 09:14:42.000000000 +0000 | 20222 | +++ linux-2.6.28/drivers/gpu/drm/drm_crtc.c 2009-02-20 12:23:06.000000000 +0000 |
21313 | @@ -807,6 +807,53 @@ | 20223 | @@ -807,6 +807,53 @@ |
21314 | } | 20224 | } |
21315 | EXPORT_SYMBOL(drm_mode_config_init); | 20225 | EXPORT_SYMBOL(drm_mode_config_init); |
@@ -21457,8 +20367,8 @@ Index: linux-2.6.28/drivers/gpu/drm/drm_crtc.c | |||
21457 | } | 20367 | } |
21458 | Index: linux-2.6.28/include/drm/drm_crtc.h | 20368 | Index: linux-2.6.28/include/drm/drm_crtc.h |
21459 | =================================================================== | 20369 | =================================================================== |
21460 | --- linux-2.6.28.orig/include/drm/drm_crtc.h 2009-02-12 09:14:40.000000000 +0000 | 20370 | --- linux-2.6.28.orig/include/drm/drm_crtc.h 2009-02-20 12:22:53.000000000 +0000 |
21461 | +++ linux-2.6.28/include/drm/drm_crtc.h 2009-02-12 09:14:42.000000000 +0000 | 20371 | +++ linux-2.6.28/include/drm/drm_crtc.h 2009-02-20 12:23:06.000000000 +0000 |
21462 | @@ -50,6 +50,8 @@ | 20372 | @@ -50,6 +50,8 @@ |
21463 | uint32_t type; | 20373 | uint32_t type; |
21464 | }; | 20374 | }; |
@@ -21478,50 +20388,10 @@ Index: linux-2.6.28/include/drm/drm_crtc.h | |||
21478 | struct list_head filp_head; | 20388 | struct list_head filp_head; |
21479 | }; | 20389 | }; |
21480 | 20390 | ||
21481 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_crt.c | ||
21482 | =================================================================== | ||
21483 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_crt.c 2009-02-12 09:14:37.000000000 +0000 | ||
21484 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_crt.c 2009-02-12 16:12:38.000000000 +0000 | ||
21485 | @@ -36,7 +36,7 @@ | ||
21486 | static void intel_crt_dpms(struct drm_encoder *encoder, int mode) | ||
21487 | { | ||
21488 | struct drm_device *dev = encoder->dev; | ||
21489 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
21490 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
21491 | u32 temp; | ||
21492 | |||
21493 | temp = I915_READ(ADPA); | ||
21494 | @@ -88,7 +88,7 @@ | ||
21495 | struct drm_device *dev = encoder->dev; | ||
21496 | struct drm_crtc *crtc = encoder->crtc; | ||
21497 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
21498 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
21499 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
21500 | int dpll_md_reg; | ||
21501 | u32 adpa, dpll_md; | ||
21502 | |||
21503 | @@ -132,7 +132,7 @@ | ||
21504 | static bool intel_crt_detect_hotplug(struct drm_connector *connector) | ||
21505 | { | ||
21506 | struct drm_device *dev = connector->dev; | ||
21507 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
21508 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
21509 | u32 temp; | ||
21510 | |||
21511 | unsigned long timeout = jiffies + msecs_to_jiffies(1000); | ||
21512 | @@ -170,7 +170,7 @@ | ||
21513 | { | ||
21514 | struct drm_device *dev = connector->dev; | ||
21515 | |||
21516 | - if (IS_I9XX(dev) && !IS_I915G(dev) && !IS_I915GM(dev)) { | ||
21517 | + if (IS_I945G(dev) || IS_I945GM(dev) || IS_I965G(dev)) { | ||
21518 | if (intel_crt_detect_hotplug(connector)) | ||
21519 | return connector_status_connected; | ||
21520 | else | ||
21521 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | 20391 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c |
21522 | =================================================================== | 20392 | =================================================================== |
21523 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_lvds.c 2009-02-12 09:14:37.000000000 +0000 | 20393 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_lvds.c 2009-02-20 12:22:54.000000000 +0000 |
21524 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c 2009-02-12 16:13:08.000000000 +0000 | 20394 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c 2009-02-20 12:23:06.000000000 +0000 |
21525 | @@ -36,6 +36,259 @@ | 20395 | @@ -36,6 +36,259 @@ |
21526 | #include "i915_drm.h" | 20396 | #include "i915_drm.h" |
21527 | #include "i915_drv.h" | 20397 | #include "i915_drv.h" |
@@ -21762,7 +20632,7 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
21762 | +static u32 | 20632 | +static u32 |
21763 | +LVDSGetPWMMaxBacklight(struct drm_device *dev) | 20633 | +LVDSGetPWMMaxBacklight(struct drm_device *dev) |
21764 | +{ | 20634 | +{ |
21765 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | 20635 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; |
21766 | + u32 max_pwm_blc = 0; | 20636 | + u32 max_pwm_blc = 0; |
21767 | + | 20637 | + |
21768 | + max_pwm_blc = ((I915_READ(BLC_PWM_CTL) & BACKLIGHT_MODULATION_FREQ_MASK) >> \ | 20638 | + max_pwm_blc = ((I915_READ(BLC_PWM_CTL) & BACKLIGHT_MODULATION_FREQ_MASK) >> \ |
@@ -21787,7 +20657,7 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
21787 | static void intel_lvds_set_backlight(struct drm_device *dev, int level) | 20657 | static void intel_lvds_set_backlight(struct drm_device *dev, int level) |
21788 | { | 20658 | { |
21789 | - struct drm_i915_private *dev_priv = dev->dev_private; | 20659 | - struct drm_i915_private *dev_priv = dev->dev_private; |
21790 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | 20660 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; |
21791 | + /* | 20661 | + /* |
21792 | u32 blc_pwm_ctl; | 20662 | u32 blc_pwm_ctl; |
21793 | 20663 | ||
@@ -21839,7 +20709,7 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
21839 | - struct drm_i915_private *dev_priv = dev->dev_private; | 20709 | - struct drm_i915_private *dev_priv = dev->dev_private; |
21840 | + return BRIGHTNESS_MAX_LEVEL; | 20710 | + return BRIGHTNESS_MAX_LEVEL; |
21841 | + /* | 20711 | + /* |
21842 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | 20712 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; |
21843 | 20713 | ||
21844 | return ((I915_READ(BLC_PWM_CTL) & BACKLIGHT_MODULATION_FREQ_MASK) >> | 20714 | return ((I915_READ(BLC_PWM_CTL) & BACKLIGHT_MODULATION_FREQ_MASK) >> |
21845 | BACKLIGHT_MODULATION_FREQ_SHIFT) * 2; | 20715 | BACKLIGHT_MODULATION_FREQ_SHIFT) * 2; |
@@ -21847,19 +20717,7 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
21847 | } | 20717 | } |
21848 | 20718 | ||
21849 | /** | 20719 | /** |
21850 | @@ -67,9 +359,10 @@ | 20720 | @@ -77,7 +369,7 @@ |
21851 | */ | ||
21852 | static void intel_lvds_set_power(struct drm_device *dev, bool on) | ||
21853 | { | ||
21854 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
21855 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
21856 | u32 pp_status; | ||
21857 | |||
21858 | + DRM_INFO("intel_lvds_set_power: %d\n", on); | ||
21859 | if (on) { | ||
21860 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | | ||
21861 | POWER_TARGET_ON); | ||
21862 | @@ -77,7 +370,7 @@ | ||
21863 | pp_status = I915_READ(PP_STATUS); | 20721 | pp_status = I915_READ(PP_STATUS); |
21864 | } while ((pp_status & PP_ON) == 0); | 20722 | } while ((pp_status & PP_ON) == 0); |
21865 | 20723 | ||
@@ -21868,7 +20726,7 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
21868 | } else { | 20726 | } else { |
21869 | intel_lvds_set_backlight(dev, 0); | 20727 | intel_lvds_set_backlight(dev, 0); |
21870 | 20728 | ||
21871 | @@ -93,6 +386,7 @@ | 20729 | @@ -93,6 +385,7 @@ |
21872 | { | 20730 | { |
21873 | struct drm_device *dev = encoder->dev; | 20731 | struct drm_device *dev = encoder->dev; |
21874 | 20732 | ||
@@ -21876,54 +20734,7 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
21876 | if (mode == DRM_MODE_DPMS_ON) | 20734 | if (mode == DRM_MODE_DPMS_ON) |
21877 | intel_lvds_set_power(dev, true); | 20735 | intel_lvds_set_power(dev, true); |
21878 | else | 20736 | else |
21879 | @@ -104,12 +398,12 @@ | 20737 | @@ -152,6 +445,13 @@ |
21880 | static void intel_lvds_save(struct drm_connector *connector) | ||
21881 | { | ||
21882 | struct drm_device *dev = connector->dev; | ||
21883 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
21884 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
21885 | |||
21886 | dev_priv->savePP_ON = I915_READ(PP_ON_DELAYS); | ||
21887 | dev_priv->savePP_OFF = I915_READ(PP_OFF_DELAYS); | ||
21888 | dev_priv->savePP_CONTROL = I915_READ(PP_CONTROL); | ||
21889 | - dev_priv->savePP_DIVISOR = I915_READ(PP_DIVISOR); | ||
21890 | + dev_priv->savePP_CYCLE = I915_READ(PP_DIVISOR); | ||
21891 | dev_priv->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL); | ||
21892 | dev_priv->backlight_duty_cycle = (dev_priv->saveBLC_PWM_CTL & | ||
21893 | BACKLIGHT_DUTY_CYCLE_MASK); | ||
21894 | @@ -118,19 +412,19 @@ | ||
21895 | * If the light is off at server startup, just make it full brightness | ||
21896 | */ | ||
21897 | if (dev_priv->backlight_duty_cycle == 0) | ||
21898 | - dev_priv->backlight_duty_cycle = | ||
21899 | + lvds_backlight= | ||
21900 | intel_lvds_get_max_backlight(dev); | ||
21901 | } | ||
21902 | |||
21903 | static void intel_lvds_restore(struct drm_connector *connector) | ||
21904 | { | ||
21905 | struct drm_device *dev = connector->dev; | ||
21906 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
21907 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
21908 | |||
21909 | I915_WRITE(BLC_PWM_CTL, dev_priv->saveBLC_PWM_CTL); | ||
21910 | I915_WRITE(PP_ON_DELAYS, dev_priv->savePP_ON); | ||
21911 | I915_WRITE(PP_OFF_DELAYS, dev_priv->savePP_OFF); | ||
21912 | - I915_WRITE(PP_DIVISOR, dev_priv->savePP_DIVISOR); | ||
21913 | + I915_WRITE(PP_DIVISOR, dev_priv->savePP_CYCLE); | ||
21914 | I915_WRITE(PP_CONTROL, dev_priv->savePP_CONTROL); | ||
21915 | if (dev_priv->savePP_CONTROL & POWER_TARGET_ON) | ||
21916 | intel_lvds_set_power(dev, true); | ||
21917 | @@ -142,7 +436,7 @@ | ||
21918 | struct drm_display_mode *mode) | ||
21919 | { | ||
21920 | struct drm_device *dev = connector->dev; | ||
21921 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
21922 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
21923 | struct drm_display_mode *fixed_mode = dev_priv->panel_fixed_mode; | ||
21924 | |||
21925 | if (fixed_mode) { | ||
21926 | @@ -152,6 +446,13 @@ | ||
21927 | return MODE_PANEL; | 20738 | return MODE_PANEL; |
21928 | } | 20739 | } |
21929 | 20740 | ||
@@ -21937,53 +20748,72 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
21937 | return MODE_OK; | 20748 | return MODE_OK; |
21938 | } | 20749 | } |
21939 | 20750 | ||
21940 | @@ -160,7 +461,7 @@ | 20751 | @@ -185,20 +485,20 @@ |
21941 | struct drm_display_mode *adjusted_mode) | 20752 | * with the panel scaling set up to source from the H/VDisplay |
21942 | { | 20753 | * of the original mode. |
21943 | struct drm_device *dev = encoder->dev; | 20754 | */ |
21944 | - struct drm_i915_private *dev_priv = dev->dev_private; | 20755 | - if (dev_priv->panel_fixed_mode != NULL) { |
21945 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | 20756 | - adjusted_mode->hdisplay = dev_priv->panel_fixed_mode->hdisplay; |
21946 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); | 20757 | + if (dev_priv_common->panel_fixed_mode != NULL) { |
21947 | struct drm_encoder *tmp_encoder; | 20758 | + adjusted_mode->hdisplay = dev_priv_common->panel_fixed_mode->hdisplay; |
20759 | adjusted_mode->hsync_start = | ||
20760 | - dev_priv->panel_fixed_mode->hsync_start; | ||
20761 | + dev_priv_common->panel_fixed_mode->hsync_start; | ||
20762 | adjusted_mode->hsync_end = | ||
20763 | - dev_priv->panel_fixed_mode->hsync_end; | ||
20764 | - adjusted_mode->htotal = dev_priv->panel_fixed_mode->htotal; | ||
20765 | - adjusted_mode->vdisplay = dev_priv->panel_fixed_mode->vdisplay; | ||
20766 | + dev_priv_common->panel_fixed_mode->hsync_end; | ||
20767 | + adjusted_mode->htotal = dev_priv_common->panel_fixed_mode->htotal; | ||
20768 | + adjusted_mode->vdisplay = dev_priv_common->panel_fixed_mode->vdisplay; | ||
20769 | adjusted_mode->vsync_start = | ||
20770 | - dev_priv->panel_fixed_mode->vsync_start; | ||
20771 | + dev_priv_common->panel_fixed_mode->vsync_start; | ||
20772 | adjusted_mode->vsync_end = | ||
20773 | - dev_priv->panel_fixed_mode->vsync_end; | ||
20774 | - adjusted_mode->vtotal = dev_priv->panel_fixed_mode->vtotal; | ||
20775 | - adjusted_mode->clock = dev_priv->panel_fixed_mode->clock; | ||
20776 | + dev_priv_common->panel_fixed_mode->vsync_end; | ||
20777 | + adjusted_mode->vtotal = dev_priv_common->panel_fixed_mode->vtotal; | ||
20778 | + adjusted_mode->clock = dev_priv_common->panel_fixed_mode->clock; | ||
20779 | drm_mode_set_crtcinfo(adjusted_mode, CRTC_INTERLACE_HALVE_V); | ||
20780 | } | ||
21948 | 20781 | ||
21949 | @@ -214,7 +515,7 @@ | 20782 | @@ -214,10 +514,10 @@ |
21950 | static void intel_lvds_prepare(struct drm_encoder *encoder) | 20783 | static void intel_lvds_prepare(struct drm_encoder *encoder) |
21951 | { | 20784 | { |
21952 | struct drm_device *dev = encoder->dev; | 20785 | struct drm_device *dev = encoder->dev; |
21953 | - struct drm_i915_private *dev_priv = dev->dev_private; | 20786 | - struct drm_i915_private *dev_priv = dev->dev_private; |
21954 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | 20787 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; |
20788 | |||
20789 | - dev_priv->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL); | ||
20790 | - dev_priv->backlight_duty_cycle = (dev_priv->saveBLC_PWM_CTL & | ||
20791 | + dev_priv_common->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL); | ||
20792 | + dev_priv_common->backlight_duty_cycle = (dev_priv_common->saveBLC_PWM_CTL & | ||
20793 | BACKLIGHT_DUTY_CYCLE_MASK); | ||
21955 | 20794 | ||
21956 | dev_priv->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL); | 20795 | intel_lvds_set_power(dev, false); |
21957 | dev_priv->backlight_duty_cycle = (dev_priv->saveBLC_PWM_CTL & | 20796 | @@ -226,10 +526,11 @@ |
21958 | @@ -226,10 +527,11 @@ | ||
21959 | static void intel_lvds_commit( struct drm_encoder *encoder) | 20797 | static void intel_lvds_commit( struct drm_encoder *encoder) |
21960 | { | 20798 | { |
21961 | struct drm_device *dev = encoder->dev; | 20799 | struct drm_device *dev = encoder->dev; |
21962 | - struct drm_i915_private *dev_priv = dev->dev_private; | 20800 | - struct drm_i915_private *dev_priv = dev->dev_private; |
21963 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | 20801 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; |
21964 | 20802 | ||
21965 | if (dev_priv->backlight_duty_cycle == 0) | 20803 | - if (dev_priv->backlight_duty_cycle == 0) |
21966 | - dev_priv->backlight_duty_cycle = | 20804 | - dev_priv->backlight_duty_cycle = |
21967 | + //dev_priv->backlight_duty_cycle = | 20805 | + if (dev_priv_common->backlight_duty_cycle == 0) |
20806 | + //dev_priv_common->backlight_duty_cycle = | ||
21968 | + lvds_backlight = | 20807 | + lvds_backlight = |
21969 | intel_lvds_get_max_backlight(dev); | 20808 | intel_lvds_get_max_backlight(dev); |
21970 | 20809 | ||
21971 | intel_lvds_set_power(dev, true); | 20810 | intel_lvds_set_power(dev, true); |
21972 | @@ -240,7 +542,7 @@ | 20811 | @@ -291,10 +592,12 @@ |
21973 | struct drm_display_mode *adjusted_mode) | ||
21974 | { | ||
21975 | struct drm_device *dev = encoder->dev; | ||
21976 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
21977 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
21978 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); | ||
21979 | u32 pfit_control; | ||
21980 | |||
21981 | @@ -291,10 +593,12 @@ | ||
21982 | { | 20812 | { |
21983 | struct drm_device *dev = connector->dev; | 20813 | struct drm_device *dev = connector->dev; |
21984 | struct intel_output *intel_output = to_intel_output(connector); | 20814 | struct intel_output *intel_output = to_intel_output(connector); |
21985 | - struct drm_i915_private *dev_priv = dev->dev_private; | 20815 | - struct drm_i915_private *dev_priv = dev->dev_private; |
21986 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | 20816 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; |
21987 | int ret = 0; | 20817 | int ret = 0; |
21988 | 20818 | ||
21989 | + mutex_lock(&dev->mode_config.mutex); | 20819 | + mutex_lock(&dev->mode_config.mutex); |
@@ -21992,7 +20822,21 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
21992 | 20822 | ||
21993 | if (ret) | 20823 | if (ret) |
21994 | return ret; | 20824 | return ret; |
21995 | @@ -333,8 +637,11 @@ | 20825 | @@ -308,11 +611,11 @@ |
20826 | connector->display_info.min_hfreq = 0; | ||
20827 | connector->display_info.max_hfreq = 200; | ||
20828 | |||
20829 | - if (dev_priv->panel_fixed_mode != NULL) { | ||
20830 | + if (dev_priv_common->panel_fixed_mode != NULL) { | ||
20831 | struct drm_display_mode *mode; | ||
20832 | |||
20833 | mutex_unlock(&dev->mode_config.mutex); | ||
20834 | - mode = drm_mode_duplicate(dev, dev_priv->panel_fixed_mode); | ||
20835 | + mode = drm_mode_duplicate(dev, dev_priv_common->panel_fixed_mode); | ||
20836 | drm_mode_probed_add(connector, mode); | ||
20837 | mutex_unlock(&dev->mode_config.mutex); | ||
20838 | |||
20839 | @@ -333,8 +636,11 @@ | ||
21996 | { | 20840 | { |
21997 | struct intel_output *intel_output = to_intel_output(connector); | 20841 | struct intel_output *intel_output = to_intel_output(connector); |
21998 | 20842 | ||
@@ -22004,7 +20848,7 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
22004 | drm_sysfs_connector_remove(connector); | 20848 | drm_sysfs_connector_remove(connector); |
22005 | drm_connector_cleanup(connector); | 20849 | drm_connector_cleanup(connector); |
22006 | kfree(connector); | 20850 | kfree(connector); |
22007 | @@ -373,7 +680,45 @@ | 20851 | @@ -373,7 +679,45 @@ |
22008 | }; | 20852 | }; |
22009 | 20853 | ||
22010 | 20854 | ||
@@ -22051,16 +20895,16 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
22051 | /** | 20895 | /** |
22052 | * intel_lvds_init - setup LVDS connectors on this device | 20896 | * intel_lvds_init - setup LVDS connectors on this device |
22053 | * @dev: drm device | 20897 | * @dev: drm device |
22054 | @@ -383,7 +728,7 @@ | 20898 | @@ -383,7 +727,7 @@ |
22055 | */ | 20899 | */ |
22056 | void intel_lvds_init(struct drm_device *dev) | 20900 | void intel_lvds_init(struct drm_device *dev) |
22057 | { | 20901 | { |
22058 | - struct drm_i915_private *dev_priv = dev->dev_private; | 20902 | - struct drm_i915_private *dev_priv = dev->dev_private; |
22059 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | 20903 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; |
22060 | struct intel_output *intel_output; | 20904 | struct intel_output *intel_output; |
22061 | struct drm_connector *connector; | 20905 | struct drm_connector *connector; |
22062 | struct drm_encoder *encoder; | 20906 | struct drm_encoder *encoder; |
22063 | @@ -391,12 +736,38 @@ | 20907 | @@ -391,12 +735,38 @@ |
22064 | struct drm_crtc *crtc; | 20908 | struct drm_crtc *crtc; |
22065 | u32 lvds; | 20909 | u32 lvds; |
22066 | int pipe; | 20910 | int pipe; |
@@ -22093,13 +20937,13 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
22093 | return; | 20937 | return; |
22094 | } | 20938 | } |
22095 | 20939 | ||
22096 | + if (!drm_intel_ignore_acpi && !intel_get_acpi_dod(ACPI_DOD)) | 20940 | + //if (!drm_intel_ignore_acpi && !intel_get_acpi_dod(ACPI_DOD)) |
22097 | + return; | 20941 | + // return; |
22098 | + | 20942 | + |
22099 | connector = &intel_output->base; | 20943 | connector = &intel_output->base; |
22100 | encoder = &intel_output->enc; | 20944 | encoder = &intel_output->enc; |
22101 | drm_connector_init(dev, &intel_output->base, &intel_lvds_connector_funcs, | 20945 | drm_connector_init(dev, &intel_output->base, &intel_lvds_connector_funcs, |
22102 | @@ -414,16 +785,139 @@ | 20946 | @@ -414,16 +784,139 @@ |
22103 | connector->interlace_allowed = false; | 20947 | connector->interlace_allowed = false; |
22104 | connector->doublescan_allowed = false; | 20948 | connector->doublescan_allowed = false; |
22105 | 20949 | ||
@@ -22114,8 +20958,6 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
22114 | + lvds_backlight = BRIGHTNESS_MAX_LEVEL; | 20958 | + lvds_backlight = BRIGHTNESS_MAX_LEVEL; |
22115 | + blc_type = 0; | 20959 | + blc_type = 0; |
22116 | + blc_pol = 0; | 20960 | + blc_pol = 0; |
22117 | + | ||
22118 | + //get the BLC init data from VBT | ||
22119 | 20961 | ||
22120 | - /* | 20962 | - /* |
22121 | - * LVDS discovery: | 20963 | - * LVDS discovery: |
@@ -22126,6 +20968,8 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
22126 | - * 4) make sure lid is open | 20968 | - * 4) make sure lid is open |
22127 | - * if closed, act like it's not there for now | 20969 | - * if closed, act like it's not there for now |
22128 | - */ | 20970 | - */ |
20971 | + //get the BLC init data from VBT | ||
20972 | + | ||
22129 | + | 20973 | + |
22130 | + | 20974 | + |
22131 | + | 20975 | + |
@@ -22248,7 +21092,7 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
22248 | 21092 | ||
22249 | /* Set up the DDC bus. */ | 21093 | /* Set up the DDC bus. */ |
22250 | intel_output->ddc_bus = intel_i2c_create(dev, GPIOC, "LVDSDDC_C"); | 21094 | intel_output->ddc_bus = intel_i2c_create(dev, GPIOC, "LVDSDDC_C"); |
22251 | @@ -437,7 +931,9 @@ | 21095 | @@ -437,12 +930,14 @@ |
22252 | * Attempt to get the fixed panel mode from DDC. Assume that the | 21096 | * Attempt to get the fixed panel mode from DDC. Assume that the |
22253 | * preferred mode is the right one. | 21097 | * preferred mode is the right one. |
22254 | */ | 21098 | */ |
@@ -22258,7 +21102,13 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
22258 | 21102 | ||
22259 | list_for_each_entry(scan, &connector->probed_modes, head) { | 21103 | list_for_each_entry(scan, &connector->probed_modes, head) { |
22260 | mutex_lock(&dev->mode_config.mutex); | 21104 | mutex_lock(&dev->mode_config.mutex); |
22261 | @@ -450,21 +946,6 @@ | 21105 | if (scan->type & DRM_MODE_TYPE_PREFERRED) { |
21106 | - dev_priv->panel_fixed_mode = | ||
21107 | + dev_priv_common->panel_fixed_mode = | ||
21108 | drm_mode_duplicate(dev, scan); | ||
21109 | mutex_unlock(&dev->mode_config.mutex); | ||
21110 | goto out; /* FIXME: check for quirks */ | ||
21111 | @@ -450,21 +945,6 @@ | ||
22262 | mutex_unlock(&dev->mode_config.mutex); | 21112 | mutex_unlock(&dev->mode_config.mutex); |
22263 | } | 21113 | } |
22264 | 21114 | ||
@@ -22282,132 +21132,60 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_lvds.c | |||
22282 | * on. If so, assume that whatever is currently programmed is the | 21132 | * on. If so, assume that whatever is currently programmed is the |
22283 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_sdvo.c | 21133 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_sdvo.c |
22284 | =================================================================== | 21134 | =================================================================== |
22285 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_sdvo.c 2009-02-12 09:14:37.000000000 +0000 | 21135 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_sdvo.c 2009-02-20 12:22:54.000000000 +0000 |
22286 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_sdvo.c 2009-02-12 16:12:58.000000000 +0000 | 21136 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_sdvo.c 2009-02-20 12:23:06.000000000 +0000 |
22287 | @@ -37,6 +37,14 @@ | 21137 | @@ -37,6 +37,9 @@ |
22288 | 21138 | ||
22289 | #undef SDVO_DEBUG | 21139 | #undef SDVO_DEBUG |
22290 | 21140 | ||
22291 | +#define MAX_VAL 1000 | ||
22292 | +#define DPLL_CLOCK_PHASE_9 (1<<9 | 1<<12) | ||
22293 | + | ||
22294 | +#define PCI_PORT5_REG80_FFUSE 0xD0058000 | 21141 | +#define PCI_PORT5_REG80_FFUSE 0xD0058000 |
22295 | +#define PCI_PORT5_REG80_SDVO_DISABLE 0x0020 | 21142 | +#define PCI_PORT5_REG80_SDVO_DISABLE 0x0020 |
22296 | + | 21143 | + |
22297 | +int SII_1392=0; | ||
22298 | + | ||
22299 | struct intel_sdvo_priv { | 21144 | struct intel_sdvo_priv { |
22300 | struct intel_i2c_chan *i2c_bus; | 21145 | struct intel_i2c_chan *i2c_bus; |
22301 | int slaveaddr; | 21146 | int slaveaddr; |
22302 | @@ -62,7 +70,7 @@ | 21147 | @@ -989,6 +992,21 @@ |
22303 | static void intel_sdvo_write_sdvox(struct intel_output *intel_output, u32 val) | ||
22304 | { | ||
22305 | struct drm_device *dev = intel_output->base.dev; | ||
22306 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
22307 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
22308 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | ||
22309 | u32 bval = val, cval = val; | ||
22310 | int i; | ||
22311 | @@ -552,7 +560,7 @@ | ||
22312 | struct drm_display_mode *adjusted_mode) | ||
22313 | { | ||
22314 | struct drm_device *dev = encoder->dev; | ||
22315 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
22316 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
22317 | struct drm_crtc *crtc = encoder->crtc; | ||
22318 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
22319 | struct intel_output *intel_output = enc_to_intel_output(encoder); | ||
22320 | @@ -659,7 +667,7 @@ | ||
22321 | if (IS_I965G(dev)) { | ||
22322 | /* done in crtc_mode_set as the dpll_md reg must be written | ||
22323 | early */ | ||
22324 | - } else if (IS_I945G(dev) || IS_I945GM(dev)) { | ||
22325 | + } else if (IS_POULSBO(dev) || IS_I945G(dev) || IS_I945GM(dev)) { | ||
22326 | /* done in crtc_mode_set as it lives inside the | ||
22327 | dpll register */ | ||
22328 | } else { | ||
22329 | @@ -672,7 +680,7 @@ | ||
22330 | static void intel_sdvo_dpms(struct drm_encoder *encoder, int mode) | ||
22331 | { | ||
22332 | struct drm_device *dev = encoder->dev; | ||
22333 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
22334 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
22335 | struct intel_output *intel_output = enc_to_intel_output(encoder); | ||
22336 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | ||
22337 | u32 temp; | ||
22338 | @@ -722,7 +730,7 @@ | ||
22339 | static void intel_sdvo_save(struct drm_connector *connector) | ||
22340 | { | ||
22341 | struct drm_device *dev = connector->dev; | ||
22342 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
22343 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
22344 | struct intel_output *intel_output = to_intel_output(connector); | ||
22345 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | ||
22346 | int o; | ||
22347 | @@ -759,7 +767,7 @@ | ||
22348 | static void intel_sdvo_restore(struct drm_connector *connector) | ||
22349 | { | ||
22350 | struct drm_device *dev = connector->dev; | ||
22351 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
22352 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
22353 | struct intel_output *intel_output = to_intel_output(connector); | ||
22354 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | ||
22355 | int o; | ||
22356 | @@ -988,6 +996,32 @@ | ||
22357 | u8 ch[0x40]; | ||
22358 | int i; | 21148 | int i; |
22359 | int encoder_type, output_id; | 21149 | int encoder_type, output_id; |
22360 | + char name[DRM_CONNECTOR_LEN]; | 21150 | |
22361 | + char *name_prefix; | ||
22362 | + char *name_suffix; | ||
22363 | + | ||
22364 | + int count = 3; | ||
22365 | + u8 response[2]; | ||
22366 | + u8 status; | ||
22367 | + unsigned char bytes[2]; | ||
22368 | + | ||
22369 | + DRM_DEBUG("xxintel_sdvo_init\n"); | ||
22370 | + | ||
22371 | + if (IS_POULSBO(dev)) { | 21151 | + if (IS_POULSBO(dev)) { |
22372 | + struct pci_dev * pci_root = pci_get_bus_and_slot(0, 0); | 21152 | + struct pci_dev * pci_root = pci_get_bus_and_slot(0, 0); |
22373 | + u32 sku_value = 0; | 21153 | + u32 sku_value = 0; |
22374 | + bool sku_bSDVOEnable = true; | 21154 | + bool sku_bSDVOEnable = true; |
22375 | + if(pci_root) | 21155 | + if(pci_root) { |
22376 | + { | ||
22377 | + pci_write_config_dword(pci_root, 0xD0, PCI_PORT5_REG80_FFUSE); | 21156 | + pci_write_config_dword(pci_root, 0xD0, PCI_PORT5_REG80_FFUSE); |
22378 | + pci_read_config_dword(pci_root, 0xD4, &sku_value); | 21157 | + pci_read_config_dword(pci_root, 0xD4, &sku_value); |
22379 | + sku_bSDVOEnable = (sku_value & PCI_PORT5_REG80_SDVO_DISABLE)?false : true; | 21158 | + sku_bSDVOEnable = (sku_value & PCI_PORT5_REG80_SDVO_DISABLE)?false : true; |
22380 | + DRM_INFO("intel_sdvo_init: sku_value is 0x%08x\n", sku_value); | 21159 | + DRM_INFO("intel_sdvo_init: sku_value is 0x%08x\n", sku_value); |
22381 | + DRM_INFO("intel_sdvo_init: sku_bSDVOEnable is %d\n", sku_bSDVOEnable); | 21160 | + DRM_INFO("intel_sdvo_init: sku_bSDVOEnable is %d\n", sku_bSDVOEnable); |
22382 | + if (sku_bSDVOEnable == false) | 21161 | + if (sku_bSDVOEnable == false) |
22383 | + return false; | 21162 | + return false; |
22384 | + } | 21163 | + } |
22385 | + } | 21164 | + } |
22386 | 21165 | + | |
22387 | intel_output = kcalloc(sizeof(struct intel_output)+sizeof(struct intel_sdvo_priv), 1, GFP_KERNEL); | 21166 | intel_output = kcalloc(sizeof(struct intel_output)+sizeof(struct intel_sdvo_priv), 1, GFP_KERNEL); |
22388 | if (!intel_output) { | 21167 | if (!intel_output) { |
21168 | return false; | ||
22389 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_priv.h | 21169 | Index: linux-2.6.28/drivers/gpu/drm/psb/psb_priv.h |
22390 | =================================================================== | 21170 | =================================================================== |
22391 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 21171 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
22392 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_priv.h 2009-02-12 10:11:32.000000000 +0000 | 21172 | +++ linux-2.6.28/drivers/gpu/drm/psb/psb_priv.h 2009-02-20 12:23:06.000000000 +0000 |
22393 | @@ -0,0 +1,244 @@ | 21173 | @@ -0,0 +1,181 @@ |
22394 | +#include "psb_drm.h" | 21174 | +#include "psb_drm.h" |
22395 | +#include "psb_reg.h" | 21175 | +#include "psb_reg.h" |
22396 | +#include "psb_schedule.h" | 21176 | +#include "psb_schedule.h" |
21177 | +#include "../i915/i915_common.h" | ||
22397 | + | 21178 | + |
22398 | +#define DRM_DRIVER_PRIVATE_T struct drm_psb_private | 21179 | +#define DRM_DRIVER_PRIVATE_T struct drm_i915_common_private |
22399 | +#undef I915_WRITE | ||
22400 | +#undef I915_READ | ||
22401 | +#define I915_WRITE(_offs, _val) \ | ||
22402 | + iowrite32(_val, dev_priv->vdc_reg + (_offs)) | ||
22403 | +#define I915_READ(_offs) \ | ||
22404 | + ioread32(dev_priv->vdc_reg + (_offs)) | ||
22405 | + | 21180 | + |
22406 | +struct drm_psb_uopt { | 21181 | +struct drm_psb_uopt { |
22407 | + int clock_gating; | 21182 | + int clock_gating; |
22408 | +}; | 21183 | +}; |
22409 | + | 21184 | + |
22410 | +struct drm_psb_private { | 21185 | +struct drm_psb_private { |
21186 | + /* common is assumed to be the first item in this structure */ | ||
21187 | + struct drm_i915_common_private common; | ||
21188 | + | ||
22411 | + unsigned long chipset; | 21189 | + unsigned long chipset; |
22412 | + uint8_t psb_rev_id; | 21190 | + uint8_t psb_rev_id; |
22413 | + | 21191 | + |
@@ -22429,11 +21207,15 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_priv.h | |||
22429 | + uint32_t last_submitted_seq[PSB_NUM_ENGINES]; | 21207 | + uint32_t last_submitted_seq[PSB_NUM_ENGINES]; |
22430 | + int engine_lockup_2d; | 21208 | + int engine_lockup_2d; |
22431 | + | 21209 | + |
21210 | + /** Protects user_irq_refcount and irq_mask_reg */ | ||
21211 | + spinlock_t user_irq_lock; | ||
21212 | + u32 pipestat[2]; | ||
21213 | + | ||
22432 | + struct psb_mmu_driver *mmu; | 21214 | + struct psb_mmu_driver *mmu; |
22433 | + struct psb_mmu_pd *pf_pd; | 21215 | + struct psb_mmu_pd *pf_pd; |
22434 | + | 21216 | + |
22435 | + uint8_t *sgx_reg; | 21217 | + uint8_t *sgx_reg; |
22436 | + uint8_t *vdc_reg; | 21218 | + //uint8_t *vdc_reg; |
22437 | + uint8_t *msvdx_reg; | 21219 | + uint8_t *msvdx_reg; |
22438 | + | 21220 | + |
22439 | + /* | 21221 | + /* |
@@ -22504,73 +21286,8 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_priv.h | |||
22504 | + wait_queue_head_t rel_mapped_queue; | 21286 | + wait_queue_head_t rel_mapped_queue; |
22505 | + | 21287 | + |
22506 | + /* | 21288 | + /* |
22507 | + * SAREA | ||
22508 | + */ | ||
22509 | + struct drm_psb_sarea *sarea_priv; | ||
22510 | + | ||
22511 | + /* | ||
22512 | + * LVDS info | ||
22513 | + */ | ||
22514 | + int backlight_duty_cycle; /* restore backlight to this value */ | ||
22515 | + bool panel_wants_dither; | ||
22516 | + struct drm_display_mode *panel_fixed_mode; | ||
22517 | + | ||
22518 | + /* | ||
22519 | + * Register state | 21289 | + * Register state |
22520 | + */ | 21290 | + */ |
22521 | + uint32_t saveDSPACNTR; | ||
22522 | + uint32_t saveDSPBCNTR; | ||
22523 | + uint32_t savePIPEACONF; | ||
22524 | + uint32_t savePIPEBCONF; | ||
22525 | + uint32_t savePIPEASRC; | ||
22526 | + uint32_t savePIPEBSRC; | ||
22527 | + uint32_t saveFPA0; | ||
22528 | + uint32_t saveFPA1; | ||
22529 | + uint32_t saveDPLL_A; | ||
22530 | + uint32_t saveDPLL_A_MD; | ||
22531 | + uint32_t saveHTOTAL_A; | ||
22532 | + uint32_t saveHBLANK_A; | ||
22533 | + uint32_t saveHSYNC_A; | ||
22534 | + uint32_t saveVTOTAL_A; | ||
22535 | + uint32_t saveVBLANK_A; | ||
22536 | + uint32_t saveVSYNC_A; | ||
22537 | + uint32_t saveDSPASTRIDE; | ||
22538 | + uint32_t saveDSPASIZE; | ||
22539 | + uint32_t saveDSPAPOS; | ||
22540 | + uint32_t saveDSPABASE; | ||
22541 | + uint32_t saveDSPASURF; | ||
22542 | + uint32_t saveFPB0; | ||
22543 | + uint32_t saveFPB1; | ||
22544 | + uint32_t saveDPLL_B; | ||
22545 | + uint32_t saveDPLL_B_MD; | ||
22546 | + uint32_t saveHTOTAL_B; | ||
22547 | + uint32_t saveHBLANK_B; | ||
22548 | + uint32_t saveHSYNC_B; | ||
22549 | + uint32_t saveVTOTAL_B; | ||
22550 | + uint32_t saveVBLANK_B; | ||
22551 | + uint32_t saveVSYNC_B; | ||
22552 | + uint32_t saveDSPBSTRIDE; | ||
22553 | + uint32_t saveDSPBSIZE; | ||
22554 | + uint32_t saveDSPBPOS; | ||
22555 | + uint32_t saveDSPBBASE; | ||
22556 | + uint32_t saveDSPBSURF; | ||
22557 | + uint32_t saveVCLK_DIVISOR_VGA0; | ||
22558 | + uint32_t saveVCLK_DIVISOR_VGA1; | ||
22559 | + uint32_t saveVCLK_POST_DIV; | ||
22560 | + uint32_t saveVGACNTRL; | ||
22561 | + uint32_t saveADPA; | ||
22562 | + uint32_t saveLVDS; | ||
22563 | + uint32_t saveDVOA; | ||
22564 | + uint32_t saveDVOB; | ||
22565 | + uint32_t saveDVOC; | ||
22566 | + uint32_t savePP_ON; | ||
22567 | + uint32_t savePP_OFF; | ||
22568 | + uint32_t savePP_CONTROL; | ||
22569 | + uint32_t savePP_CYCLE; | ||
22570 | + uint32_t savePFIT_CONTROL; | ||
22571 | + uint32_t savePaletteA[256]; | ||
22572 | + uint32_t savePaletteB[256]; | ||
22573 | + uint32_t saveBLC_PWM_CTL; | ||
22574 | + uint32_t saveCLOCKGATING; | 21291 | + uint32_t saveCLOCKGATING; |
22575 | + | 21292 | + |
22576 | + /* | 21293 | + /* |
@@ -22635,76 +21352,24 @@ Index: linux-2.6.28/drivers/gpu/drm/psb/psb_priv.h | |||
22635 | + | 21352 | + |
22636 | +extern void intel_crtc_mode_restore(struct drm_crtc *crtc); | 21353 | +extern void intel_crtc_mode_restore(struct drm_crtc *crtc); |
22637 | +extern void intel_crtc_mode_save(struct drm_crtc *crtc); | 21354 | +extern void intel_crtc_mode_save(struct drm_crtc *crtc); |
22638 | Index: linux-2.6.28/drivers/gpu/drm/i915/i915_drv.h | ||
22639 | =================================================================== | ||
22640 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/i915_drv.h 2009-02-12 09:47:51.000000000 +0000 | ||
22641 | +++ linux-2.6.28/drivers/gpu/drm/i915/i915_drv.h 2009-02-12 10:06:18.000000000 +0000 | ||
22642 | @@ -672,6 +672,7 @@ | ||
22643 | LOCK_TEST_WITH_RETURN(dev, file_priv); \ | ||
22644 | } while (0) | ||
22645 | |||
22646 | +#ifndef I915_READ | ||
22647 | #define I915_READ(reg) readl(dev_priv->regs + (reg)) | ||
22648 | #define I915_WRITE(reg, val) writel(val, dev_priv->regs + (reg)) | ||
22649 | #define I915_READ16(reg) readw(dev_priv->regs + (reg)) | ||
22650 | @@ -685,6 +686,7 @@ | ||
22651 | writel(upper_32_bits(val), dev_priv->regs + \ | ||
22652 | (reg) + 4)) | ||
22653 | #endif | ||
22654 | +#endif | ||
22655 | #define POSTING_READ(reg) (void)I915_READ(reg) | ||
22656 | |||
22657 | #define I915_VERBOSE 0 | ||
22658 | @@ -776,10 +778,15 @@ | ||
22659 | (dev)->pci_device == 0x29D2) | ||
22660 | |||
22661 | #define IS_I9XX(dev) (IS_I915G(dev) || IS_I915GM(dev) || IS_I945G(dev) || \ | ||
22662 | - IS_I945GM(dev) || IS_I965G(dev) || IS_G33(dev)) | ||
22663 | + IS_I945GM(dev) || IS_I965G(dev) || IS_G33(dev) || \ | ||
22664 | + IS_POULSBO(dev)) | ||
22665 | + | ||
22666 | +#define IS_POULSBO(dev) (((dev)->pci_device == 0x8108) || \ | ||
22667 | + ((dev)->pci_device == 0x8109)) | ||
22668 | |||
22669 | #define IS_MOBILE(dev) (IS_I830(dev) || IS_I85X(dev) || IS_I915GM(dev) || \ | ||
22670 | - IS_I945GM(dev) || IS_I965GM(dev) || IS_GM45(dev)) | ||
22671 | + IS_I945GM(dev) || IS_I965GM(dev) || IS_GM45(dev) || \ | ||
22672 | + IS_POULSBO(dev)) | ||
22673 | |||
22674 | #define I915_NEED_GFX_HWS(dev) (IS_G33(dev) || IS_GM45(dev) || IS_G4X(dev)) | ||
22675 | #define SUPPORTS_INTEGRATED_HDMI(dev) (IS_G4X(dev)) | ||
22676 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_display.c | 21355 | Index: linux-2.6.28/drivers/gpu/drm/i915/intel_display.c |
22677 | =================================================================== | 21356 | =================================================================== |
22678 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_display.c 2009-02-12 09:58:47.000000000 +0000 | 21357 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/intel_display.c 2009-02-20 12:22:54.000000000 +0000 |
22679 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_display.c 2009-02-12 16:32:26.000000000 +0000 | 21358 | +++ linux-2.6.28/drivers/gpu/drm/i915/intel_display.c 2009-02-20 12:23:06.000000000 +0000 |
22680 | @@ -26,9 +26,9 @@ | 21359 | @@ -342,60 +342,25 @@ |
22681 | 21360 | /* Wait for 20ms, i.e. one cycle at 50hz. */ | |
22682 | #include <linux/i2c.h> | 21361 | udelay(20000); |
22683 | #include "drmP.h" | 21362 | } |
22684 | -#include "intel_drv.h" | 21363 | +EXPORT_SYMBOL(intel_wait_for_vblank); |
22685 | +#include "../i915/intel_drv.h" | ||
22686 | #include "i915_drm.h" | ||
22687 | -#include "i915_drv.h" | ||
22688 | +#include "../i915/i915_drv.h" | ||
22689 | |||
22690 | #include "drm_crtc_helper.h" | ||
22691 | 21364 | ||
22692 | @@ -282,7 +282,7 @@ | 21365 | static void |
22693 | int refclk, intel_clock_t *best_clock) | 21366 | intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, |
22694 | { | ||
22695 | struct drm_device *dev = crtc->dev; | ||
22696 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
22697 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
22698 | intel_clock_t clock; | ||
22699 | const intel_limit_t *limit = intel_limit(crtc); | ||
22700 | int err = target; | ||
22701 | @@ -348,12 +348,8 @@ | ||
22702 | struct drm_framebuffer *old_fb) | 21367 | struct drm_framebuffer *old_fb) |
22703 | { | 21368 | { |
22704 | struct drm_device *dev = crtc->dev; | 21369 | struct drm_device *dev = crtc->dev; |
22705 | - struct drm_i915_private *dev_priv = dev->dev_private; | 21370 | - struct drm_i915_private *dev_priv = dev->dev_private; |
22706 | - struct drm_i915_master_private *master_priv; | 21371 | struct drm_i915_master_private *master_priv; |
22707 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | 21372 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; |
22708 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 21373 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
22709 | - struct intel_framebuffer *intel_fb; | 21374 | - struct intel_framebuffer *intel_fb; |
22710 | - struct drm_i915_gem_object *obj_priv; | 21375 | - struct drm_i915_gem_object *obj_priv; |
@@ -22712,10 +21377,11 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_display.c | |||
22712 | int pipe = intel_crtc->pipe; | 21377 | int pipe = intel_crtc->pipe; |
22713 | unsigned long Start, Offset; | 21378 | unsigned long Start, Offset; |
22714 | int dspbase = (pipe == 0 ? DSPAADDR : DSPBADDR); | 21379 | int dspbase = (pipe == 0 ? DSPAADDR : DSPBADDR); |
22715 | @@ -362,66 +358,8 @@ | 21380 | int dspsurf = (pipe == 0 ? DSPASURF : DSPBSURF); |
21381 | int dspstride = (pipe == 0) ? DSPASTRIDE : DSPBSTRIDE; | ||
22716 | int dspcntr_reg = (pipe == 0) ? DSPACNTR : DSPBCNTR; | 21382 | int dspcntr_reg = (pipe == 0) ? DSPACNTR : DSPBCNTR; |
22717 | u32 dspcntr, alignment; | 21383 | - u32 dspcntr, alignment; |
22718 | 21384 | - | |
22719 | - /* no fb bound */ | 21385 | - /* no fb bound */ |
22720 | - if (!crtc->fb) { | 21386 | - if (!crtc->fb) { |
22721 | - DRM_DEBUG("No FB bound\n"); | 21387 | - DRM_DEBUG("No FB bound\n"); |
@@ -22743,45 +21409,19 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_display.c | |||
22743 | - default: | 21409 | - default: |
22744 | - BUG(); | 21410 | - BUG(); |
22745 | - } | 21411 | - } |
22746 | - | 21412 | + u32 dspcntr; |
21413 | |||
22747 | - if (i915_gem_object_pin(intel_fb->obj, alignment)) | 21414 | - if (i915_gem_object_pin(intel_fb->obj, alignment)) |
22748 | - return; | 21415 | - return; |
22749 | - | 21416 | - |
22750 | - i915_gem_object_set_to_gtt_domain(intel_fb->obj, 1); | 21417 | - i915_gem_object_set_to_gtt_domain(intel_fb->obj, 1); |
22751 | - | 21418 | - |
22752 | - Start = obj_priv->gtt_offset; | 21419 | - Start = obj_priv->gtt_offset; |
22753 | - Offset = y * crtc->fb->pitch + x * (crtc->fb->bits_per_pixel / 8); | ||
22754 | - | ||
22755 | - I915_WRITE(dspstride, crtc->fb->pitch); | ||
22756 | - | ||
22757 | - dspcntr = I915_READ(dspcntr_reg); | ||
22758 | - /* Mask out pixel format bits in case we change it */ | ||
22759 | - dspcntr &= ~DISPPLANE_PIXFORMAT_MASK; | ||
22760 | - switch (crtc->fb->bits_per_pixel) { | ||
22761 | - case 8: | ||
22762 | - dspcntr |= DISPPLANE_8BPP; | ||
22763 | - break; | ||
22764 | - case 16: | ||
22765 | - if (crtc->fb->depth == 15) | ||
22766 | - dspcntr |= DISPPLANE_15_16BPP; | ||
22767 | - else | ||
22768 | - dspcntr |= DISPPLANE_16BPP; | ||
22769 | - break; | ||
22770 | - case 24: | ||
22771 | - case 32: | ||
22772 | - dspcntr |= DISPPLANE_32BPP_NO_ALPHA; | ||
22773 | - break; | ||
22774 | - default: | ||
22775 | - DRM_ERROR("Unknown color depth\n"); | ||
22776 | - return; | ||
22777 | - } | ||
22778 | - I915_WRITE(dspcntr_reg, dspcntr); | ||
22779 | + Start = crtc->fb->offset; | 21420 | + Start = crtc->fb->offset; |
22780 | + Offset = y * crtc->fb->pitch + x; | 21421 | Offset = y * crtc->fb->pitch + x * (crtc->fb->bits_per_pixel / 8); |
22781 | 21422 | ||
22782 | DRM_DEBUG("Writing base %08lX %08lX %d %d\n", Start, Offset, x, y); | 21423 | I915_WRITE(dspstride, crtc->fb->pitch); |
22783 | if (IS_I965G(dev)) { | 21424 | @@ -434,13 +399,6 @@ |
22784 | @@ -434,28 +372,18 @@ | ||
22785 | I915_READ(dspbase); | 21425 | I915_READ(dspbase); |
22786 | } | 21426 | } |
22787 | 21427 | ||
@@ -22792,69 +21432,10 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_display.c | |||
22792 | - i915_gem_object_unpin(intel_fb->obj); | 21432 | - i915_gem_object_unpin(intel_fb->obj); |
22793 | - } | 21433 | - } |
22794 | - | 21434 | - |
22795 | - if (!dev->primary->master) | 21435 | if (!dev->primary->master) |
22796 | - return; | ||
22797 | |||
22798 | - master_priv = dev->primary->master->driver_priv; | ||
22799 | - if (!master_priv->sarea_priv) | ||
22800 | + if (!dev_priv->sarea_priv) | ||
22801 | return; | 21436 | return; |
22802 | 21437 | ||
22803 | switch (pipe) { | 21438 | @@ -642,7 +600,7 @@ |
22804 | case 0: | ||
22805 | - master_priv->sarea_priv->pipeA_x = x; | ||
22806 | - master_priv->sarea_priv->pipeA_y = y; | ||
22807 | + dev_priv->sarea_priv->pipeA_x = x; | ||
22808 | + dev_priv->sarea_priv->pipeA_y = y; | ||
22809 | break; | ||
22810 | case 1: | ||
22811 | - master_priv->sarea_priv->pipeB_x = x; | ||
22812 | - master_priv->sarea_priv->pipeB_y = y; | ||
22813 | + dev_priv->sarea_priv->pipeB_x = x; | ||
22814 | + dev_priv->sarea_priv->pipeB_y = y; | ||
22815 | break; | ||
22816 | default: | ||
22817 | DRM_ERROR("Can't update pipe %d in SAREA\n", pipe); | ||
22818 | @@ -474,8 +402,7 @@ | ||
22819 | static void intel_crtc_dpms(struct drm_crtc *crtc, int mode) | ||
22820 | { | ||
22821 | struct drm_device *dev = crtc->dev; | ||
22822 | - struct drm_i915_master_private *master_priv; | ||
22823 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
22824 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
22825 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
22826 | int pipe = intel_crtc->pipe; | ||
22827 | int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B; | ||
22828 | @@ -569,23 +496,20 @@ | ||
22829 | break; | ||
22830 | } | ||
22831 | |||
22832 | - if (!dev->primary->master) | ||
22833 | - return; | ||
22834 | |||
22835 | - master_priv = dev->primary->master->driver_priv; | ||
22836 | - if (!master_priv->sarea_priv) | ||
22837 | + if (!dev_priv->sarea_priv) | ||
22838 | return; | ||
22839 | |||
22840 | enabled = crtc->enabled && mode != DRM_MODE_DPMS_OFF; | ||
22841 | |||
22842 | switch (pipe) { | ||
22843 | case 0: | ||
22844 | - master_priv->sarea_priv->pipeA_w = enabled ? crtc->mode.hdisplay : 0; | ||
22845 | - master_priv->sarea_priv->pipeA_h = enabled ? crtc->mode.vdisplay : 0; | ||
22846 | + dev_priv->sarea_priv->pipeA_w = enabled ? crtc->mode.hdisplay : 0; | ||
22847 | + dev_priv->sarea_priv->pipeA_h = enabled ? crtc->mode.vdisplay : 0; | ||
22848 | break; | ||
22849 | case 1: | ||
22850 | - master_priv->sarea_priv->pipeB_w = enabled ? crtc->mode.hdisplay : 0; | ||
22851 | - master_priv->sarea_priv->pipeB_h = enabled ? crtc->mode.vdisplay : 0; | ||
22852 | + dev_priv->sarea_priv->pipeB_w = enabled ? crtc->mode.hdisplay : 0; | ||
22853 | + dev_priv->sarea_priv->pipeB_h = enabled ? crtc->mode.vdisplay : 0; | ||
22854 | break; | ||
22855 | default: | ||
22856 | DRM_ERROR("Can't update pipe %d in SAREA\n", pipe); | ||
22857 | @@ -640,7 +564,7 @@ | ||
22858 | return 400000; | 21439 | return 400000; |
22859 | else if (IS_I915G(dev)) | 21440 | else if (IS_I915G(dev)) |
22860 | return 333000; | 21441 | return 333000; |
@@ -22863,274 +21444,7 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_display.c | |||
22863 | return 200000; | 21444 | return 200000; |
22864 | else if (IS_I915GM(dev)) { | 21445 | else if (IS_I915GM(dev)) { |
22865 | u16 gcfgc = 0; | 21446 | u16 gcfgc = 0; |
22866 | @@ -687,7 +611,7 @@ | 21447 | @@ -786,13 +744,15 @@ |
22867 | */ | ||
22868 | static int intel_panel_fitter_pipe (struct drm_device *dev) | ||
22869 | { | ||
22870 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
22871 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
22872 | u32 pfit_control; | ||
22873 | |||
22874 | /* i830 doesn't have a panel fitter */ | ||
22875 | @@ -707,7 +631,228 @@ | ||
22876 | /* older chips can only use pipe 1 */ | ||
22877 | return 1; | ||
22878 | } | ||
22879 | +#if 0 | ||
22880 | +#define WA_NO_FB_GARBAGE_DISPLAY | ||
22881 | +#ifdef WA_NO_FB_GARBAGE_DISPLAY | ||
22882 | +static u32 fp_reg_value[2]; | ||
22883 | +static u32 dpll_reg_value[2]; | ||
22884 | +static u32 dpll_md_reg_value[2]; | ||
22885 | +static u32 dspcntr_reg_value[2]; | ||
22886 | +static u32 pipeconf_reg_value[2]; | ||
22887 | +static u32 htot_reg_value[2]; | ||
22888 | +static u32 hblank_reg_value[2]; | ||
22889 | +static u32 hsync_reg_value[2]; | ||
22890 | +static u32 vtot_reg_value[2]; | ||
22891 | +static u32 vblank_reg_value[2]; | ||
22892 | +static u32 vsync_reg_value[2]; | ||
22893 | +static u32 dspsize_reg_value[2]; | ||
22894 | +static u32 dspstride_reg_value[2]; | ||
22895 | +static u32 dsppos_reg_value[2]; | ||
22896 | +static u32 pipesrc_reg_value[2]; | ||
22897 | + | ||
22898 | +static u32 dspbase_value[2]; | ||
22899 | + | ||
22900 | +static u32 lvds_reg_value[2]; | ||
22901 | +static u32 vgacntrl_reg_value[2]; | ||
22902 | +static u32 pfit_control_reg_value[2]; | ||
22903 | + | ||
22904 | + | ||
22905 | +void intel_crtc_mode_restore(struct drm_crtc *crtc) | ||
22906 | +{ | ||
22907 | + struct drm_device *dev = crtc->dev; | ||
22908 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
22909 | + struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
22910 | + int pipe = intel_crtc->pipe; | ||
22911 | + int fp_reg = (pipe == 0) ? FPA0 : FPB0; | ||
22912 | + int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B; | ||
22913 | + int dpll_md_reg = (intel_crtc->pipe == 0) ? DPLL_A_MD : DPLL_B_MD; | ||
22914 | + int dspcntr_reg = (pipe == 0) ? DSPACNTR : DSPBCNTR; | ||
22915 | + int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF; | ||
22916 | + int htot_reg = (pipe == 0) ? HTOTAL_A : HTOTAL_B; | ||
22917 | + int hblank_reg = (pipe == 0) ? HBLANK_A : HBLANK_B; | ||
22918 | + int hsync_reg = (pipe == 0) ? HSYNC_A : HSYNC_B; | ||
22919 | + int vtot_reg = (pipe == 0) ? VTOTAL_A : VTOTAL_B; | ||
22920 | + int vblank_reg = (pipe == 0) ? VBLANK_A : VBLANK_B; | ||
22921 | + int vsync_reg = (pipe == 0) ? VSYNC_A : VSYNC_B; | ||
22922 | + int dspsize_reg = (pipe == 0) ? DSPASIZE : DSPBSIZE; | ||
22923 | + int dspstride_reg = (pipe == 0) ? DSPASTRIDE : DSPBSTRIDE; | ||
22924 | + int dsppos_reg = (pipe == 0) ? DSPAPOS : DSPBPOS; | ||
22925 | + int pipesrc_reg = (pipe == 0) ? PIPEASRC : PIPEBSRC; | ||
22926 | + int dspbase = (pipe == 0 ? DSPAADDR : DSPBADDR); | ||
22927 | + | ||
22928 | + bool ok, is_sdvo = false, is_dvo = false; | ||
22929 | + bool is_crt = false, is_lvds = false, is_tv = false; | ||
22930 | + struct drm_mode_config *mode_config = &dev->mode_config; | ||
22931 | + struct drm_connector *output; | ||
22932 | + | ||
22933 | + list_for_each_entry(output, &mode_config->connector_list, head) { | ||
22934 | + struct intel_output *intel_output = to_intel_output(crtc); | ||
22935 | + | ||
22936 | + if (output->crtc != crtc) | ||
22937 | + continue; | ||
22938 | + | ||
22939 | + switch (intel_output->type) { | ||
22940 | + case INTEL_OUTPUT_LVDS: | ||
22941 | + is_lvds = TRUE; | ||
22942 | + break; | ||
22943 | + case INTEL_OUTPUT_SDVO: | ||
22944 | + is_sdvo = TRUE; | ||
22945 | + break; | ||
22946 | + case INTEL_OUTPUT_DVO: | ||
22947 | + is_dvo = TRUE; | ||
22948 | + break; | ||
22949 | + case INTEL_OUTPUT_TVOUT: | ||
22950 | + is_tv = TRUE; | ||
22951 | + break; | ||
22952 | + case INTEL_OUTPUT_ANALOG: | ||
22953 | + is_crt = TRUE; | ||
22954 | + break; | ||
22955 | + } | ||
22956 | + if(is_lvds && ((lvds_reg_value[pipe] & LVDS_PORT_EN) == 0)) | ||
22957 | + { | ||
22958 | + printk("%s: is_lvds but not the boot display, so return\n", | ||
22959 | + __FUNCTION__); | ||
22960 | + return; | ||
22961 | + } | ||
22962 | + output->funcs->prepare(output); | ||
22963 | + } | ||
22964 | + | ||
22965 | + intel_crtc_prepare(crtc); | ||
22966 | + /* Disable the panel fitter if it was on our pipe */ | ||
22967 | + if (intel_panel_fitter_pipe(dev) == pipe) | ||
22968 | + I915_WRITE(PFIT_CONTROL, 0); | ||
22969 | |||
22970 | + if (dpll_reg_value[pipe] & DPLL_VCO_ENABLE) { | ||
22971 | + I915_WRITE(fp_reg, fp_reg_value[pipe]); | ||
22972 | + I915_WRITE(dpll_reg, dpll_reg_value[pipe]& ~DPLL_VCO_ENABLE); | ||
22973 | + I915_READ(dpll_reg); | ||
22974 | + udelay(150); | ||
22975 | + } | ||
22976 | + | ||
22977 | + /* | ||
22978 | + if(is_lvds) | ||
22979 | + I915_WRITE(LVDS, lvds_reg_value[pipe]); | ||
22980 | + */ | ||
22981 | + if (is_lvds) { | ||
22982 | + I915_WRITE(LVDS, lvds_reg_value[pipe]); | ||
22983 | + I915_READ(LVDS); | ||
22984 | + } | ||
22985 | + | ||
22986 | + I915_WRITE(fp_reg, fp_reg_value[pipe]); | ||
22987 | + I915_WRITE(dpll_reg, dpll_reg_value[pipe]); | ||
22988 | + I915_READ(dpll_reg); | ||
22989 | + udelay(150); | ||
22990 | + //I915_WRITE(dpll_md_reg, dpll_md_reg_value[pipe]); | ||
22991 | + I915_WRITE(dpll_reg, dpll_reg_value[pipe]); | ||
22992 | + I915_READ(dpll_reg); | ||
22993 | + udelay(150); | ||
22994 | + I915_WRITE(htot_reg, htot_reg_value[pipe]); | ||
22995 | + I915_WRITE(hblank_reg, hblank_reg_value[pipe]); | ||
22996 | + I915_WRITE(hsync_reg, hsync_reg_value[pipe]); | ||
22997 | + I915_WRITE(vtot_reg, vtot_reg_value[pipe]); | ||
22998 | + I915_WRITE(vblank_reg, vblank_reg_value[pipe]); | ||
22999 | + I915_WRITE(vsync_reg, vsync_reg_value[pipe]); | ||
23000 | + I915_WRITE(dspstride_reg, dspstride_reg_value[pipe]); | ||
23001 | + I915_WRITE(dspsize_reg, dspsize_reg_value[pipe]); | ||
23002 | + I915_WRITE(dsppos_reg, dsppos_reg_value[pipe]); | ||
23003 | + I915_WRITE(pipesrc_reg, pipesrc_reg_value[pipe]); | ||
23004 | + I915_WRITE(pipeconf_reg, pipeconf_reg_value[pipe]); | ||
23005 | + I915_READ(pipeconf_reg); | ||
23006 | + intel_wait_for_vblank(dev); | ||
23007 | + I915_WRITE(dspcntr_reg, dspcntr_reg_value[pipe]); | ||
23008 | + I915_WRITE(dspbase, dspbase_value[pipe]); | ||
23009 | + I915_READ(dspbase); | ||
23010 | + I915_WRITE(VGACNTRL, vgacntrl_reg_value[pipe]); | ||
23011 | + intel_wait_for_vblank(dev); | ||
23012 | + I915_WRITE(PFIT_CONTROL, pfit_control_reg_value[pipe]); | ||
23013 | + | ||
23014 | + intel_crtc_commit(crtc); | ||
23015 | + list_for_each_entry(output, &mode_config->connector_list, head) { | ||
23016 | + if (output->crtc != crtc) | ||
23017 | + continue; | ||
23018 | + | ||
23019 | + output->funcs->commit(output); | ||
23020 | + //output->funcs->dpms(output, DRM_MODE_DPMS_OFF); | ||
23021 | + //printk("turn off the display first\n"); | ||
23022 | + } | ||
23023 | + return; | ||
23024 | +} | ||
23025 | + | ||
23026 | +void intel_crtc_mode_save(struct drm_crtc *crtc) | ||
23027 | +{ | ||
23028 | + struct drm_device *dev = crtc->dev; | ||
23029 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
23030 | + struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
23031 | + int pipe = intel_crtc->pipe; | ||
23032 | + int fp_reg = (pipe == 0) ? FPA0 : FPB0; | ||
23033 | + int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B; | ||
23034 | + int dpll_md_reg = (intel_crtc->pipe == 0) ? DPLL_A_MD : DPLL_B_MD; | ||
23035 | + int dspcntr_reg = (pipe == 0) ? DSPACNTR : DSPBCNTR; | ||
23036 | + int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF; | ||
23037 | + int htot_reg = (pipe == 0) ? HTOTAL_A : HTOTAL_B; | ||
23038 | + int hblank_reg = (pipe == 0) ? HBLANK_A : HBLANK_B; | ||
23039 | + int hsync_reg = (pipe == 0) ? HSYNC_A : HSYNC_B; | ||
23040 | + int vtot_reg = (pipe == 0) ? VTOTAL_A : VTOTAL_B; | ||
23041 | + int vblank_reg = (pipe == 0) ? VBLANK_A : VBLANK_B; | ||
23042 | + int vsync_reg = (pipe == 0) ? VSYNC_A : VSYNC_B; | ||
23043 | + int dspsize_reg = (pipe == 0) ? DSPASIZE : DSPBSIZE; | ||
23044 | + int dspstride_reg = (pipe == 0) ? DSPASTRIDE : DSPBSTRIDE; | ||
23045 | + int dsppos_reg = (pipe == 0) ? DSPAPOS : DSPBPOS; | ||
23046 | + int pipesrc_reg = (pipe == 0) ? PIPEASRC : PIPEBSRC; | ||
23047 | + int dspbase = (pipe == 0 ? DSPAADDR : DSPBADDR); | ||
23048 | + bool ok, is_sdvo = false, is_dvo = false; | ||
23049 | + bool is_crt = false, is_lvds = false, is_tv = false; | ||
23050 | + struct drm_mode_config *mode_config = &dev->mode_config; | ||
23051 | + struct drm_connector *output; | ||
23052 | + | ||
23053 | + list_for_each_entry(output, &mode_config->connector_list, head) { | ||
23054 | + struct intel_output *intel_output = to_intel_output(crtc); | ||
23055 | + | ||
23056 | + if (output->crtc != crtc) | ||
23057 | + continue; | ||
23058 | + | ||
23059 | + switch (intel_output->type) { | ||
23060 | + case INTEL_OUTPUT_LVDS: | ||
23061 | + is_lvds = TRUE; | ||
23062 | + break; | ||
23063 | + case INTEL_OUTPUT_SDVO: | ||
23064 | + is_sdvo = TRUE; | ||
23065 | + break; | ||
23066 | + case INTEL_OUTPUT_DVO: | ||
23067 | + is_dvo = TRUE; | ||
23068 | + break; | ||
23069 | + case INTEL_OUTPUT_TVOUT: | ||
23070 | + is_tv = TRUE; | ||
23071 | + break; | ||
23072 | + case INTEL_OUTPUT_ANALOG: | ||
23073 | + is_crt = TRUE; | ||
23074 | + break; | ||
23075 | + } | ||
23076 | + } | ||
23077 | + | ||
23078 | + fp_reg_value[pipe] = I915_READ(fp_reg); | ||
23079 | + dpll_reg_value[pipe] = I915_READ(dpll_reg); | ||
23080 | + dpll_md_reg_value[pipe] = I915_READ(dpll_md_reg); | ||
23081 | + dspcntr_reg_value[pipe] = I915_READ(dspcntr_reg); | ||
23082 | + pipeconf_reg_value[pipe] = I915_READ(pipeconf_reg); | ||
23083 | + htot_reg_value[pipe] = I915_READ(htot_reg); | ||
23084 | + hblank_reg_value[pipe] = I915_READ(hblank_reg); | ||
23085 | + hsync_reg_value[pipe] = I915_READ(hsync_reg); | ||
23086 | + vtot_reg_value[pipe] = I915_READ(vtot_reg); | ||
23087 | + vblank_reg_value[pipe] = I915_READ(vblank_reg); | ||
23088 | + vsync_reg_value[pipe] = I915_READ(vsync_reg); | ||
23089 | + dspsize_reg_value[pipe] = I915_READ(dspsize_reg); | ||
23090 | + dspstride_reg_value[pipe] = I915_READ(dspstride_reg); | ||
23091 | + dsppos_reg_value[pipe] = I915_READ(dsppos_reg); | ||
23092 | + pipesrc_reg_value[pipe] = I915_READ(pipesrc_reg); | ||
23093 | + dspbase_value[pipe] = I915_READ(dspbase); | ||
23094 | + if(is_lvds) | ||
23095 | + lvds_reg_value[pipe] = I915_READ(LVDS); | ||
23096 | + vgacntrl_reg_value[pipe] = I915_READ(VGACNTRL); | ||
23097 | + pfit_control_reg_value[pipe] = I915_READ(PFIT_CONTROL); | ||
23098 | +} | ||
23099 | +#endif | ||
23100 | +#endif | ||
23101 | static void intel_crtc_mode_set(struct drm_crtc *crtc, | ||
23102 | struct drm_display_mode *mode, | ||
23103 | struct drm_display_mode *adjusted_mode, | ||
23104 | @@ -715,7 +860,7 @@ | ||
23105 | struct drm_framebuffer *old_fb) | ||
23106 | { | ||
23107 | struct drm_device *dev = crtc->dev; | ||
23108 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
23109 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
23110 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
23111 | int pipe = intel_crtc->pipe; | ||
23112 | int fp_reg = (pipe == 0) ? FPA0 : FPB0; | ||
23113 | @@ -730,6 +875,7 @@ | ||
23114 | int vblank_reg = (pipe == 0) ? VBLANK_A : VBLANK_B; | ||
23115 | int vsync_reg = (pipe == 0) ? VSYNC_A : VSYNC_B; | ||
23116 | int dspsize_reg = (pipe == 0) ? DSPASIZE : DSPBSIZE; | ||
23117 | + int dspstride_reg = (pipe == 0) ? DSPASTRIDE : DSPBSTRIDE; | ||
23118 | int dsppos_reg = (pipe == 0) ? DSPAPOS : DSPBPOS; | ||
23119 | int pipesrc_reg = (pipe == 0) ? PIPEASRC : PIPEBSRC; | ||
23120 | int refclk; | ||
23121 | @@ -740,7 +886,10 @@ | ||
23122 | struct drm_mode_config *mode_config = &dev->mode_config; | ||
23123 | struct drm_connector *connector; | ||
23124 | |||
23125 | - drm_vblank_pre_modeset(dev, pipe); | ||
23126 | + if (!crtc->fb) { | ||
23127 | + DRM_ERROR("Can't set mode without attached fb\n"); | ||
23128 | + return; | ||
23129 | + } | ||
23130 | |||
23131 | list_for_each_entry(connector, &mode_config->connector_list, head) { | ||
23132 | struct intel_output *intel_output = to_intel_output(connector); | ||
23133 | @@ -784,13 +933,15 @@ | ||
23134 | 21448 | ||
23135 | dpll = DPLL_VGA_MODE_DIS; | 21449 | dpll = DPLL_VGA_MODE_DIS; |
23136 | if (IS_I9XX(dev)) { | 21450 | if (IS_I9XX(dev)) { |
@@ -23149,67 +21463,16 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_display.c | |||
23149 | int sdvo_pixel_multiply = adjusted_mode->clock / mode->clock; | 21463 | int sdvo_pixel_multiply = adjusted_mode->clock / mode->clock; |
23150 | dpll |= (sdvo_pixel_multiply - 1) << SDVO_MULTIPLIER_SHIFT_HIRES; | 21464 | dpll |= (sdvo_pixel_multiply - 1) << SDVO_MULTIPLIER_SHIFT_HIRES; |
23151 | } | 21465 | } |
23152 | @@ -841,6 +992,25 @@ | 21466 | @@ -959,7 +919,7 @@ |
23153 | /* Set up the display plane register */ | ||
23154 | dspcntr = DISPPLANE_GAMMA_ENABLE; | ||
23155 | |||
23156 | + switch (crtc->fb->bits_per_pixel) { | ||
23157 | + case 8: | ||
23158 | + dspcntr |= DISPPLANE_8BPP; | ||
23159 | + break; | ||
23160 | + case 16: | ||
23161 | + if (crtc->fb->depth == 15) | ||
23162 | + dspcntr |= DISPPLANE_15_16BPP; | ||
23163 | + else | ||
23164 | + dspcntr |= DISPPLANE_16BPP; | ||
23165 | + break; | ||
23166 | + case 32: | ||
23167 | + dspcntr |= DISPPLANE_32BPP_NO_ALPHA; | ||
23168 | + break; | ||
23169 | + default: | ||
23170 | + DRM_ERROR("Unknown color depth\n"); | ||
23171 | + return; | ||
23172 | + } | ||
23173 | + | ||
23174 | + | ||
23175 | if (pipe == 0) | ||
23176 | dspcntr |= DISPPLANE_SEL_PIPE_A; | ||
23177 | else | ||
23178 | @@ -934,6 +1104,7 @@ | ||
23179 | ((adjusted_mode->crtc_vblank_end - 1) << 16)); | ||
23180 | I915_WRITE(vsync_reg, (adjusted_mode->crtc_vsync_start - 1) | | ||
23181 | ((adjusted_mode->crtc_vsync_end - 1) << 16)); | ||
23182 | + I915_WRITE(dspstride_reg, crtc->fb->pitch); | ||
23183 | /* pipesrc and dspsize control the size that is scaled from, which should | ||
23184 | * always be the user's requested size. | ||
23185 | */ | ||
23186 | @@ -950,14 +1121,14 @@ | ||
23187 | /* Flush the plane changes */ | ||
23188 | intel_pipe_set_base(crtc, x, y, old_fb); | ||
23189 | |||
23190 | - drm_vblank_post_modeset(dev, pipe); | ||
23191 | + intel_wait_for_vblank(dev); | ||
23192 | } | ||
23193 | |||
23194 | /** Loads the palette/gamma unit for the CRTC with the prepared values */ | ||
23195 | void intel_crtc_load_lut(struct drm_crtc *crtc) | 21467 | void intel_crtc_load_lut(struct drm_crtc *crtc) |
23196 | { | 21468 | { |
23197 | struct drm_device *dev = crtc->dev; | 21469 | struct drm_device *dev = crtc->dev; |
23198 | - struct drm_i915_private *dev_priv = dev->dev_private; | 21470 | - struct drm_i915_private *dev_priv = dev->dev_private; |
23199 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | 21471 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; |
23200 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 21472 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
23201 | int palreg = (intel_crtc->pipe == 0) ? PALETTE_A : PALETTE_B; | 21473 | int palreg = (intel_crtc->pipe == 0) ? PALETTE_A : PALETTE_B; |
23202 | int i; | 21474 | int i; |
23203 | @@ -980,7 +1151,7 @@ | 21475 | @@ -1021,7 +981,7 @@ |
23204 | uint32_t width, uint32_t height) | ||
23205 | { | ||
23206 | struct drm_device *dev = crtc->dev; | ||
23207 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
23208 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
23209 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
23210 | struct drm_gem_object *bo; | ||
23211 | struct drm_i915_gem_object *obj_priv; | ||
23212 | @@ -1019,7 +1190,7 @@ | ||
23213 | ret = -ENOMEM; | 21476 | ret = -ENOMEM; |
23214 | goto fail; | 21477 | goto fail; |
23215 | } | 21478 | } |
@@ -23218,7 +21481,7 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_display.c | |||
23218 | /* we only need to pin inside GTT if cursor is non-phy */ | 21481 | /* we only need to pin inside GTT if cursor is non-phy */ |
23219 | if (!dev_priv->cursor_needs_physical) { | 21482 | if (!dev_priv->cursor_needs_physical) { |
23220 | ret = i915_gem_object_pin(bo, PAGE_SIZE); | 21483 | ret = i915_gem_object_pin(bo, PAGE_SIZE); |
23221 | @@ -1036,7 +1207,7 @@ | 21484 | @@ -1038,7 +998,7 @@ |
23222 | } | 21485 | } |
23223 | addr = obj_priv->phys_obj->handle->busaddr; | 21486 | addr = obj_priv->phys_obj->handle->busaddr; |
23224 | } | 21487 | } |
@@ -23227,7 +21490,7 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_display.c | |||
23227 | temp = 0; | 21490 | temp = 0; |
23228 | /* set the pipe for the cursor */ | 21491 | /* set the pipe for the cursor */ |
23229 | temp |= (pipe << 28); | 21492 | temp |= (pipe << 28); |
23230 | @@ -1047,6 +1218,7 @@ | 21493 | @@ -1049,6 +1009,7 @@ |
23231 | I915_WRITE(base, addr); | 21494 | I915_WRITE(base, addr); |
23232 | 21495 | ||
23233 | if (intel_crtc->cursor_bo) { | 21496 | if (intel_crtc->cursor_bo) { |
@@ -23235,7 +21498,7 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_display.c | |||
23235 | if (dev_priv->cursor_needs_physical) { | 21498 | if (dev_priv->cursor_needs_physical) { |
23236 | if (intel_crtc->cursor_bo != bo) | 21499 | if (intel_crtc->cursor_bo != bo) |
23237 | i915_gem_detach_phys_object(dev, intel_crtc->cursor_bo); | 21500 | i915_gem_detach_phys_object(dev, intel_crtc->cursor_bo); |
23238 | @@ -1055,6 +1227,7 @@ | 21501 | @@ -1057,6 +1018,7 @@ |
23239 | mutex_lock(&dev->struct_mutex); | 21502 | mutex_lock(&dev->struct_mutex); |
23240 | drm_gem_object_unreference(intel_crtc->cursor_bo); | 21503 | drm_gem_object_unreference(intel_crtc->cursor_bo); |
23241 | mutex_unlock(&dev->struct_mutex); | 21504 | mutex_unlock(&dev->struct_mutex); |
@@ -23243,54 +21506,7 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_display.c | |||
23243 | } | 21506 | } |
23244 | 21507 | ||
23245 | intel_crtc->cursor_addr = addr; | 21508 | intel_crtc->cursor_addr = addr; |
23246 | @@ -1071,7 +1244,7 @@ | 21509 | @@ -1456,7 +1418,8 @@ |
23247 | static int intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) | ||
23248 | { | ||
23249 | struct drm_device *dev = crtc->dev; | ||
23250 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
23251 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
23252 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
23253 | int pipe = intel_crtc->pipe; | ||
23254 | uint32_t temp = 0; | ||
23255 | @@ -1255,7 +1428,7 @@ | ||
23256 | /* Returns the clock of the currently programmed mode of the given pipe. */ | ||
23257 | static int intel_crtc_clock_get(struct drm_device *dev, struct drm_crtc *crtc) | ||
23258 | { | ||
23259 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
23260 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
23261 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
23262 | int pipe = intel_crtc->pipe; | ||
23263 | u32 dpll = I915_READ((pipe == 0) ? DPLL_A : DPLL_B); | ||
23264 | @@ -1333,7 +1506,7 @@ | ||
23265 | struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev, | ||
23266 | struct drm_crtc *crtc) | ||
23267 | { | ||
23268 | - struct drm_i915_private *dev_priv = dev->dev_private; | ||
23269 | + DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private; | ||
23270 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
23271 | int pipe = intel_crtc->pipe; | ||
23272 | struct drm_display_mode *mode; | ||
23273 | @@ -1399,7 +1572,6 @@ | ||
23274 | |||
23275 | drm_crtc_init(dev, &intel_crtc->base, &intel_crtc_funcs); | ||
23276 | |||
23277 | - drm_mode_crtc_set_gamma_size(&intel_crtc->base, 256); | ||
23278 | intel_crtc->pipe = pipe; | ||
23279 | for (i = 0; i < 256; i++) { | ||
23280 | intel_crtc->lut_r[i] = i; | ||
23281 | @@ -1415,11 +1587,6 @@ | ||
23282 | intel_crtc->mode_set.connectors = (struct drm_connector **)(intel_crtc + 1); | ||
23283 | intel_crtc->mode_set.num_connectors = 0; | ||
23284 | |||
23285 | - if (i915_fbpercrtc) { | ||
23286 | - | ||
23287 | - | ||
23288 | - | ||
23289 | - } | ||
23290 | } | ||
23291 | |||
23292 | struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe) | ||
23293 | @@ -1454,27 +1621,17 @@ | ||
23294 | { | 21510 | { |
23295 | struct drm_connector *connector; | 21511 | struct drm_connector *connector; |
23296 | 21512 | ||
@@ -23300,30 +21516,21 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_display.c | |||
23300 | 21516 | ||
23301 | /* Set up integrated LVDS */ | 21517 | /* Set up integrated LVDS */ |
23302 | if (IS_MOBILE(dev) && !IS_I830(dev)) | 21518 | if (IS_MOBILE(dev) && !IS_I830(dev)) |
23303 | intel_lvds_init(dev); | 21519 | @@ -1472,12 +1435,9 @@ |
23304 | 21520 | found = intel_sdvo_init(dev, SDVOC); | |
23305 | if (IS_I9XX(dev)) { | 21521 | if (!found && SUPPORTS_INTEGRATED_HDMI(dev)) |
23306 | - int found; | 21522 | intel_hdmi_init(dev, SDVOC); |
23307 | - | ||
23308 | - found = intel_sdvo_init(dev, SDVOB); | ||
23309 | - if (!found && SUPPORTS_INTEGRATED_HDMI(dev)) | ||
23310 | - intel_hdmi_init(dev, SDVOB); | ||
23311 | - | ||
23312 | - found = intel_sdvo_init(dev, SDVOC); | ||
23313 | - if (!found && SUPPORTS_INTEGRATED_HDMI(dev)) | ||
23314 | - intel_hdmi_init(dev, SDVOC); | ||
23315 | - } else | 21523 | - } else |
23316 | - intel_dvo_init(dev); | 21524 | + } else |
23317 | - | 21525 | intel_dvo_init(dev); |
21526 | |||
23318 | - if (IS_I9XX(dev) && IS_MOBILE(dev)) | 21527 | - if (IS_I9XX(dev) && IS_MOBILE(dev)) |
23319 | - intel_tv_init(dev); | 21528 | - intel_tv_init(dev); |
23320 | + intel_sdvo_init(dev, SDVOB); | 21529 | - |
23321 | + intel_sdvo_init(dev, SDVOC); | ||
23322 | + } | ||
23323 | |||
23324 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { | 21530 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
23325 | struct intel_output *intel_output = to_intel_output(connector); | 21531 | struct intel_output *intel_output = to_intel_output(connector); |
23326 | @@ -1523,8 +1680,8 @@ | 21532 | struct drm_encoder *encoder = &intel_output->enc; |
21533 | @@ -1525,8 +1485,8 @@ | ||
23327 | struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); | 21534 | struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); |
23328 | struct drm_device *dev = fb->dev; | 21535 | struct drm_device *dev = fb->dev; |
23329 | 21536 | ||
@@ -23334,7 +21541,7 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_display.c | |||
23334 | 21541 | ||
23335 | drm_framebuffer_cleanup(fb); | 21542 | drm_framebuffer_cleanup(fb); |
23336 | mutex_lock(&dev->struct_mutex); | 21543 | mutex_lock(&dev->struct_mutex); |
23337 | @@ -1601,7 +1758,7 @@ | 21544 | @@ -1603,7 +1563,7 @@ |
23338 | 21545 | ||
23339 | static const struct drm_mode_config_funcs intel_mode_funcs = { | 21546 | static const struct drm_mode_config_funcs intel_mode_funcs = { |
23340 | .fb_create = intel_user_framebuffer_create, | 21547 | .fb_create = intel_user_framebuffer_create, |
@@ -23343,19 +21550,15 @@ Index: linux-2.6.28/drivers/gpu/drm/i915/intel_display.c | |||
23343 | }; | 21550 | }; |
23344 | 21551 | ||
23345 | void intel_modeset_init(struct drm_device *dev) | 21552 | void intel_modeset_init(struct drm_device *dev) |
23346 | @@ -1616,13 +1773,8 @@ | 21553 | Index: linux-2.6.28/drivers/gpu/drm/i915/i915_irq.c |
23347 | 21554 | =================================================================== | |
23348 | dev->mode_config.funcs = (void *)&intel_mode_funcs; | 21555 | --- linux-2.6.28.orig/drivers/gpu/drm/i915/i915_irq.c 2009-02-20 12:22:54.000000000 +0000 |
21556 | +++ linux-2.6.28/drivers/gpu/drm/i915/i915_irq.c 2009-02-20 12:23:06.000000000 +0000 | ||
21557 | @@ -536,6 +536,7 @@ | ||
23349 | 21558 | ||
23350 | - if (IS_I965G(dev)) { | 21559 | int i915_driver_irq_postinstall(struct drm_device *dev) |
23351 | - dev->mode_config.max_width = 8192; | 21560 | { |
23352 | - dev->mode_config.max_height = 8192; | 21561 | + struct drm_i915_common_private *dev_priv_common = dev->dev_private; |
23353 | - } else { | 21562 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
23354 | - dev->mode_config.max_width = 2048; | ||
23355 | - dev->mode_config.max_height = 2048; | ||
23356 | - } | ||
23357 | + dev->mode_config.max_width = 2048; | ||
23358 | + dev->mode_config.max_height = 2048; | ||
23359 | 21563 | ||
23360 | /* set memory base */ | 21564 | dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B; |
23361 | if (IS_I9XX(dev)) | ||
diff --git a/meta-moblin/packages/linux/linux-moblin_2.6.28+2.6.29-rc2.bb b/meta-moblin/packages/linux/linux-moblin_2.6.28+2.6.29-rc2.bb index 6ab0c8deee..bb807b3652 100644 --- a/meta-moblin/packages/linux/linux-moblin_2.6.28+2.6.29-rc2.bb +++ b/meta-moblin/packages/linux/linux-moblin_2.6.28+2.6.29-rc2.bb | |||
@@ -19,6 +19,6 @@ SRC_URI = "${KERNELORG_MIRROR}pub/linux/kernel/v2.6/linux-2.6.28.tar.bz2 \ | |||
19 | file://defconfig-menlow \ | 19 | file://defconfig-menlow \ |
20 | file://defconfig-netbook" | 20 | file://defconfig-netbook" |
21 | 21 | ||
22 | SRC_URI_append_menlow = " file://psb-driver.patch;patch=1" | 22 | SRC_URI_append_menlow = " file://i915_split.patch;patch=1 file://psb-driver.patch;patch=1" |
23 | 23 | ||
24 | S = "${WORKDIR}/linux-2.6.28" | 24 | S = "${WORKDIR}/linux-2.6.28" |