diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2014-03-21 10:34:08 -0400 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2014-03-25 08:13:23 -0400 |
commit | ab8f1a2a0a7a9882e1214e4f5107e2a02705d11e (patch) | |
tree | 2fdb8a135b9dfc4f916f6e7531b441ea2b65d5c4 /drivers/gpu/drm/radeon/atombios_dp.c | |
parent | 496263bf2bee13387f6e2a780f0c783c9c377c42 (diff) |
drm/radeon: use drm_dp_dpcd_read_link_status()
Replace the radeon specific version with the generic version.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/atombios_dp.c')
-rw-r--r-- | drivers/gpu/drm/radeon/atombios_dp.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c index 8d8f84676544..8b0ab170cef9 100644 --- a/drivers/gpu/drm/radeon/atombios_dp.c +++ b/drivers/gpu/drm/radeon/atombios_dp.c | |||
@@ -549,32 +549,12 @@ int radeon_dp_mode_valid_helper(struct drm_connector *connector, | |||
549 | return MODE_OK; | 549 | return MODE_OK; |
550 | } | 550 | } |
551 | 551 | ||
552 | static bool radeon_dp_get_link_status(struct radeon_connector *radeon_connector, | ||
553 | u8 link_status[DP_LINK_STATUS_SIZE]) | ||
554 | { | ||
555 | struct radeon_connector_atom_dig *dig_connector; | ||
556 | int ret; | ||
557 | |||
558 | if (!radeon_connector->con_priv) | ||
559 | return false; | ||
560 | dig_connector = radeon_connector->con_priv; | ||
561 | |||
562 | ret = drm_dp_dpcd_read(&dig_connector->dp_i2c_bus->aux, DP_LANE0_1_STATUS, | ||
563 | link_status, DP_LINK_STATUS_SIZE); | ||
564 | if (ret <= 0) { | ||
565 | return false; | ||
566 | } | ||
567 | |||
568 | DRM_DEBUG_KMS("link status %6ph\n", link_status); | ||
569 | return true; | ||
570 | } | ||
571 | |||
572 | bool radeon_dp_needs_link_train(struct radeon_connector *radeon_connector) | 552 | bool radeon_dp_needs_link_train(struct radeon_connector *radeon_connector) |
573 | { | 553 | { |
574 | u8 link_status[DP_LINK_STATUS_SIZE]; | 554 | u8 link_status[DP_LINK_STATUS_SIZE]; |
575 | struct radeon_connector_atom_dig *dig = radeon_connector->con_priv; | 555 | struct radeon_connector_atom_dig *dig = radeon_connector->con_priv; |
576 | 556 | ||
577 | if (!radeon_dp_get_link_status(radeon_connector, link_status)) | 557 | if (drm_dp_dpcd_read_link_status(&dig->dp_i2c_bus->aux, link_status) <= 0) |
578 | return false; | 558 | return false; |
579 | if (drm_dp_channel_eq_ok(link_status, dig->dp_lane_count)) | 559 | if (drm_dp_channel_eq_ok(link_status, dig->dp_lane_count)) |
580 | return false; | 560 | return false; |
@@ -605,7 +585,6 @@ struct radeon_dp_link_train_info { | |||
605 | struct radeon_device *rdev; | 585 | struct radeon_device *rdev; |
606 | struct drm_encoder *encoder; | 586 | struct drm_encoder *encoder; |
607 | struct drm_connector *connector; | 587 | struct drm_connector *connector; |
608 | struct radeon_connector *radeon_connector; | ||
609 | int enc_id; | 588 | int enc_id; |
610 | int dp_clock; | 589 | int dp_clock; |
611 | int dp_lane_count; | 590 | int dp_lane_count; |
@@ -752,7 +731,8 @@ static int radeon_dp_link_train_cr(struct radeon_dp_link_train_info *dp_info) | |||
752 | while (1) { | 731 | while (1) { |
753 | drm_dp_link_train_clock_recovery_delay(dp_info->dpcd); | 732 | drm_dp_link_train_clock_recovery_delay(dp_info->dpcd); |
754 | 733 | ||
755 | if (!radeon_dp_get_link_status(dp_info->radeon_connector, dp_info->link_status)) { | 734 | if (drm_dp_dpcd_read_link_status(dp_info->aux, |
735 | dp_info->link_status) <= 0) { | ||
756 | DRM_ERROR("displayport link status failed\n"); | 736 | DRM_ERROR("displayport link status failed\n"); |
757 | break; | 737 | break; |
758 | } | 738 | } |
@@ -814,7 +794,8 @@ static int radeon_dp_link_train_ce(struct radeon_dp_link_train_info *dp_info) | |||
814 | while (1) { | 794 | while (1) { |
815 | drm_dp_link_train_channel_eq_delay(dp_info->dpcd); | 795 | drm_dp_link_train_channel_eq_delay(dp_info->dpcd); |
816 | 796 | ||
817 | if (!radeon_dp_get_link_status(dp_info->radeon_connector, dp_info->link_status)) { | 797 | if (drm_dp_dpcd_read_link_status(dp_info->aux, |
798 | dp_info->link_status) <= 0) { | ||
818 | DRM_ERROR("displayport link status failed\n"); | 799 | DRM_ERROR("displayport link status failed\n"); |
819 | break; | 800 | break; |
820 | } | 801 | } |
@@ -907,7 +888,6 @@ void radeon_dp_link_train(struct drm_encoder *encoder, | |||
907 | dp_info.rdev = rdev; | 888 | dp_info.rdev = rdev; |
908 | dp_info.encoder = encoder; | 889 | dp_info.encoder = encoder; |
909 | dp_info.connector = connector; | 890 | dp_info.connector = connector; |
910 | dp_info.radeon_connector = radeon_connector; | ||
911 | dp_info.dp_lane_count = dig_connector->dp_lane_count; | 891 | dp_info.dp_lane_count = dig_connector->dp_lane_count; |
912 | dp_info.dp_clock = dig_connector->dp_clock; | 892 | dp_info.dp_clock = dig_connector->dp_clock; |
913 | dp_info.aux = &dig_connector->dp_i2c_bus->aux; | 893 | dp_info.aux = &dig_connector->dp_i2c_bus->aux; |