diff options
author | Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> | 2015-10-23 06:01:50 -0400 |
---|---|---|
committer | Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> | 2015-11-05 08:14:56 -0500 |
commit | e588fa18c1cc490fa75c0b4bd1d4f7758ccd33cf (patch) | |
tree | ab8cce2e6c123cd5a08b03635ba51347b5dc55e7 | |
parent | ad64217b030c6f7af3613577bcefeef8a5ad91be (diff) |
drm/i915: Make intel_dp_source_supports_hbr2() take an intel_dp pointer
The function name implies it should get intel_dp, and it mostly used
where there is an intel_dp in the context.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1445594525-7174-8-git-send-email-ander.conselvan.de.oliveira@intel.com
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 19 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp_link_training.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 2 |
3 files changed, 13 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index dd49286100ea..5264887311f1 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -1189,8 +1189,11 @@ intel_dp_sink_rates(struct intel_dp *intel_dp, const int **sink_rates) | |||
1189 | return (intel_dp_max_link_bw(intel_dp) >> 3) + 1; | 1189 | return (intel_dp_max_link_bw(intel_dp) >> 3) + 1; |
1190 | } | 1190 | } |
1191 | 1191 | ||
1192 | bool intel_dp_source_supports_hbr2(struct drm_device *dev) | 1192 | bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp) |
1193 | { | 1193 | { |
1194 | struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); | ||
1195 | struct drm_device *dev = dig_port->base.base.dev; | ||
1196 | |||
1194 | /* WaDisableHBR2:skl */ | 1197 | /* WaDisableHBR2:skl */ |
1195 | if (IS_SKL_REVID(dev, 0, SKL_REVID_B0)) | 1198 | if (IS_SKL_REVID(dev, 0, SKL_REVID_B0)) |
1196 | return false; | 1199 | return false; |
@@ -1203,8 +1206,10 @@ bool intel_dp_source_supports_hbr2(struct drm_device *dev) | |||
1203 | } | 1206 | } |
1204 | 1207 | ||
1205 | static int | 1208 | static int |
1206 | intel_dp_source_rates(struct drm_device *dev, const int **source_rates) | 1209 | intel_dp_source_rates(struct intel_dp *intel_dp, const int **source_rates) |
1207 | { | 1210 | { |
1211 | struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); | ||
1212 | struct drm_device *dev = dig_port->base.base.dev; | ||
1208 | int size; | 1213 | int size; |
1209 | 1214 | ||
1210 | if (IS_BROXTON(dev)) { | 1215 | if (IS_BROXTON(dev)) { |
@@ -1219,7 +1224,7 @@ intel_dp_source_rates(struct drm_device *dev, const int **source_rates) | |||
1219 | } | 1224 | } |
1220 | 1225 | ||
1221 | /* This depends on the fact that 5.4 is last value in the array */ | 1226 | /* This depends on the fact that 5.4 is last value in the array */ |
1222 | if (!intel_dp_source_supports_hbr2(dev)) | 1227 | if (!intel_dp_source_supports_hbr2(intel_dp)) |
1223 | size--; | 1228 | size--; |
1224 | 1229 | ||
1225 | return size; | 1230 | return size; |
@@ -1284,12 +1289,11 @@ static int intersect_rates(const int *source_rates, int source_len, | |||
1284 | static int intel_dp_common_rates(struct intel_dp *intel_dp, | 1289 | static int intel_dp_common_rates(struct intel_dp *intel_dp, |
1285 | int *common_rates) | 1290 | int *common_rates) |
1286 | { | 1291 | { |
1287 | struct drm_device *dev = intel_dp_to_dev(intel_dp); | ||
1288 | const int *source_rates, *sink_rates; | 1292 | const int *source_rates, *sink_rates; |
1289 | int source_len, sink_len; | 1293 | int source_len, sink_len; |
1290 | 1294 | ||
1291 | sink_len = intel_dp_sink_rates(intel_dp, &sink_rates); | 1295 | sink_len = intel_dp_sink_rates(intel_dp, &sink_rates); |
1292 | source_len = intel_dp_source_rates(dev, &source_rates); | 1296 | source_len = intel_dp_source_rates(intel_dp, &source_rates); |
1293 | 1297 | ||
1294 | return intersect_rates(source_rates, source_len, | 1298 | return intersect_rates(source_rates, source_len, |
1295 | sink_rates, sink_len, | 1299 | sink_rates, sink_len, |
@@ -1314,7 +1318,6 @@ static void snprintf_int_array(char *str, size_t len, | |||
1314 | 1318 | ||
1315 | static void intel_dp_print_rates(struct intel_dp *intel_dp) | 1319 | static void intel_dp_print_rates(struct intel_dp *intel_dp) |
1316 | { | 1320 | { |
1317 | struct drm_device *dev = intel_dp_to_dev(intel_dp); | ||
1318 | const int *source_rates, *sink_rates; | 1321 | const int *source_rates, *sink_rates; |
1319 | int source_len, sink_len, common_len; | 1322 | int source_len, sink_len, common_len; |
1320 | int common_rates[DP_MAX_SUPPORTED_RATES]; | 1323 | int common_rates[DP_MAX_SUPPORTED_RATES]; |
@@ -1323,7 +1326,7 @@ static void intel_dp_print_rates(struct intel_dp *intel_dp) | |||
1323 | if ((drm_debug & DRM_UT_KMS) == 0) | 1326 | if ((drm_debug & DRM_UT_KMS) == 0) |
1324 | return; | 1327 | return; |
1325 | 1328 | ||
1326 | source_len = intel_dp_source_rates(dev, &source_rates); | 1329 | source_len = intel_dp_source_rates(intel_dp, &source_rates); |
1327 | snprintf_int_array(str, sizeof(str), source_rates, source_len); | 1330 | snprintf_int_array(str, sizeof(str), source_rates, source_len); |
1328 | DRM_DEBUG_KMS("source rates: %s\n", str); | 1331 | DRM_DEBUG_KMS("source rates: %s\n", str); |
1329 | 1332 | ||
@@ -3711,7 +3714,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp) | |||
3711 | } | 3714 | } |
3712 | 3715 | ||
3713 | DRM_DEBUG_KMS("Display Port TPS3 support: source %s, sink %s\n", | 3716 | DRM_DEBUG_KMS("Display Port TPS3 support: source %s, sink %s\n", |
3714 | yesno(intel_dp_source_supports_hbr2(dev)), | 3717 | yesno(intel_dp_source_supports_hbr2(intel_dp)), |
3715 | yesno(drm_dp_tps3_supported(intel_dp->dpcd))); | 3718 | yesno(drm_dp_tps3_supported(intel_dp->dpcd))); |
3716 | 3719 | ||
3717 | /* Intermediate frequency support */ | 3720 | /* Intermediate frequency support */ |
diff --git a/drivers/gpu/drm/i915/intel_dp_link_training.c b/drivers/gpu/drm/i915/intel_dp_link_training.c index bb036d51f93f..88887938e0bf 100644 --- a/drivers/gpu/drm/i915/intel_dp_link_training.c +++ b/drivers/gpu/drm/i915/intel_dp_link_training.c | |||
@@ -218,8 +218,6 @@ intel_dp_link_training_clock_recovery(struct intel_dp *intel_dp) | |||
218 | static void | 218 | static void |
219 | intel_dp_link_training_channel_equalization(struct intel_dp *intel_dp) | 219 | intel_dp_link_training_channel_equalization(struct intel_dp *intel_dp) |
220 | { | 220 | { |
221 | struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); | ||
222 | struct drm_device *dev = dig_port->base.base.dev; | ||
223 | bool channel_eq = false; | 221 | bool channel_eq = false; |
224 | int tries, cr_tries; | 222 | int tries, cr_tries; |
225 | uint32_t training_pattern = DP_TRAINING_PATTERN_2; | 223 | uint32_t training_pattern = DP_TRAINING_PATTERN_2; |
@@ -233,7 +231,7 @@ intel_dp_link_training_channel_equalization(struct intel_dp *intel_dp) | |||
233 | * Due to WaDisableHBR2 SKL < B0 is the only exception where TPS3 is | 231 | * Due to WaDisableHBR2 SKL < B0 is the only exception where TPS3 is |
234 | * supported but still not enabled. | 232 | * supported but still not enabled. |
235 | */ | 233 | */ |
236 | if (intel_dp_source_supports_hbr2(dev) && | 234 | if (intel_dp_source_supports_hbr2(intel_dp) && |
237 | drm_dp_tps3_supported(intel_dp->dpcd)) | 235 | drm_dp_tps3_supported(intel_dp->dpcd)) |
238 | training_pattern = DP_TRAINING_PATTERN_3; | 236 | training_pattern = DP_TRAINING_PATTERN_3; |
239 | else if (intel_dp->link_rate == 540000) | 237 | else if (intel_dp->link_rate == 540000) |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 87c786e63c91..92518b49c68a 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -1267,7 +1267,7 @@ uint8_t | |||
1267 | intel_dp_pre_emphasis_max(struct intel_dp *intel_dp, uint8_t voltage_swing); | 1267 | intel_dp_pre_emphasis_max(struct intel_dp *intel_dp, uint8_t voltage_swing); |
1268 | void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock, | 1268 | void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock, |
1269 | uint8_t *link_bw, uint8_t *rate_select); | 1269 | uint8_t *link_bw, uint8_t *rate_select); |
1270 | bool intel_dp_source_supports_hbr2(struct drm_device *dev); | 1270 | bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp); |
1271 | bool | 1271 | bool |
1272 | intel_dp_get_link_status(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_STATUS_SIZE]); | 1272 | intel_dp_get_link_status(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_STATUS_SIZE]); |
1273 | 1273 | ||