aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_dp.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-09-19 16:54:47 -0400
committerKeith Packard <keithp@keithp.com>2011-09-30 19:23:45 -0400
commit9b984daec45632c4c1ef6e628dca4d2bc8f544ed (patch)
tree93dc57e7d712dcf1be291b078308894ce01c1bc5 /drivers/gpu/drm/i915/intel_dp.c
parent47f0eb2234a2a1c790825393bbaccfadf82463d3 (diff)
drm/i915: Check eDP power when doing aux channel communications
Verify that the eDP VDD is on, either with the panel being on or with the VDD force-on bit being set. This demonstrates that in many instances, VDD is not on when needed, which leads to failed EDID communications. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp.c')
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 3717fa699f56..1bf3258824c2 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -279,6 +279,24 @@ intel_hrawclk(struct drm_device *dev)
279 } 279 }
280} 280}
281 281
282static void
283intel_dp_check_edp(struct intel_dp *intel_dp)
284{
285 struct drm_device *dev = intel_dp->base.base.dev;
286 struct drm_i915_private *dev_priv = dev->dev_private;
287 u32 pp_status, pp_control;
288 if (!is_edp(intel_dp))
289 return;
290 pp_status = I915_READ(PCH_PP_STATUS);
291 pp_control = I915_READ(PCH_PP_CONTROL);
292 if ((pp_status & PP_ON) == 0 && (pp_control & EDP_FORCE_VDD) == 0) {
293 WARN(1, "eDP powered off while attempting aux channel communication.\n");
294 DRM_DEBUG_KMS("Status 0x%08x Control 0x%08x\n",
295 pp_status,
296 I915_READ(PCH_PP_CONTROL));
297 }
298}
299
282static int 300static int
283intel_dp_aux_ch(struct intel_dp *intel_dp, 301intel_dp_aux_ch(struct intel_dp *intel_dp,
284 uint8_t *send, int send_bytes, 302 uint8_t *send, int send_bytes,
@@ -295,6 +313,7 @@ intel_dp_aux_ch(struct intel_dp *intel_dp,
295 uint32_t aux_clock_divider; 313 uint32_t aux_clock_divider;
296 int try, precharge; 314 int try, precharge;
297 315
316 intel_dp_check_edp(intel_dp);
298 /* The clock divider is based off the hrawclk, 317 /* The clock divider is based off the hrawclk,
299 * and would like to run at 2MHz. So, take the 318 * and would like to run at 2MHz. So, take the
300 * hrawclk value and divide by 2 and use that 319 * hrawclk value and divide by 2 and use that
@@ -408,6 +427,7 @@ intel_dp_aux_native_write(struct intel_dp *intel_dp,
408 int msg_bytes; 427 int msg_bytes;
409 uint8_t ack; 428 uint8_t ack;
410 429
430 intel_dp_check_edp(intel_dp);
411 if (send_bytes > 16) 431 if (send_bytes > 16)
412 return -1; 432 return -1;
413 msg[0] = AUX_NATIVE_WRITE << 4; 433 msg[0] = AUX_NATIVE_WRITE << 4;
@@ -450,6 +470,7 @@ intel_dp_aux_native_read(struct intel_dp *intel_dp,
450 uint8_t ack; 470 uint8_t ack;
451 int ret; 471 int ret;
452 472
473 intel_dp_check_edp(intel_dp);
453 msg[0] = AUX_NATIVE_READ << 4; 474 msg[0] = AUX_NATIVE_READ << 4;
454 msg[1] = address >> 8; 475 msg[1] = address >> 8;
455 msg[2] = address & 0xff; 476 msg[2] = address & 0xff;
@@ -493,6 +514,7 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
493 int reply_bytes; 514 int reply_bytes;
494 int ret; 515 int ret;
495 516
517 intel_dp_check_edp(intel_dp);
496 /* Set up the command byte */ 518 /* Set up the command byte */
497 if (mode & MODE_I2C_READ) 519 if (mode & MODE_I2C_READ)
498 msg[0] = AUX_I2C_READ << 4; 520 msg[0] = AUX_I2C_READ << 4;