[Intel-gfx] [PATCH] drm/i915/display: Read DP link status with DRM helper function
Mika Kahola
mika.kahola at intel.com
Fri Dec 13 11:27:48 UTC 2019
The patch proposes that we read DP link status with DRM helper function
instead of intel specific one. Functionally there are no changes.
Signed-off-by: Mika Kahola <mika.kahola at intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 13 +------------
drivers/gpu/drm/i915/display/intel_dp.h | 2 --
.../gpu/drm/i915/display/intel_dp_link_training.c | 6 ++++--
3 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 2f31d226c6eb..c01d790208d1 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3767,17 +3767,6 @@ static void chv_dp_post_pll_disable(struct intel_encoder *encoder,
chv_phy_post_pll_disable(encoder, old_crtc_state);
}
-/*
- * Fetch AUX CH registers 0x202 - 0x207 which contain
- * link status information
- */
-bool
-intel_dp_get_link_status(struct intel_dp *intel_dp, u8 link_status[DP_LINK_STATUS_SIZE])
-{
- return drm_dp_dpcd_read(&intel_dp->aux, DP_LANE0_1_STATUS, link_status,
- DP_LINK_STATUS_SIZE) == DP_LINK_STATUS_SIZE;
-}
-
/* These are source-specific values. */
u8
intel_dp_voltage_max(struct intel_dp *intel_dp)
@@ -5077,7 +5066,7 @@ intel_dp_needs_link_retrain(struct intel_dp *intel_dp)
if (intel_psr_enabled(intel_dp))
return false;
- if (!intel_dp_get_link_status(intel_dp, link_status))
+ if (drm_dp_dpcd_read_link_status(&intel_dp->aux, link_status) <= 0)
return false;
/*
diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
index 3da166054788..7595326798d2 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.h
+++ b/drivers/gpu/drm/i915/display/intel_dp.h
@@ -101,8 +101,6 @@ void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,
u8 *link_bw, u8 *rate_select);
bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);
bool intel_dp_source_supports_hbr3(struct intel_dp *intel_dp);
-bool
-intel_dp_get_link_status(struct intel_dp *intel_dp, u8 *link_status);
bool intel_dp_read_dpcd(struct intel_dp *intel_dp);
bool intel_dp_get_colorimetry_status(struct intel_dp *intel_dp);
diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
index 2a1130dd1ad0..edffdb88ab4e 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
@@ -192,7 +192,8 @@ intel_dp_link_training_clock_recovery(struct intel_dp *intel_dp)
drm_dp_link_train_clock_recovery_delay(intel_dp->dpcd);
- if (!intel_dp_get_link_status(intel_dp, link_status)) {
+ if (drm_dp_dpcd_read_link_status(&intel_dp->aux,
+ link_status) <= 0) {
DRM_ERROR("failed to get link status\n");
return false;
}
@@ -302,7 +303,8 @@ intel_dp_link_training_channel_equalization(struct intel_dp *intel_dp)
for (tries = 0; tries < 5; tries++) {
drm_dp_link_train_channel_eq_delay(intel_dp->dpcd);
- if (!intel_dp_get_link_status(intel_dp, link_status)) {
+ if (drm_dp_dpcd_read_link_status(&intel_dp->aux,
+ link_status) <= 0) {
DRM_ERROR("failed to get link status\n");
break;
}
--
2.17.1
More information about the Intel-gfx
mailing list