[PATCH 3/4] drm/i915/dp_mst: Only clear the ACT sent status flags from DP_TP_STATUS
Imre Deak
imre.deak at intel.com
Thu Jun 11 22:32:24 UTC 2020
We're only interested in the ACT sent status flag when waiting for it,
so there is no need to clear the rest of status flags in DP_TP_STATUS.
BSpec doesn't specify it whether clearing these other flags would have
any side-effect.
Signed-off-by: Imre Deak <imre.deak at intel.com>
---
drivers/gpu/drm/i915/display/intel_dp_mst.c | 27 +++++++++++++++------
1 file changed, 19 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index 2e6c6375a23b..247538f03724 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -317,6 +317,20 @@ intel_dp_mst_atomic_check(struct drm_connector *connector,
return ret;
}
+static void clear_act_sent(struct intel_dp *intel_dp)
+{
+ intel_de_write(dp_to_i915(intel_dp),
+ intel_dp->regs.dp_tp_status,
+ DP_TP_STATUS_ACT_SENT);
+}
+
+static bool wait_for_act_sent(struct intel_dp *intel_dp)
+{
+ return intel_de_wait_for_set(dp_to_i915(intel_dp),
+ intel_dp->regs.dp_tp_status,
+ DP_TP_STATUS_ACT_SENT, 1) == 0;
+}
+
static void intel_mst_disable_dp(struct intel_atomic_state *state,
struct intel_encoder *encoder,
const struct intel_crtc_state *old_crtc_state,
@@ -377,8 +391,7 @@ static void intel_mst_post_disable_dp(struct intel_atomic_state *state,
TRANS_DDI_FUNC_CTL(old_crtc_state->cpu_transcoder),
val);
- if (intel_de_wait_for_set(dev_priv, intel_dp->regs.dp_tp_status,
- DP_TP_STATUS_ACT_SENT, 1))
+ if (!wait_for_act_sent(intel_dp))
drm_err(&dev_priv->drm,
"Timed out waiting for ACT sent when disabling\n");
drm_dp_check_act_status(&intel_dp->mst_mgr);
@@ -452,7 +465,6 @@ static void intel_mst_pre_enable_dp(struct intel_atomic_state *state,
struct intel_connector *connector =
to_intel_connector(conn_state->connector);
int ret;
- u32 temp;
bool first_mst_stream;
/* MST encoders are bound to a crtc, not to a connector,
@@ -485,8 +497,8 @@ static void intel_mst_pre_enable_dp(struct intel_atomic_state *state,
drm_err(&dev_priv->drm, "failed to allocate vcpi\n");
intel_dp->active_mst_links++;
- temp = intel_de_read(dev_priv, intel_dp->regs.dp_tp_status);
- intel_de_write(dev_priv, intel_dp->regs.dp_tp_status, temp);
+
+ clear_act_sent(intel_dp);
ret = drm_dp_update_payload_part1(&intel_dp->mst_mgr);
@@ -522,9 +534,8 @@ static void intel_mst_enable_dp(struct intel_atomic_state *state,
drm_dbg_kms(&dev_priv->drm, "active links %d\n",
intel_dp->active_mst_links);
- if (intel_de_wait_for_set(dev_priv, intel_dp->regs.dp_tp_status,
- DP_TP_STATUS_ACT_SENT, 1))
- drm_err(&dev_priv->drm, "Timed out waiting for ACT sent\n");
+ if (!wait_for_act_sent(intel_dp))
+ drm_err(&dev_priv->drm, "Timed out waiting for ACT sent when enabling\n");
drm_dp_check_act_status(&intel_dp->mst_mgr);
--
2.23.1
More information about the Intel-gfx-trybot
mailing list