]>
Commit | Line | Data |
---|---|---|
79e53945 JB |
1 | /* |
2 | * Copyright © 2006-2007 Intel Corporation | |
3 | * | |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | |
5 | * copy of this software and associated documentation files (the "Software"), | |
6 | * to deal in the Software without restriction, including without limitation | |
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
8 | * and/or sell copies of the Software, and to permit persons to whom the | |
9 | * Software is furnished to do so, subject to the following conditions: | |
10 | * | |
11 | * The above copyright notice and this permission notice (including the next | |
12 | * paragraph) shall be included in all copies or substantial portions of the | |
13 | * Software. | |
14 | * | |
15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
18 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
21 | * DEALINGS IN THE SOFTWARE. | |
22 | * | |
23 | * Authors: | |
24 | * Eric Anholt <eric@anholt.net> | |
25 | */ | |
26 | ||
8ca4013d | 27 | #include <linux/dmi.h> |
79e53945 | 28 | #include <linux/i2c.h> |
5a0e3ad6 | 29 | #include <linux/slab.h> |
760285e7 | 30 | #include <drm/drmP.h> |
c6f95f27 | 31 | #include <drm/drm_atomic_helper.h> |
760285e7 DH |
32 | #include <drm/drm_crtc.h> |
33 | #include <drm/drm_crtc_helper.h> | |
34 | #include <drm/drm_edid.h> | |
79e53945 | 35 | #include "intel_drv.h" |
760285e7 | 36 | #include <drm/i915_drm.h> |
79e53945 JB |
37 | #include "i915_drv.h" |
38 | ||
e7dbb2f2 KP |
39 | /* Here's the desired hotplug mode */ |
40 | #define ADPA_HOTPLUG_BITS (ADPA_CRT_HOTPLUG_PERIOD_128 | \ | |
41 | ADPA_CRT_HOTPLUG_WARMUP_10MS | \ | |
42 | ADPA_CRT_HOTPLUG_SAMPLE_4S | \ | |
43 | ADPA_CRT_HOTPLUG_VOLTAGE_50 | \ | |
44 | ADPA_CRT_HOTPLUG_VOLREF_325MV | \ | |
45 | ADPA_CRT_HOTPLUG_ENABLE) | |
46 | ||
c9a1c4cd CW |
47 | struct intel_crt { |
48 | struct intel_encoder base; | |
637f44d2 AJ |
49 | /* DPMS state is stored in the connector, which we need in the |
50 | * encoder's enable/disable callbacks */ | |
51 | struct intel_connector *connector; | |
e7dbb2f2 | 52 | bool force_hotplug_required; |
f0f59a00 | 53 | i915_reg_t adpa_reg; |
c9a1c4cd CW |
54 | }; |
55 | ||
eebe6f0b | 56 | static struct intel_crt *intel_encoder_to_crt(struct intel_encoder *encoder) |
c9a1c4cd | 57 | { |
eebe6f0b | 58 | return container_of(encoder, struct intel_crt, base); |
c9a1c4cd CW |
59 | } |
60 | ||
eebe6f0b | 61 | static struct intel_crt *intel_attached_crt(struct drm_connector *connector) |
79e53945 | 62 | { |
eebe6f0b | 63 | return intel_encoder_to_crt(intel_attached_encoder(connector)); |
540a8950 DV |
64 | } |
65 | ||
e403fc94 DV |
66 | static bool intel_crt_get_hw_state(struct intel_encoder *encoder, |
67 | enum pipe *pipe) | |
79e53945 | 68 | { |
e403fc94 | 69 | struct drm_device *dev = encoder->base.dev; |
79e53945 | 70 | struct drm_i915_private *dev_priv = dev->dev_private; |
e403fc94 | 71 | struct intel_crt *crt = intel_encoder_to_crt(encoder); |
6d129bea | 72 | enum intel_display_power_domain power_domain; |
e403fc94 | 73 | u32 tmp; |
1c8fdda1 | 74 | bool ret; |
e403fc94 | 75 | |
6d129bea | 76 | power_domain = intel_display_port_power_domain(encoder); |
1c8fdda1 | 77 | if (!intel_display_power_get_if_enabled(dev_priv, power_domain)) |
6d129bea ID |
78 | return false; |
79 | ||
1c8fdda1 ID |
80 | ret = false; |
81 | ||
e403fc94 DV |
82 | tmp = I915_READ(crt->adpa_reg); |
83 | ||
84 | if (!(tmp & ADPA_DAC_ENABLE)) | |
1c8fdda1 | 85 | goto out; |
e403fc94 DV |
86 | |
87 | if (HAS_PCH_CPT(dev)) | |
88 | *pipe = PORT_TO_PIPE_CPT(tmp); | |
89 | else | |
90 | *pipe = PORT_TO_PIPE(tmp); | |
91 | ||
1c8fdda1 ID |
92 | ret = true; |
93 | out: | |
94 | intel_display_power_put(dev_priv, power_domain); | |
95 | ||
96 | return ret; | |
e403fc94 DV |
97 | } |
98 | ||
6801c18c | 99 | static unsigned int intel_crt_get_flags(struct intel_encoder *encoder) |
045ac3b5 JB |
100 | { |
101 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; | |
102 | struct intel_crt *crt = intel_encoder_to_crt(encoder); | |
103 | u32 tmp, flags = 0; | |
104 | ||
105 | tmp = I915_READ(crt->adpa_reg); | |
106 | ||
107 | if (tmp & ADPA_HSYNC_ACTIVE_HIGH) | |
108 | flags |= DRM_MODE_FLAG_PHSYNC; | |
109 | else | |
110 | flags |= DRM_MODE_FLAG_NHSYNC; | |
111 | ||
112 | if (tmp & ADPA_VSYNC_ACTIVE_HIGH) | |
113 | flags |= DRM_MODE_FLAG_PVSYNC; | |
114 | else | |
115 | flags |= DRM_MODE_FLAG_NVSYNC; | |
116 | ||
6801c18c VS |
117 | return flags; |
118 | } | |
119 | ||
120 | static void intel_crt_get_config(struct intel_encoder *encoder, | |
5cec258b | 121 | struct intel_crtc_state *pipe_config) |
6801c18c VS |
122 | { |
123 | struct drm_device *dev = encoder->base.dev; | |
124 | int dotclock; | |
125 | ||
2d112de7 | 126 | pipe_config->base.adjusted_mode.flags |= intel_crt_get_flags(encoder); |
18442d08 VS |
127 | |
128 | dotclock = pipe_config->port_clock; | |
129 | ||
6801c18c | 130 | if (HAS_PCH_SPLIT(dev)) |
18442d08 VS |
131 | ironlake_check_encoder_dotclock(pipe_config, dotclock); |
132 | ||
2d112de7 | 133 | pipe_config->base.adjusted_mode.crtc_clock = dotclock; |
045ac3b5 JB |
134 | } |
135 | ||
6801c18c | 136 | static void hsw_crt_get_config(struct intel_encoder *encoder, |
5cec258b | 137 | struct intel_crtc_state *pipe_config) |
6801c18c VS |
138 | { |
139 | intel_ddi_get_config(encoder, pipe_config); | |
140 | ||
2d112de7 | 141 | pipe_config->base.adjusted_mode.flags &= ~(DRM_MODE_FLAG_PHSYNC | |
6801c18c VS |
142 | DRM_MODE_FLAG_NHSYNC | |
143 | DRM_MODE_FLAG_PVSYNC | | |
144 | DRM_MODE_FLAG_NVSYNC); | |
2d112de7 | 145 | pipe_config->base.adjusted_mode.flags |= intel_crt_get_flags(encoder); |
6801c18c VS |
146 | } |
147 | ||
b2cabb0e DV |
148 | /* Note: The caller is required to filter out dpms modes not supported by the |
149 | * platform. */ | |
150 | static void intel_crt_set_dpms(struct intel_encoder *encoder, int mode) | |
df0323c4 | 151 | { |
b2cabb0e | 152 | struct drm_device *dev = encoder->base.dev; |
df0323c4 | 153 | struct drm_i915_private *dev_priv = dev->dev_private; |
b2cabb0e | 154 | struct intel_crt *crt = intel_encoder_to_crt(encoder); |
894ed1ec | 155 | struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc); |
7c5f93b0 | 156 | const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode; |
894ed1ec DV |
157 | u32 adpa; |
158 | ||
159 | if (INTEL_INFO(dev)->gen >= 5) | |
160 | adpa = ADPA_HOTPLUG_BITS; | |
161 | else | |
162 | adpa = 0; | |
df0323c4 | 163 | |
894ed1ec DV |
164 | if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) |
165 | adpa |= ADPA_HSYNC_ACTIVE_HIGH; | |
166 | if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) | |
167 | adpa |= ADPA_VSYNC_ACTIVE_HIGH; | |
168 | ||
169 | /* For CPT allow 3 pipe config, for others just use A or B */ | |
170 | if (HAS_PCH_LPT(dev)) | |
171 | ; /* Those bits don't exist here */ | |
172 | else if (HAS_PCH_CPT(dev)) | |
173 | adpa |= PORT_TRANS_SEL_CPT(crtc->pipe); | |
174 | else if (crtc->pipe == 0) | |
175 | adpa |= ADPA_PIPE_A_SELECT; | |
176 | else | |
177 | adpa |= ADPA_PIPE_B_SELECT; | |
178 | ||
179 | if (!HAS_PCH_SPLIT(dev)) | |
180 | I915_WRITE(BCLRPAT(crtc->pipe), 0); | |
79e53945 | 181 | |
0206e353 | 182 | switch (mode) { |
79e53945 | 183 | case DRM_MODE_DPMS_ON: |
894ed1ec | 184 | adpa |= ADPA_DAC_ENABLE; |
79e53945 JB |
185 | break; |
186 | case DRM_MODE_DPMS_STANDBY: | |
894ed1ec | 187 | adpa |= ADPA_DAC_ENABLE | ADPA_HSYNC_CNTL_DISABLE; |
79e53945 JB |
188 | break; |
189 | case DRM_MODE_DPMS_SUSPEND: | |
894ed1ec | 190 | adpa |= ADPA_DAC_ENABLE | ADPA_VSYNC_CNTL_DISABLE; |
79e53945 JB |
191 | break; |
192 | case DRM_MODE_DPMS_OFF: | |
894ed1ec | 193 | adpa |= ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE; |
79e53945 JB |
194 | break; |
195 | } | |
196 | ||
894ed1ec | 197 | I915_WRITE(crt->adpa_reg, adpa); |
df0323c4 | 198 | } |
2c07245f | 199 | |
637f44d2 AJ |
200 | static void intel_disable_crt(struct intel_encoder *encoder) |
201 | { | |
202 | intel_crt_set_dpms(encoder, DRM_MODE_DPMS_OFF); | |
203 | } | |
204 | ||
1ea56e26 VS |
205 | static void pch_disable_crt(struct intel_encoder *encoder) |
206 | { | |
207 | } | |
208 | ||
209 | static void pch_post_disable_crt(struct intel_encoder *encoder) | |
210 | { | |
211 | intel_disable_crt(encoder); | |
212 | } | |
abfdc1e3 | 213 | |
637f44d2 AJ |
214 | static void intel_enable_crt(struct intel_encoder *encoder) |
215 | { | |
7bb4afb4 | 216 | intel_crt_set_dpms(encoder, DRM_MODE_DPMS_ON); |
637f44d2 AJ |
217 | } |
218 | ||
c19de8eb DL |
219 | static enum drm_mode_status |
220 | intel_crt_mode_valid(struct drm_connector *connector, | |
221 | struct drm_display_mode *mode) | |
79e53945 | 222 | { |
6bcdcd9e | 223 | struct drm_device *dev = connector->dev; |
f8700b34 | 224 | int max_dotclk = to_i915(dev)->max_dotclk_freq; |
6bcdcd9e ZY |
225 | |
226 | int max_clock = 0; | |
79e53945 JB |
227 | if (mode->flags & DRM_MODE_FLAG_DBLSCAN) |
228 | return MODE_NO_DBLESCAN; | |
229 | ||
6bcdcd9e ZY |
230 | if (mode->clock < 25000) |
231 | return MODE_CLOCK_LOW; | |
232 | ||
a6c45cf0 | 233 | if (IS_GEN2(dev)) |
6bcdcd9e ZY |
234 | max_clock = 350000; |
235 | else | |
236 | max_clock = 400000; | |
237 | if (mode->clock > max_clock) | |
238 | return MODE_CLOCK_HIGH; | |
79e53945 | 239 | |
f8700b34 MK |
240 | if (mode->clock > max_dotclk) |
241 | return MODE_CLOCK_HIGH; | |
242 | ||
d4b1931c PZ |
243 | /* The FDI receiver on LPT only supports 8bpc and only has 2 lanes. */ |
244 | if (HAS_PCH_LPT(dev) && | |
245 | (ironlake_get_lanes_required(mode->clock, 270000, 24) > 2)) | |
246 | return MODE_CLOCK_HIGH; | |
247 | ||
79e53945 JB |
248 | return MODE_OK; |
249 | } | |
250 | ||
5bfe2ac0 | 251 | static bool intel_crt_compute_config(struct intel_encoder *encoder, |
5cec258b | 252 | struct intel_crtc_state *pipe_config) |
79e53945 | 253 | { |
5bfe2ac0 DV |
254 | struct drm_device *dev = encoder->base.dev; |
255 | ||
256 | if (HAS_PCH_SPLIT(dev)) | |
257 | pipe_config->has_pch_encoder = true; | |
258 | ||
2a7aceec DV |
259 | /* LPT FDI RX only supports 8bpc. */ |
260 | if (HAS_PCH_LPT(dev)) | |
261 | pipe_config->pipe_bpp = 24; | |
262 | ||
8f7abfd8 | 263 | /* FDI must always be 2.7 GHz */ |
0e50338c DV |
264 | if (HAS_DDI(dev)) { |
265 | pipe_config->ddi_pll_sel = PORT_CLK_SEL_SPLL; | |
8f7abfd8 | 266 | pipe_config->port_clock = 135000 * 2; |
00490c22 ML |
267 | |
268 | pipe_config->dpll_hw_state.wrpll = 0; | |
269 | pipe_config->dpll_hw_state.spll = | |
270 | SPLL_PLL_ENABLE | SPLL_PLL_FREQ_1350MHz | SPLL_PLL_SSC; | |
0e50338c | 271 | } |
8f7abfd8 | 272 | |
79e53945 JB |
273 | return true; |
274 | } | |
275 | ||
f2b115e6 | 276 | static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector) |
2c07245f ZW |
277 | { |
278 | struct drm_device *dev = connector->dev; | |
e7dbb2f2 | 279 | struct intel_crt *crt = intel_attached_crt(connector); |
2c07245f | 280 | struct drm_i915_private *dev_priv = dev->dev_private; |
e7dbb2f2 | 281 | u32 adpa; |
2c07245f ZW |
282 | bool ret; |
283 | ||
e7dbb2f2 KP |
284 | /* The first time through, trigger an explicit detection cycle */ |
285 | if (crt->force_hotplug_required) { | |
286 | bool turn_off_dac = HAS_PCH_SPLIT(dev); | |
287 | u32 save_adpa; | |
67941da2 | 288 | |
e7dbb2f2 KP |
289 | crt->force_hotplug_required = 0; |
290 | ||
ca54b810 | 291 | save_adpa = adpa = I915_READ(crt->adpa_reg); |
e7dbb2f2 KP |
292 | DRM_DEBUG_KMS("trigger hotplug detect cycle: adpa=0x%x\n", adpa); |
293 | ||
294 | adpa |= ADPA_CRT_HOTPLUG_FORCE_TRIGGER; | |
295 | if (turn_off_dac) | |
296 | adpa &= ~ADPA_DAC_ENABLE; | |
297 | ||
ca54b810 | 298 | I915_WRITE(crt->adpa_reg, adpa); |
e7dbb2f2 | 299 | |
ca54b810 | 300 | if (wait_for((I915_READ(crt->adpa_reg) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0, |
e7dbb2f2 KP |
301 | 1000)) |
302 | DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER"); | |
303 | ||
304 | if (turn_off_dac) { | |
ca54b810 VS |
305 | I915_WRITE(crt->adpa_reg, save_adpa); |
306 | POSTING_READ(crt->adpa_reg); | |
e7dbb2f2 | 307 | } |
a4a6b901 ZW |
308 | } |
309 | ||
2c07245f | 310 | /* Check the status to see if both blue and green are on now */ |
ca54b810 | 311 | adpa = I915_READ(crt->adpa_reg); |
e7dbb2f2 | 312 | if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) != 0) |
2c07245f ZW |
313 | ret = true; |
314 | else | |
315 | ret = false; | |
e7dbb2f2 | 316 | DRM_DEBUG_KMS("ironlake hotplug adpa=0x%x, result %d\n", adpa, ret); |
2c07245f | 317 | |
2c07245f | 318 | return ret; |
79e53945 JB |
319 | } |
320 | ||
7d2c24e8 JB |
321 | static bool valleyview_crt_detect_hotplug(struct drm_connector *connector) |
322 | { | |
323 | struct drm_device *dev = connector->dev; | |
ca54b810 | 324 | struct intel_crt *crt = intel_attached_crt(connector); |
7d2c24e8 JB |
325 | struct drm_i915_private *dev_priv = dev->dev_private; |
326 | u32 adpa; | |
327 | bool ret; | |
328 | u32 save_adpa; | |
329 | ||
ca54b810 | 330 | save_adpa = adpa = I915_READ(crt->adpa_reg); |
7d2c24e8 JB |
331 | DRM_DEBUG_KMS("trigger hotplug detect cycle: adpa=0x%x\n", adpa); |
332 | ||
333 | adpa |= ADPA_CRT_HOTPLUG_FORCE_TRIGGER; | |
334 | ||
ca54b810 | 335 | I915_WRITE(crt->adpa_reg, adpa); |
7d2c24e8 | 336 | |
ca54b810 | 337 | if (wait_for((I915_READ(crt->adpa_reg) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0, |
7d2c24e8 JB |
338 | 1000)) { |
339 | DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER"); | |
ca54b810 | 340 | I915_WRITE(crt->adpa_reg, save_adpa); |
7d2c24e8 JB |
341 | } |
342 | ||
343 | /* Check the status to see if both blue and green are on now */ | |
ca54b810 | 344 | adpa = I915_READ(crt->adpa_reg); |
7d2c24e8 JB |
345 | if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) != 0) |
346 | ret = true; | |
347 | else | |
348 | ret = false; | |
349 | ||
350 | DRM_DEBUG_KMS("valleyview hotplug adpa=0x%x, result %d\n", adpa, ret); | |
351 | ||
7d2c24e8 JB |
352 | return ret; |
353 | } | |
354 | ||
79e53945 JB |
355 | /** |
356 | * Uses CRT_HOTPLUG_EN and CRT_HOTPLUG_STAT to detect CRT presence. | |
357 | * | |
358 | * Not for i915G/i915GM | |
359 | * | |
360 | * \return true if CRT is connected. | |
361 | * \return false if CRT is disconnected. | |
362 | */ | |
363 | static bool intel_crt_detect_hotplug(struct drm_connector *connector) | |
364 | { | |
365 | struct drm_device *dev = connector->dev; | |
366 | struct drm_i915_private *dev_priv = dev->dev_private; | |
0706f17c | 367 | u32 stat; |
7a772c49 | 368 | bool ret = false; |
771cb081 | 369 | int i, tries = 0; |
2c07245f | 370 | |
bad720ff | 371 | if (HAS_PCH_SPLIT(dev)) |
f2b115e6 | 372 | return intel_ironlake_crt_detect_hotplug(connector); |
2c07245f | 373 | |
7d2c24e8 JB |
374 | if (IS_VALLEYVIEW(dev)) |
375 | return valleyview_crt_detect_hotplug(connector); | |
376 | ||
771cb081 ZY |
377 | /* |
378 | * On 4 series desktop, CRT detect sequence need to be done twice | |
379 | * to get a reliable result. | |
380 | */ | |
79e53945 | 381 | |
771cb081 ZY |
382 | if (IS_G4X(dev) && !IS_GM45(dev)) |
383 | tries = 2; | |
384 | else | |
385 | tries = 1; | |
771cb081 | 386 | |
771cb081 | 387 | for (i = 0; i < tries ; i++) { |
771cb081 | 388 | /* turn on the FORCE_DETECT */ |
0706f17c EE |
389 | i915_hotplug_interrupt_update(dev_priv, |
390 | CRT_HOTPLUG_FORCE_DETECT, | |
391 | CRT_HOTPLUG_FORCE_DETECT); | |
771cb081 | 392 | /* wait for FORCE_DETECT to go off */ |
913d8d11 CW |
393 | if (wait_for((I915_READ(PORT_HOTPLUG_EN) & |
394 | CRT_HOTPLUG_FORCE_DETECT) == 0, | |
481b6af3 | 395 | 1000)) |
79077319 | 396 | DRM_DEBUG_KMS("timed out waiting for FORCE_DETECT to go off"); |
771cb081 | 397 | } |
79e53945 | 398 | |
7a772c49 AJ |
399 | stat = I915_READ(PORT_HOTPLUG_STAT); |
400 | if ((stat & CRT_HOTPLUG_MONITOR_MASK) != CRT_HOTPLUG_MONITOR_NONE) | |
401 | ret = true; | |
402 | ||
403 | /* clear the interrupt we just generated, if any */ | |
404 | I915_WRITE(PORT_HOTPLUG_STAT, CRT_HOTPLUG_INT_STATUS); | |
79e53945 | 405 | |
0706f17c | 406 | i915_hotplug_interrupt_update(dev_priv, CRT_HOTPLUG_FORCE_DETECT, 0); |
7a772c49 AJ |
407 | |
408 | return ret; | |
79e53945 JB |
409 | } |
410 | ||
f1a2f5b7 JN |
411 | static struct edid *intel_crt_get_edid(struct drm_connector *connector, |
412 | struct i2c_adapter *i2c) | |
413 | { | |
414 | struct edid *edid; | |
415 | ||
416 | edid = drm_get_edid(connector, i2c); | |
417 | ||
418 | if (!edid && !intel_gmbus_is_forced_bit(i2c)) { | |
419 | DRM_DEBUG_KMS("CRT GMBUS EDID read failed, retry using GPIO bit-banging\n"); | |
420 | intel_gmbus_force_bit(i2c, true); | |
421 | edid = drm_get_edid(connector, i2c); | |
422 | intel_gmbus_force_bit(i2c, false); | |
423 | } | |
424 | ||
425 | return edid; | |
426 | } | |
427 | ||
428 | /* local version of intel_ddc_get_modes() to use intel_crt_get_edid() */ | |
429 | static int intel_crt_ddc_get_modes(struct drm_connector *connector, | |
430 | struct i2c_adapter *adapter) | |
431 | { | |
432 | struct edid *edid; | |
ebda95a9 | 433 | int ret; |
f1a2f5b7 JN |
434 | |
435 | edid = intel_crt_get_edid(connector, adapter); | |
436 | if (!edid) | |
437 | return 0; | |
438 | ||
ebda95a9 JN |
439 | ret = intel_connector_update_modes(connector, edid); |
440 | kfree(edid); | |
441 | ||
442 | return ret; | |
f1a2f5b7 JN |
443 | } |
444 | ||
f5afcd3d | 445 | static bool intel_crt_detect_ddc(struct drm_connector *connector) |
79e53945 | 446 | { |
f5afcd3d | 447 | struct intel_crt *crt = intel_attached_crt(connector); |
c9a1c4cd | 448 | struct drm_i915_private *dev_priv = crt->base.base.dev->dev_private; |
a2bd1f54 DV |
449 | struct edid *edid; |
450 | struct i2c_adapter *i2c; | |
79e53945 | 451 | |
a2bd1f54 | 452 | BUG_ON(crt->base.type != INTEL_OUTPUT_ANALOG); |
79e53945 | 453 | |
41aa3448 | 454 | i2c = intel_gmbus_get_adapter(dev_priv, dev_priv->vbt.crt_ddc_pin); |
f1a2f5b7 | 455 | edid = intel_crt_get_edid(connector, i2c); |
a2bd1f54 DV |
456 | |
457 | if (edid) { | |
458 | bool is_digital = edid->input & DRM_EDID_INPUT_DIGITAL; | |
f5afcd3d | 459 | |
f5afcd3d DM |
460 | /* |
461 | * This may be a DVI-I connector with a shared DDC | |
462 | * link between analog and digital outputs, so we | |
463 | * have to check the EDID input spec of the attached device. | |
464 | */ | |
f5afcd3d DM |
465 | if (!is_digital) { |
466 | DRM_DEBUG_KMS("CRT detected via DDC:0x50 [EDID]\n"); | |
467 | return true; | |
468 | } | |
a2bd1f54 DV |
469 | |
470 | DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [EDID reports a digital panel]\n"); | |
471 | } else { | |
472 | DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [no valid EDID found]\n"); | |
6ec3d0c0 CW |
473 | } |
474 | ||
a2bd1f54 DV |
475 | kfree(edid); |
476 | ||
6ec3d0c0 | 477 | return false; |
79e53945 JB |
478 | } |
479 | ||
e4a5d54f | 480 | static enum drm_connector_status |
c8ecb2f1 | 481 | intel_crt_load_detect(struct intel_crt *crt, uint32_t pipe) |
e4a5d54f | 482 | { |
7173188d | 483 | struct drm_device *dev = crt->base.base.dev; |
e4a5d54f | 484 | struct drm_i915_private *dev_priv = dev->dev_private; |
e4a5d54f ML |
485 | uint32_t save_bclrpat; |
486 | uint32_t save_vtotal; | |
487 | uint32_t vtotal, vactive; | |
488 | uint32_t vsample; | |
489 | uint32_t vblank, vblank_start, vblank_end; | |
490 | uint32_t dsl; | |
f0f59a00 VS |
491 | i915_reg_t bclrpat_reg, vtotal_reg, |
492 | vblank_reg, vsync_reg, pipeconf_reg, pipe_dsl_reg; | |
e4a5d54f ML |
493 | uint8_t st00; |
494 | enum drm_connector_status status; | |
495 | ||
6ec3d0c0 CW |
496 | DRM_DEBUG_KMS("starting load-detect on CRT\n"); |
497 | ||
9db4a9c7 JB |
498 | bclrpat_reg = BCLRPAT(pipe); |
499 | vtotal_reg = VTOTAL(pipe); | |
500 | vblank_reg = VBLANK(pipe); | |
501 | vsync_reg = VSYNC(pipe); | |
502 | pipeconf_reg = PIPECONF(pipe); | |
503 | pipe_dsl_reg = PIPEDSL(pipe); | |
e4a5d54f ML |
504 | |
505 | save_bclrpat = I915_READ(bclrpat_reg); | |
506 | save_vtotal = I915_READ(vtotal_reg); | |
507 | vblank = I915_READ(vblank_reg); | |
508 | ||
509 | vtotal = ((save_vtotal >> 16) & 0xfff) + 1; | |
510 | vactive = (save_vtotal & 0x7ff) + 1; | |
511 | ||
512 | vblank_start = (vblank & 0xfff) + 1; | |
513 | vblank_end = ((vblank >> 16) & 0xfff) + 1; | |
514 | ||
515 | /* Set the border color to purple. */ | |
516 | I915_WRITE(bclrpat_reg, 0x500050); | |
517 | ||
a6c45cf0 | 518 | if (!IS_GEN2(dev)) { |
e4a5d54f ML |
519 | uint32_t pipeconf = I915_READ(pipeconf_reg); |
520 | I915_WRITE(pipeconf_reg, pipeconf | PIPECONF_FORCE_BORDER); | |
19c55da1 | 521 | POSTING_READ(pipeconf_reg); |
e4a5d54f ML |
522 | /* Wait for next Vblank to substitue |
523 | * border color for Color info */ | |
9d0498a2 | 524 | intel_wait_for_vblank(dev, pipe); |
f0f59a00 | 525 | st00 = I915_READ8(_VGA_MSR_WRITE); |
e4a5d54f ML |
526 | status = ((st00 & (1 << 4)) != 0) ? |
527 | connector_status_connected : | |
528 | connector_status_disconnected; | |
529 | ||
530 | I915_WRITE(pipeconf_reg, pipeconf); | |
531 | } else { | |
532 | bool restore_vblank = false; | |
533 | int count, detect; | |
534 | ||
535 | /* | |
536 | * If there isn't any border, add some. | |
537 | * Yes, this will flicker | |
538 | */ | |
539 | if (vblank_start <= vactive && vblank_end >= vtotal) { | |
540 | uint32_t vsync = I915_READ(vsync_reg); | |
541 | uint32_t vsync_start = (vsync & 0xffff) + 1; | |
542 | ||
543 | vblank_start = vsync_start; | |
544 | I915_WRITE(vblank_reg, | |
545 | (vblank_start - 1) | | |
546 | ((vblank_end - 1) << 16)); | |
547 | restore_vblank = true; | |
548 | } | |
549 | /* sample in the vertical border, selecting the larger one */ | |
550 | if (vblank_start - vactive >= vtotal - vblank_end) | |
551 | vsample = (vblank_start + vactive) >> 1; | |
552 | else | |
553 | vsample = (vtotal + vblank_end) >> 1; | |
554 | ||
555 | /* | |
556 | * Wait for the border to be displayed | |
557 | */ | |
558 | while (I915_READ(pipe_dsl_reg) >= vactive) | |
559 | ; | |
560 | while ((dsl = I915_READ(pipe_dsl_reg)) <= vsample) | |
561 | ; | |
562 | /* | |
563 | * Watch ST00 for an entire scanline | |
564 | */ | |
565 | detect = 0; | |
566 | count = 0; | |
567 | do { | |
568 | count++; | |
569 | /* Read the ST00 VGA status register */ | |
f0f59a00 | 570 | st00 = I915_READ8(_VGA_MSR_WRITE); |
e4a5d54f ML |
571 | if (st00 & (1 << 4)) |
572 | detect++; | |
573 | } while ((I915_READ(pipe_dsl_reg) == dsl)); | |
574 | ||
575 | /* restore vblank if necessary */ | |
576 | if (restore_vblank) | |
577 | I915_WRITE(vblank_reg, vblank); | |
578 | /* | |
579 | * If more than 3/4 of the scanline detected a monitor, | |
580 | * then it is assumed to be present. This works even on i830, | |
581 | * where there isn't any way to force the border color across | |
582 | * the screen | |
583 | */ | |
584 | status = detect * 4 > count * 3 ? | |
585 | connector_status_connected : | |
586 | connector_status_disconnected; | |
587 | } | |
588 | ||
589 | /* Restore previous settings */ | |
590 | I915_WRITE(bclrpat_reg, save_bclrpat); | |
591 | ||
592 | return status; | |
593 | } | |
594 | ||
7b334fcb | 595 | static enum drm_connector_status |
930a9e28 | 596 | intel_crt_detect(struct drm_connector *connector, bool force) |
79e53945 JB |
597 | { |
598 | struct drm_device *dev = connector->dev; | |
c19a0df2 | 599 | struct drm_i915_private *dev_priv = dev->dev_private; |
c9a1c4cd | 600 | struct intel_crt *crt = intel_attached_crt(connector); |
671dedd2 ID |
601 | struct intel_encoder *intel_encoder = &crt->base; |
602 | enum intel_display_power_domain power_domain; | |
e4a5d54f | 603 | enum drm_connector_status status; |
e95c8438 | 604 | struct intel_load_detect_pipe tmp; |
51fd371b | 605 | struct drm_modeset_acquire_ctx ctx; |
79e53945 | 606 | |
164c8598 | 607 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s] force=%d\n", |
c23cc417 | 608 | connector->base.id, connector->name, |
164c8598 CW |
609 | force); |
610 | ||
671dedd2 ID |
611 | power_domain = intel_display_port_power_domain(intel_encoder); |
612 | intel_display_power_get(dev_priv, power_domain); | |
613 | ||
a6c45cf0 | 614 | if (I915_HAS_HOTPLUG(dev)) { |
aaa37730 DV |
615 | /* We can not rely on the HPD pin always being correctly wired |
616 | * up, for example many KVM do not pass it through, and so | |
617 | * only trust an assertion that the monitor is connected. | |
618 | */ | |
6ec3d0c0 CW |
619 | if (intel_crt_detect_hotplug(connector)) { |
620 | DRM_DEBUG_KMS("CRT detected via hotplug\n"); | |
c19a0df2 PZ |
621 | status = connector_status_connected; |
622 | goto out; | |
aaa37730 | 623 | } else |
e7dbb2f2 | 624 | DRM_DEBUG_KMS("CRT not detected via hotplug\n"); |
79e53945 JB |
625 | } |
626 | ||
c19a0df2 PZ |
627 | if (intel_crt_detect_ddc(connector)) { |
628 | status = connector_status_connected; | |
629 | goto out; | |
630 | } | |
79e53945 | 631 | |
aaa37730 DV |
632 | /* Load detection is broken on HPD capable machines. Whoever wants a |
633 | * broken monitor (without edid) to work behind a broken kvm (that fails | |
634 | * to have the right resistors for HP detection) needs to fix this up. | |
635 | * For now just bail out. */ | |
5bedeb2d | 636 | if (I915_HAS_HOTPLUG(dev) && !i915.load_detect_test) { |
c19a0df2 PZ |
637 | status = connector_status_disconnected; |
638 | goto out; | |
639 | } | |
aaa37730 | 640 | |
c19a0df2 PZ |
641 | if (!force) { |
642 | status = connector->status; | |
643 | goto out; | |
644 | } | |
7b334fcb | 645 | |
208bf9fd VS |
646 | drm_modeset_acquire_init(&ctx, 0); |
647 | ||
e4a5d54f | 648 | /* for pre-945g platforms use load detect */ |
51fd371b | 649 | if (intel_get_load_detect_pipe(connector, NULL, &tmp, &ctx)) { |
e95c8438 DV |
650 | if (intel_crt_detect_ddc(connector)) |
651 | status = connector_status_connected; | |
5bedeb2d | 652 | else if (INTEL_INFO(dev)->gen < 4) |
c8ecb2f1 ML |
653 | status = intel_crt_load_detect(crt, |
654 | to_intel_crtc(connector->state->crtc)->pipe); | |
5bedeb2d DV |
655 | else |
656 | status = connector_status_unknown; | |
49172fee | 657 | intel_release_load_detect_pipe(connector, &tmp, &ctx); |
e95c8438 DV |
658 | } else |
659 | status = connector_status_unknown; | |
e4a5d54f | 660 | |
208bf9fd VS |
661 | drm_modeset_drop_locks(&ctx); |
662 | drm_modeset_acquire_fini(&ctx); | |
663 | ||
c19a0df2 | 664 | out: |
671dedd2 | 665 | intel_display_power_put(dev_priv, power_domain); |
e4a5d54f | 666 | return status; |
79e53945 JB |
667 | } |
668 | ||
669 | static void intel_crt_destroy(struct drm_connector *connector) | |
670 | { | |
79e53945 JB |
671 | drm_connector_cleanup(connector); |
672 | kfree(connector); | |
673 | } | |
674 | ||
675 | static int intel_crt_get_modes(struct drm_connector *connector) | |
676 | { | |
8e4d36b9 | 677 | struct drm_device *dev = connector->dev; |
f899fc64 | 678 | struct drm_i915_private *dev_priv = dev->dev_private; |
671dedd2 ID |
679 | struct intel_crt *crt = intel_attached_crt(connector); |
680 | struct intel_encoder *intel_encoder = &crt->base; | |
681 | enum intel_display_power_domain power_domain; | |
890f3359 | 682 | int ret; |
3bd7d909 | 683 | struct i2c_adapter *i2c; |
8e4d36b9 | 684 | |
671dedd2 ID |
685 | power_domain = intel_display_port_power_domain(intel_encoder); |
686 | intel_display_power_get(dev_priv, power_domain); | |
687 | ||
41aa3448 | 688 | i2c = intel_gmbus_get_adapter(dev_priv, dev_priv->vbt.crt_ddc_pin); |
f1a2f5b7 | 689 | ret = intel_crt_ddc_get_modes(connector, i2c); |
8e4d36b9 | 690 | if (ret || !IS_G4X(dev)) |
671dedd2 | 691 | goto out; |
8e4d36b9 | 692 | |
8e4d36b9 | 693 | /* Try to probe digital port for output in DVI-I -> VGA mode. */ |
988c7015 | 694 | i2c = intel_gmbus_get_adapter(dev_priv, GMBUS_PIN_DPB); |
671dedd2 ID |
695 | ret = intel_crt_ddc_get_modes(connector, i2c); |
696 | ||
697 | out: | |
698 | intel_display_power_put(dev_priv, power_domain); | |
699 | ||
700 | return ret; | |
79e53945 JB |
701 | } |
702 | ||
703 | static int intel_crt_set_property(struct drm_connector *connector, | |
704 | struct drm_property *property, | |
705 | uint64_t value) | |
706 | { | |
79e53945 JB |
707 | return 0; |
708 | } | |
709 | ||
f3269058 CW |
710 | static void intel_crt_reset(struct drm_connector *connector) |
711 | { | |
712 | struct drm_device *dev = connector->dev; | |
2e938892 | 713 | struct drm_i915_private *dev_priv = dev->dev_private; |
f3269058 CW |
714 | struct intel_crt *crt = intel_attached_crt(connector); |
715 | ||
10603caa | 716 | if (INTEL_INFO(dev)->gen >= 5) { |
2e938892 DV |
717 | u32 adpa; |
718 | ||
ca54b810 | 719 | adpa = I915_READ(crt->adpa_reg); |
2e938892 DV |
720 | adpa &= ~ADPA_CRT_HOTPLUG_MASK; |
721 | adpa |= ADPA_HOTPLUG_BITS; | |
ca54b810 VS |
722 | I915_WRITE(crt->adpa_reg, adpa); |
723 | POSTING_READ(crt->adpa_reg); | |
2e938892 | 724 | |
0039a4b3 | 725 | DRM_DEBUG_KMS("crt adpa set to 0x%x\n", adpa); |
f3269058 | 726 | crt->force_hotplug_required = 1; |
2e938892 DV |
727 | } |
728 | ||
f3269058 CW |
729 | } |
730 | ||
79e53945 JB |
731 | /* |
732 | * Routines for controlling stuff on the analog port | |
733 | */ | |
734 | ||
79e53945 | 735 | static const struct drm_connector_funcs intel_crt_connector_funcs = { |
f3269058 | 736 | .reset = intel_crt_reset, |
4d688a2a | 737 | .dpms = drm_atomic_helper_connector_dpms, |
79e53945 JB |
738 | .detect = intel_crt_detect, |
739 | .fill_modes = drm_helper_probe_single_connector_modes, | |
740 | .destroy = intel_crt_destroy, | |
741 | .set_property = intel_crt_set_property, | |
c6f95f27 | 742 | .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, |
98969725 | 743 | .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, |
2545e4a6 | 744 | .atomic_get_property = intel_connector_atomic_get_property, |
79e53945 JB |
745 | }; |
746 | ||
747 | static const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs = { | |
748 | .mode_valid = intel_crt_mode_valid, | |
749 | .get_modes = intel_crt_get_modes, | |
df0e9248 | 750 | .best_encoder = intel_best_encoder, |
79e53945 JB |
751 | }; |
752 | ||
79e53945 | 753 | static const struct drm_encoder_funcs intel_crt_enc_funcs = { |
ea5b213a | 754 | .destroy = intel_encoder_destroy, |
79e53945 JB |
755 | }; |
756 | ||
bbe1c274 | 757 | static int intel_no_crt_dmi_callback(const struct dmi_system_id *id) |
8ca4013d | 758 | { |
bc0daf48 | 759 | DRM_INFO("Skipping CRT initialization for %s\n", id->ident); |
8ca4013d DL |
760 | return 1; |
761 | } | |
762 | ||
763 | static const struct dmi_system_id intel_no_crt[] = { | |
764 | { | |
765 | .callback = intel_no_crt_dmi_callback, | |
766 | .ident = "ACER ZGB", | |
767 | .matches = { | |
768 | DMI_MATCH(DMI_SYS_VENDOR, "ACER"), | |
769 | DMI_MATCH(DMI_PRODUCT_NAME, "ZGB"), | |
770 | }, | |
771 | }, | |
10b6ee4a GC |
772 | { |
773 | .callback = intel_no_crt_dmi_callback, | |
774 | .ident = "DELL XPS 8700", | |
775 | .matches = { | |
776 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | |
777 | DMI_MATCH(DMI_PRODUCT_NAME, "XPS 8700"), | |
778 | }, | |
779 | }, | |
8ca4013d DL |
780 | { } |
781 | }; | |
782 | ||
79e53945 JB |
783 | void intel_crt_init(struct drm_device *dev) |
784 | { | |
785 | struct drm_connector *connector; | |
c9a1c4cd | 786 | struct intel_crt *crt; |
454c1ca8 | 787 | struct intel_connector *intel_connector; |
db545019 | 788 | struct drm_i915_private *dev_priv = dev->dev_private; |
6c03a6bd VS |
789 | i915_reg_t adpa_reg; |
790 | u32 adpa; | |
79e53945 | 791 | |
8ca4013d DL |
792 | /* Skip machines without VGA that falsely report hotplug events */ |
793 | if (dmi_check_system(intel_no_crt)) | |
794 | return; | |
795 | ||
6c03a6bd VS |
796 | if (HAS_PCH_SPLIT(dev)) |
797 | adpa_reg = PCH_ADPA; | |
798 | else if (IS_VALLEYVIEW(dev)) | |
799 | adpa_reg = VLV_ADPA; | |
800 | else | |
801 | adpa_reg = ADPA; | |
802 | ||
803 | adpa = I915_READ(adpa_reg); | |
804 | if ((adpa & ADPA_DAC_ENABLE) == 0) { | |
805 | /* | |
806 | * On some machines (some IVB at least) CRT can be | |
807 | * fused off, but there's no known fuse bit to | |
808 | * indicate that. On these machine the ADPA register | |
809 | * works normally, except the DAC enable bit won't | |
810 | * take. So the only way to tell is attempt to enable | |
811 | * it and see what happens. | |
812 | */ | |
813 | I915_WRITE(adpa_reg, adpa | ADPA_DAC_ENABLE | | |
814 | ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE); | |
815 | if ((I915_READ(adpa_reg) & ADPA_DAC_ENABLE) == 0) | |
816 | return; | |
817 | I915_WRITE(adpa_reg, adpa); | |
818 | } | |
819 | ||
c9a1c4cd CW |
820 | crt = kzalloc(sizeof(struct intel_crt), GFP_KERNEL); |
821 | if (!crt) | |
79e53945 JB |
822 | return; |
823 | ||
9bdbd0b9 | 824 | intel_connector = intel_connector_alloc(); |
454c1ca8 | 825 | if (!intel_connector) { |
c9a1c4cd | 826 | kfree(crt); |
454c1ca8 ZW |
827 | return; |
828 | } | |
829 | ||
830 | connector = &intel_connector->base; | |
637f44d2 | 831 | crt->connector = intel_connector; |
454c1ca8 | 832 | drm_connector_init(dev, &intel_connector->base, |
79e53945 JB |
833 | &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA); |
834 | ||
c9a1c4cd | 835 | drm_encoder_init(dev, &crt->base.base, &intel_crt_enc_funcs, |
13a3d91f | 836 | DRM_MODE_ENCODER_DAC, NULL); |
79e53945 | 837 | |
c9a1c4cd | 838 | intel_connector_attach_encoder(intel_connector, &crt->base); |
79e53945 | 839 | |
c9a1c4cd | 840 | crt->base.type = INTEL_OUTPUT_ANALOG; |
301ea74a | 841 | crt->base.cloneable = (1 << INTEL_OUTPUT_DVO) | (1 << INTEL_OUTPUT_HDMI); |
d63fa0dc | 842 | if (IS_I830(dev)) |
59c859d6 ED |
843 | crt->base.crtc_mask = (1 << 0); |
844 | else | |
0826874a | 845 | crt->base.crtc_mask = (1 << 0) | (1 << 1) | (1 << 2); |
59c859d6 | 846 | |
dbb02575 DV |
847 | if (IS_GEN2(dev)) |
848 | connector->interlace_allowed = 0; | |
849 | else | |
850 | connector->interlace_allowed = 1; | |
79e53945 JB |
851 | connector->doublescan_allowed = 0; |
852 | ||
6c03a6bd | 853 | crt->adpa_reg = adpa_reg; |
540a8950 | 854 | |
5bfe2ac0 | 855 | crt->base.compute_config = intel_crt_compute_config; |
92966a37 | 856 | if (HAS_PCH_SPLIT(dev)) { |
1ea56e26 VS |
857 | crt->base.disable = pch_disable_crt; |
858 | crt->base.post_disable = pch_post_disable_crt; | |
859 | } else { | |
860 | crt->base.disable = intel_disable_crt; | |
861 | } | |
2124604b | 862 | crt->base.enable = intel_enable_crt; |
1d843f9d EE |
863 | if (I915_HAS_HOTPLUG(dev)) |
864 | crt->base.hpd_pin = HPD_CRT; | |
a2985791 VS |
865 | if (HAS_DDI(dev)) { |
866 | crt->base.get_config = hsw_crt_get_config; | |
4eda01b2 | 867 | crt->base.get_hw_state = intel_ddi_get_hw_state; |
a2985791 VS |
868 | } else { |
869 | crt->base.get_config = intel_crt_get_config; | |
4eda01b2 | 870 | crt->base.get_hw_state = intel_crt_get_hw_state; |
a2985791 | 871 | } |
e403fc94 | 872 | intel_connector->get_hw_state = intel_connector_get_hw_state; |
4932e2c3 | 873 | intel_connector->unregister = intel_connector_unregister; |
df0323c4 | 874 | |
79e53945 JB |
875 | drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs); |
876 | ||
34ea3d38 | 877 | drm_connector_register(connector); |
b01f2c3a | 878 | |
821450c6 EE |
879 | if (!I915_HAS_HOTPLUG(dev)) |
880 | intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT; | |
eb1f8e4f | 881 | |
e7dbb2f2 KP |
882 | /* |
883 | * Configure the automatic hotplug detection stuff | |
884 | */ | |
885 | crt->force_hotplug_required = 0; | |
e7dbb2f2 | 886 | |
68d18ad7 | 887 | /* |
3e68320e DL |
888 | * TODO: find a proper way to discover whether we need to set the the |
889 | * polarity and link reversal bits or not, instead of relying on the | |
890 | * BIOS. | |
68d18ad7 | 891 | */ |
3e68320e DL |
892 | if (HAS_PCH_LPT(dev)) { |
893 | u32 fdi_config = FDI_RX_POLARITY_REVERSED_LPT | | |
894 | FDI_RX_LINK_REVERSAL_OVERRIDE; | |
895 | ||
eede3b53 | 896 | dev_priv->fdi_rx_config = I915_READ(FDI_RX_CTL(PIPE_A)) & fdi_config; |
3e68320e | 897 | } |
754970ee DV |
898 | |
899 | intel_crt_reset(connector); | |
79e53945 | 900 | } |