drm/i915/ddi: pass encoder to intel_wait_ddi_buf_active()
authorJani Nikula <jani.nikula@intel.com>
Wed, 20 Mar 2024 15:47:59 +0000 (17:47 +0200)
committerJani Nikula <jani.nikula@intel.com>
Thu, 21 Mar 2024 12:10:08 +0000 (14:10 +0200)
Pass encoder to intel_wait_ddi_buf_active(). The encoder will be more
helpful than just port in the subsequent changes.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/6a299c4c575a260c0ba88b2e99931d48945269be.1710949619.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_ddi.c

index a755b1f13d51cae6d3510704ebc5619d5d576253..82132fa1bb2cb21685deccb230a5005576c9b0b4 100644 (file)
@@ -200,9 +200,10 @@ void intel_wait_ddi_buf_idle(struct drm_i915_private *dev_priv,
                        port_name(port));
 }
 
-static void intel_wait_ddi_buf_active(struct drm_i915_private *dev_priv,
-                                     enum port port)
+static void intel_wait_ddi_buf_active(struct intel_encoder *encoder)
 {
+       struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
+       enum port port = encoder->port;
        enum phy phy = intel_port_to_phy(dev_priv, port);
        int timeout_us;
        int ret;
@@ -3354,7 +3355,7 @@ static void intel_enable_ddi_hdmi(struct intel_atomic_state *state,
 
        intel_de_write(dev_priv, DDI_BUF_CTL(port), buf_ctl);
 
-       intel_wait_ddi_buf_active(dev_priv, port);
+       intel_wait_ddi_buf_active(encoder);
 }
 
 static void intel_enable_ddi(struct intel_atomic_state *state,
@@ -3574,7 +3575,7 @@ static void mtl_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
        intel_de_posting_read(dev_priv, DDI_BUF_CTL(port));
 
        /* 6.j Poll for PORT_BUF_CTL Idle Status == 0, timeout after 100 us */
-       intel_wait_ddi_buf_active(dev_priv, port);
+       intel_wait_ddi_buf_active(encoder);
 }
 
 static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
@@ -3624,7 +3625,7 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp,
        intel_de_write(dev_priv, DDI_BUF_CTL(port), intel_dp->DP);
        intel_de_posting_read(dev_priv, DDI_BUF_CTL(port));
 
-       intel_wait_ddi_buf_active(dev_priv, port);
+       intel_wait_ddi_buf_active(encoder);
 }
 
 static void intel_ddi_set_link_train(struct intel_dp *intel_dp,