diff options
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_crt.c | 20 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_i2c.c | 25 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 34 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo_regs.h | 2 |
7 files changed, 27 insertions, 60 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 5004724ea57e..1c1b27c97e5c 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -630,7 +630,7 @@ typedef struct drm_i915_private { | |||
630 | * Flag if the hardware appears to be wedged. | 630 | * Flag if the hardware appears to be wedged. |
631 | * | 631 | * |
632 | * This is set when attempts to idle the device timeout. | 632 | * This is set when attempts to idle the device timeout. |
633 | * It prevents command submission from occuring and makes | 633 | * It prevents command submission from occurring and makes |
634 | * every pending request fail | 634 | * every pending request fail |
635 | */ | 635 | */ |
636 | atomic_t wedged; | 636 | atomic_t wedged; |
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 8342259f3160..d03fc05b39c0 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -269,21 +269,6 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector) | |||
269 | return ret; | 269 | return ret; |
270 | } | 270 | } |
271 | 271 | ||
272 | static bool intel_crt_ddc_probe(struct drm_i915_private *dev_priv, int ddc_bus) | ||
273 | { | ||
274 | u8 buf; | ||
275 | struct i2c_msg msgs[] = { | ||
276 | { | ||
277 | .addr = 0xA0, | ||
278 | .flags = 0, | ||
279 | .len = 1, | ||
280 | .buf = &buf, | ||
281 | }, | ||
282 | }; | ||
283 | /* DDC monitor detect: Does it ACK a write to 0xA0? */ | ||
284 | return i2c_transfer(&dev_priv->gmbus[ddc_bus].adapter, msgs, 1) == 1; | ||
285 | } | ||
286 | |||
287 | static bool intel_crt_detect_ddc(struct drm_connector *connector) | 272 | static bool intel_crt_detect_ddc(struct drm_connector *connector) |
288 | { | 273 | { |
289 | struct intel_crt *crt = intel_attached_crt(connector); | 274 | struct intel_crt *crt = intel_attached_crt(connector); |
@@ -293,11 +278,6 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector) | |||
293 | if (crt->base.type != INTEL_OUTPUT_ANALOG) | 278 | if (crt->base.type != INTEL_OUTPUT_ANALOG) |
294 | return false; | 279 | return false; |
295 | 280 | ||
296 | if (intel_crt_ddc_probe(dev_priv, dev_priv->crt_ddc_pin)) { | ||
297 | DRM_DEBUG_KMS("CRT detected via DDC:0xa0\n"); | ||
298 | return true; | ||
299 | } | ||
300 | |||
301 | if (intel_ddc_probe(&crt->base, dev_priv->crt_ddc_pin)) { | 281 | if (intel_ddc_probe(&crt->base, dev_priv->crt_ddc_pin)) { |
302 | struct edid *edid; | 282 | struct edid *edid; |
303 | bool is_digital = false; | 283 | bool is_digital = false; |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 0daefca5cbb8..cb8578b7e443 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -213,7 +213,7 @@ intel_dp_mode_valid(struct drm_connector *connector, | |||
213 | return MODE_PANEL; | 213 | return MODE_PANEL; |
214 | } | 214 | } |
215 | 215 | ||
216 | /* only refuse the mode on non eDP since we have seen some wierd eDP panels | 216 | /* only refuse the mode on non eDP since we have seen some weird eDP panels |
217 | which are outside spec tolerances but somehow work by magic */ | 217 | which are outside spec tolerances but somehow work by magic */ |
218 | if (!is_edp(intel_dp) && | 218 | if (!is_edp(intel_dp) && |
219 | (intel_dp_link_required(connector->dev, intel_dp, mode->clock) | 219 | (intel_dp_link_required(connector->dev, intel_dp, mode->clock) |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 5daa991cb287..f5b0d8306d83 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -39,7 +39,7 @@ | |||
39 | ret__ = -ETIMEDOUT; \ | 39 | ret__ = -ETIMEDOUT; \ |
40 | break; \ | 40 | break; \ |
41 | } \ | 41 | } \ |
42 | if (W && !in_dbg_master()) msleep(W); \ | 42 | if (W && !(in_atomic() || in_dbg_master())) msleep(W); \ |
43 | } \ | 43 | } \ |
44 | ret__; \ | 44 | ret__; \ |
45 | }) | 45 | }) |
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c index 82d04c5899d2..d3b903bce7c5 100644 --- a/drivers/gpu/drm/i915/intel_i2c.c +++ b/drivers/gpu/drm/i915/intel_i2c.c | |||
@@ -259,7 +259,7 @@ gmbus_xfer(struct i2c_adapter *adapter, | |||
259 | if (wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_RDY), 50)) | 259 | if (wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_RDY), 50)) |
260 | goto timeout; | 260 | goto timeout; |
261 | if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER) | 261 | if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER) |
262 | return 0; | 262 | goto clear_err; |
263 | 263 | ||
264 | val = I915_READ(GMBUS3 + reg_offset); | 264 | val = I915_READ(GMBUS3 + reg_offset); |
265 | do { | 265 | do { |
@@ -287,7 +287,7 @@ gmbus_xfer(struct i2c_adapter *adapter, | |||
287 | if (wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_RDY), 50)) | 287 | if (wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_RDY), 50)) |
288 | goto timeout; | 288 | goto timeout; |
289 | if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER) | 289 | if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER) |
290 | return 0; | 290 | goto clear_err; |
291 | 291 | ||
292 | val = loop = 0; | 292 | val = loop = 0; |
293 | do { | 293 | do { |
@@ -302,14 +302,31 @@ gmbus_xfer(struct i2c_adapter *adapter, | |||
302 | if (i + 1 < num && wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_WAIT_PHASE), 50)) | 302 | if (i + 1 < num && wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_WAIT_PHASE), 50)) |
303 | goto timeout; | 303 | goto timeout; |
304 | if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER) | 304 | if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER) |
305 | return 0; | 305 | goto clear_err; |
306 | } | 306 | } |
307 | 307 | ||
308 | return num; | 308 | goto done; |
309 | |||
310 | clear_err: | ||
311 | /* Toggle the Software Clear Interrupt bit. This has the effect | ||
312 | * of resetting the GMBUS controller and so clearing the | ||
313 | * BUS_ERROR raised by the slave's NAK. | ||
314 | */ | ||
315 | I915_WRITE(GMBUS1 + reg_offset, GMBUS_SW_CLR_INT); | ||
316 | I915_WRITE(GMBUS1 + reg_offset, 0); | ||
317 | |||
318 | done: | ||
319 | /* Mark the GMBUS interface as disabled. We will re-enable it at the | ||
320 | * start of the next xfer, till then let it sleep. | ||
321 | */ | ||
322 | I915_WRITE(GMBUS0 + reg_offset, 0); | ||
323 | return i; | ||
309 | 324 | ||
310 | timeout: | 325 | timeout: |
311 | DRM_INFO("GMBUS timed out, falling back to bit banging on pin %d [%s]\n", | 326 | DRM_INFO("GMBUS timed out, falling back to bit banging on pin %d [%s]\n", |
312 | bus->reg0 & 0xff, bus->adapter.name); | 327 | bus->reg0 & 0xff, bus->adapter.name); |
328 | I915_WRITE(GMBUS0 + reg_offset, 0); | ||
329 | |||
313 | /* Hardware may not support GMBUS over these pins? Try GPIO bitbanging instead. */ | 330 | /* Hardware may not support GMBUS over these pins? Try GPIO bitbanging instead. */ |
314 | bus->force_bit = intel_gpio_create(dev_priv, bus->reg0 & 0xff); | 331 | bus->force_bit = intel_gpio_create(dev_priv, bus->reg0 & 0xff); |
315 | if (!bus->force_bit) | 332 | if (!bus->force_bit) |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 1a311ad01116..a562bd2648c7 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -473,19 +473,13 @@ static enum drm_connector_status | |||
473 | intel_lvds_detect(struct drm_connector *connector, bool force) | 473 | intel_lvds_detect(struct drm_connector *connector, bool force) |
474 | { | 474 | { |
475 | struct drm_device *dev = connector->dev; | 475 | struct drm_device *dev = connector->dev; |
476 | enum drm_connector_status status = connector_status_connected; | 476 | enum drm_connector_status status; |
477 | 477 | ||
478 | status = intel_panel_detect(dev); | 478 | status = intel_panel_detect(dev); |
479 | if (status != connector_status_unknown) | 479 | if (status != connector_status_unknown) |
480 | return status; | 480 | return status; |
481 | 481 | ||
482 | /* ACPI lid methods were generally unreliable in this generation, so | 482 | return connector_status_connected; |
483 | * don't even bother. | ||
484 | */ | ||
485 | if (IS_GEN2(dev) || IS_GEN3(dev)) | ||
486 | return connector_status_connected; | ||
487 | |||
488 | return status; | ||
489 | } | 483 | } |
490 | 484 | ||
491 | /** | 485 | /** |
@@ -835,25 +829,6 @@ static bool lvds_is_present_in_vbt(struct drm_device *dev, | |||
835 | return false; | 829 | return false; |
836 | } | 830 | } |
837 | 831 | ||
838 | static bool intel_lvds_ddc_probe(struct drm_device *dev, u8 pin) | ||
839 | { | ||
840 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
841 | u8 buf = 0; | ||
842 | struct i2c_msg msgs[] = { | ||
843 | { | ||
844 | .addr = 0xA0, | ||
845 | .flags = 0, | ||
846 | .len = 1, | ||
847 | .buf = &buf, | ||
848 | }, | ||
849 | }; | ||
850 | struct i2c_adapter *i2c = &dev_priv->gmbus[pin].adapter; | ||
851 | /* XXX this only appears to work when using GMBUS */ | ||
852 | if (intel_gmbus_is_forced_bit(i2c)) | ||
853 | return true; | ||
854 | return i2c_transfer(i2c, msgs, 1) == 1; | ||
855 | } | ||
856 | |||
857 | /** | 832 | /** |
858 | * intel_lvds_init - setup LVDS connectors on this device | 833 | * intel_lvds_init - setup LVDS connectors on this device |
859 | * @dev: drm device | 834 | * @dev: drm device |
@@ -894,11 +869,6 @@ bool intel_lvds_init(struct drm_device *dev) | |||
894 | } | 869 | } |
895 | } | 870 | } |
896 | 871 | ||
897 | if (!intel_lvds_ddc_probe(dev, pin)) { | ||
898 | DRM_DEBUG_KMS("LVDS did not respond to DDC probe\n"); | ||
899 | return false; | ||
900 | } | ||
901 | |||
902 | intel_lvds = kzalloc(sizeof(struct intel_lvds), GFP_KERNEL); | 872 | intel_lvds = kzalloc(sizeof(struct intel_lvds), GFP_KERNEL); |
903 | if (!intel_lvds) { | 873 | if (!intel_lvds) { |
904 | return false; | 874 | return false; |
diff --git a/drivers/gpu/drm/i915/intel_sdvo_regs.h b/drivers/gpu/drm/i915/intel_sdvo_regs.h index a386b022e538..4f4e23bc2d16 100644 --- a/drivers/gpu/drm/i915/intel_sdvo_regs.h +++ b/drivers/gpu/drm/i915/intel_sdvo_regs.h | |||
@@ -230,7 +230,7 @@ struct intel_sdvo_set_target_input_args { | |||
230 | } __attribute__((packed)); | 230 | } __attribute__((packed)); |
231 | 231 | ||
232 | /** | 232 | /** |
233 | * Takes a struct intel_sdvo_output_flags of which outputs are targetted by | 233 | * Takes a struct intel_sdvo_output_flags of which outputs are targeted by |
234 | * future output commands. | 234 | * future output commands. |
235 | * | 235 | * |
236 | * Affected commands inclue SET_OUTPUT_TIMINGS_PART[12], | 236 | * Affected commands inclue SET_OUTPUT_TIMINGS_PART[12], |