Commit ec92c47d authored by Imre Deak's avatar Imre Deak

drm/i915/dp: Require a valid atomic state for SST link training

After the previous patch link training happens always with a valid
atomic state, so remove the NOTE comments and asserts which required a
valid state only for DP-MST and allowed for a NULL state for DP-SST.
Reviewed-by: default avatarSuraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240712135724.660399-2-imre.deak@intel.com
parent 2885d283
...@@ -2866,7 +2866,6 @@ static void intel_dp_queue_modeset_retry_work(struct intel_connector *connector) ...@@ -2866,7 +2866,6 @@ static void intel_dp_queue_modeset_retry_work(struct intel_connector *connector)
drm_connector_put(&connector->base); drm_connector_put(&connector->base);
} }
/* NOTE: @state is only valid for MST links and can be %NULL for SST. */
void void
intel_dp_queue_modeset_retry_for_link(struct intel_atomic_state *state, intel_dp_queue_modeset_retry_for_link(struct intel_atomic_state *state,
struct intel_encoder *encoder, struct intel_encoder *encoder,
...@@ -2875,7 +2874,6 @@ intel_dp_queue_modeset_retry_for_link(struct intel_atomic_state *state, ...@@ -2875,7 +2874,6 @@ intel_dp_queue_modeset_retry_for_link(struct intel_atomic_state *state,
struct intel_connector *connector; struct intel_connector *connector;
struct intel_digital_connector_state *conn_state; struct intel_digital_connector_state *conn_state;
struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
int i; int i;
if (!intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST)) { if (!intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST)) {
...@@ -2884,9 +2882,6 @@ intel_dp_queue_modeset_retry_for_link(struct intel_atomic_state *state, ...@@ -2884,9 +2882,6 @@ intel_dp_queue_modeset_retry_for_link(struct intel_atomic_state *state,
return; return;
} }
if (drm_WARN_ON(&i915->drm, !state))
return;
for_each_new_intel_connector_in_state(state, connector, conn_state, i) { for_each_new_intel_connector_in_state(state, connector, conn_state, i) {
if (!conn_state->base.crtc) if (!conn_state->base.crtc)
continue; continue;
......
...@@ -1234,12 +1234,10 @@ static int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp, ...@@ -1234,12 +1234,10 @@ static int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
return 0; return 0;
} }
/* NOTE: @state is only valid for MST links and can be %NULL for SST. */
static bool intel_dp_schedule_fallback_link_training(struct intel_atomic_state *state, static bool intel_dp_schedule_fallback_link_training(struct intel_atomic_state *state,
struct intel_dp *intel_dp, struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state) const struct intel_crtc_state *crtc_state)
{ {
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base; struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
if (!intel_digital_port_connected(&dp_to_dig_port(intel_dp)->base)) { if (!intel_digital_port_connected(&dp_to_dig_port(intel_dp)->base)) {
...@@ -1255,11 +1253,6 @@ static bool intel_dp_schedule_fallback_link_training(struct intel_atomic_state * ...@@ -1255,11 +1253,6 @@ static bool intel_dp_schedule_fallback_link_training(struct intel_atomic_state *
return false; return false;
} }
if (drm_WARN_ON(&i915->drm,
intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST) &&
!state))
return false;
/* Schedule a Hotplug Uevent to userspace to start modeset */ /* Schedule a Hotplug Uevent to userspace to start modeset */
intel_dp_queue_modeset_retry_for_link(state, encoder, crtc_state); intel_dp_queue_modeset_retry_for_link(state, encoder, crtc_state);
...@@ -1518,8 +1511,6 @@ intel_dp_128b132b_link_train(struct intel_dp *intel_dp, ...@@ -1518,8 +1511,6 @@ intel_dp_128b132b_link_train(struct intel_dp *intel_dp,
* retraining with reduced link rate/lane parameters if the link training * retraining with reduced link rate/lane parameters if the link training
* fails. * fails.
* After calling this function intel_dp_stop_link_train() must be called. * After calling this function intel_dp_stop_link_train() must be called.
*
* NOTE: @state is only valid for MST links and can be %NULL for SST.
*/ */
void intel_dp_start_link_train(struct intel_atomic_state *state, void intel_dp_start_link_train(struct intel_atomic_state *state,
struct intel_dp *intel_dp, struct intel_dp *intel_dp,
...@@ -1536,11 +1527,6 @@ void intel_dp_start_link_train(struct intel_atomic_state *state, ...@@ -1536,11 +1527,6 @@ void intel_dp_start_link_train(struct intel_atomic_state *state,
*/ */
int lttpr_count = intel_dp_init_lttpr_and_dprx_caps(intel_dp); int lttpr_count = intel_dp_init_lttpr_and_dprx_caps(intel_dp);
if (drm_WARN_ON(&i915->drm,
intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST) &&
!state))
return;
if (lttpr_count < 0) if (lttpr_count < 0)
/* Still continue with enabling the port and link training. */ /* Still continue with enabling the port and link training. */
lttpr_count = 0; lttpr_count = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment