diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-09-30 02:34:49 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-10-01 16:45:57 +0300 |
commit | ef79fafe9dae31037c48bd11676746315725452d (patch) | |
tree | 7b79046bf2530de78405e50ec6da0abfce3b08e2 /drivers/gpu/drm/i915/display/intel_dp_mst.c | |
parent | a621860a5eb82a1b63378aac58c67fd612824013 (diff) | |
download | linux-ef79fafe9dae31037c48bd11676746315725452d.tar.xz |
drm/i915: Eliminate intel_dp.regs.dp_tp_{ctl,status}
Now that we've plumbed the crtc state all the way down we can
eliminate the DP_TP_{CTL,STATUS} register offsets from intel_dp,
and instead we derive them directly from the crtc state.
And thus we can get rid of the nasty hack in intel_ddi_get_config()
which mutates intel_dp during the readout.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200929233449.32323-12-ville.syrjala@linux.intel.com
Reviewed-by: Imre Deak <imre.deak@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_dp_mst.c')
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_dp_mst.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index 6a874b779b1f..82f38c386dbd 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -318,19 +318,23 @@ intel_dp_mst_atomic_check(struct drm_connector *connector, return ret; } -static void clear_act_sent(struct intel_dp *intel_dp) +static void clear_act_sent(struct intel_encoder *encoder, + const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = dp_to_i915(intel_dp); + struct drm_i915_private *i915 = to_i915(encoder->base.dev); - intel_de_write(i915, intel_dp->regs.dp_tp_status, + intel_de_write(i915, dp_tp_status_reg(encoder, crtc_state), DP_TP_STATUS_ACT_SENT); } -static void wait_for_act_sent(struct intel_dp *intel_dp) +static void wait_for_act_sent(struct intel_encoder *encoder, + const struct intel_crtc_state *crtc_state) { - struct drm_i915_private *i915 = dp_to_i915(intel_dp); + struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder); + struct intel_dp *intel_dp = &intel_mst->primary->dp; - if (intel_de_wait_for_set(i915, intel_dp->regs.dp_tp_status, + if (intel_de_wait_for_set(i915, dp_tp_status_reg(encoder, crtc_state), DP_TP_STATUS_ACT_SENT, 1)) drm_err(&i915->drm, "Timed out waiting for ACT sent\n"); @@ -392,7 +396,7 @@ static void intel_mst_post_disable_dp(struct intel_atomic_state *state, drm_dp_update_payload_part2(&intel_dp->mst_mgr); - clear_act_sent(intel_dp); + clear_act_sent(encoder, old_crtc_state); val = intel_de_read(dev_priv, TRANS_DDI_FUNC_CTL(old_crtc_state->cpu_transcoder)); @@ -401,7 +405,7 @@ static void intel_mst_post_disable_dp(struct intel_atomic_state *state, TRANS_DDI_FUNC_CTL(old_crtc_state->cpu_transcoder), val); - wait_for_act_sent(intel_dp); + wait_for_act_sent(encoder, old_crtc_state); drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, connector->port); @@ -535,7 +539,7 @@ static void intel_mst_enable_dp(struct intel_atomic_state *state, drm_WARN_ON(&dev_priv->drm, pipe_config->has_pch_encoder); - clear_act_sent(intel_dp); + clear_act_sent(encoder, pipe_config); intel_ddi_enable_transcoder_func(encoder, pipe_config); @@ -549,7 +553,7 @@ 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); - wait_for_act_sent(intel_dp); + wait_for_act_sent(encoder, pipe_config); drm_dp_update_payload_part2(&intel_dp->mst_mgr); |