diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 94f860cce3f7..110552ff302c 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -49,7 +49,7 @@ struct intel_dp { | |||
49 | uint32_t DP; | 49 | uint32_t DP; |
50 | uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE]; | 50 | uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE]; |
51 | bool has_audio; | 51 | bool has_audio; |
52 | int force_audio; | 52 | enum hdmi_force_audio force_audio; |
53 | uint32_t color_range; | 53 | uint32_t color_range; |
54 | int dpms_mode; | 54 | int dpms_mode; |
55 | uint8_t link_bw; | 55 | uint8_t link_bw; |
@@ -352,7 +352,7 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, | |||
352 | int recv_bytes; | 352 | int recv_bytes; |
353 | uint32_t status; | 353 | uint32_t status; |
354 | uint32_t aux_clock_divider; | 354 | uint32_t aux_clock_divider; |
355 | int try, precharge; | 355 | int try, precharge = 5; |
356 | 356 | ||
357 | intel_dp_check_edp(intel_dp); | 357 | intel_dp_check_edp(intel_dp); |
358 | /* The clock divider is based off the hrawclk, | 358 | /* The clock divider is based off the hrawclk, |
@@ -368,15 +368,10 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, | |||
368 | else | 368 | else |
369 | aux_clock_divider = 225; /* eDP input clock at 450Mhz */ | 369 | aux_clock_divider = 225; /* eDP input clock at 450Mhz */ |
370 | } else if (HAS_PCH_SPLIT(dev)) | 370 | } else if (HAS_PCH_SPLIT(dev)) |
371 | aux_clock_divider = 62; /* IRL input clock fixed at 125Mhz */ | 371 | aux_clock_divider = 63; /* IRL input clock fixed at 125Mhz */ |
372 | else | 372 | else |
373 | aux_clock_divider = intel_hrawclk(dev) / 2; | 373 | aux_clock_divider = intel_hrawclk(dev) / 2; |
374 | 374 | ||
375 | if (IS_GEN6(dev)) | ||
376 | precharge = 3; | ||
377 | else | ||
378 | precharge = 5; | ||
379 | |||
380 | /* Try to wait for any previous AUX channel activity */ | 375 | /* Try to wait for any previous AUX channel activity */ |
381 | for (try = 0; try < 3; try++) { | 376 | for (try = 0; try < 3; try++) { |
382 | status = I915_READ(ch_ctl); | 377 | status = I915_READ(ch_ctl); |
@@ -421,6 +416,10 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, | |||
421 | DP_AUX_CH_CTL_DONE | | 416 | DP_AUX_CH_CTL_DONE | |
422 | DP_AUX_CH_CTL_TIME_OUT_ERROR | | 417 | DP_AUX_CH_CTL_TIME_OUT_ERROR | |
423 | DP_AUX_CH_CTL_RECEIVE_ERROR); | 418 | DP_AUX_CH_CTL_RECEIVE_ERROR); |
419 | |||
420 | if (status & (DP_AUX_CH_CTL_TIME_OUT_ERROR | | ||
421 | DP_AUX_CH_CTL_RECEIVE_ERROR)) | ||
422 | continue; | ||
424 | if (status & DP_AUX_CH_CTL_DONE) | 423 | if (status & DP_AUX_CH_CTL_DONE) |
425 | break; | 424 | break; |
426 | } | 425 | } |
@@ -2117,8 +2116,8 @@ intel_dp_detect(struct drm_connector *connector, bool force) | |||
2117 | if (status != connector_status_connected) | 2116 | if (status != connector_status_connected) |
2118 | return status; | 2117 | return status; |
2119 | 2118 | ||
2120 | if (intel_dp->force_audio) { | 2119 | if (intel_dp->force_audio != HDMI_AUDIO_AUTO) { |
2121 | intel_dp->has_audio = intel_dp->force_audio > 0; | 2120 | intel_dp->has_audio = (intel_dp->force_audio == HDMI_AUDIO_ON); |
2122 | } else { | 2121 | } else { |
2123 | edid = intel_dp_get_edid(connector, &intel_dp->adapter); | 2122 | edid = intel_dp_get_edid(connector, &intel_dp->adapter); |
2124 | if (edid) { | 2123 | if (edid) { |
@@ -2218,10 +2217,10 @@ intel_dp_set_property(struct drm_connector *connector, | |||
2218 | 2217 | ||
2219 | intel_dp->force_audio = i; | 2218 | intel_dp->force_audio = i; |
2220 | 2219 | ||
2221 | if (i == 0) | 2220 | if (i == HDMI_AUDIO_AUTO) |
2222 | has_audio = intel_dp_detect_audio(connector); | 2221 | has_audio = intel_dp_detect_audio(connector); |
2223 | else | 2222 | else |
2224 | has_audio = i > 0; | 2223 | has_audio = (i == HDMI_AUDIO_ON); |
2225 | 2224 | ||
2226 | if (has_audio == intel_dp->has_audio) | 2225 | if (has_audio == intel_dp->has_audio) |
2227 | return 0; | 2226 | return 0; |