Commit 00565028 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Call kill_bigjoiner_slave() earlier

Let's do the kill_bigjoiner_slave() thing from
intel_bigjoiner_add_affected_crtcs() since it's related to
what we do there. This cleans up the logic in the
compute_config() loop a bit.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201124201156.17095-4-ville.syrjala@linux.intel.comReviewed-by: default avatarManasi Navare <manasi.d.navare@intel.com>
parent 72305a80
...@@ -15335,21 +15335,16 @@ static int intel_atomic_check_bigjoiner(struct intel_atomic_state *state, ...@@ -15335,21 +15335,16 @@ static int intel_atomic_check_bigjoiner(struct intel_atomic_state *state,
return -EINVAL; return -EINVAL;
} }
static int kill_bigjoiner_slave(struct intel_atomic_state *state, static void kill_bigjoiner_slave(struct intel_atomic_state *state,
struct intel_crtc_state *master_crtc_state) struct intel_crtc_state *master_crtc_state)
{ {
struct intel_crtc_state *slave_crtc_state = struct intel_crtc_state *slave_crtc_state =
intel_atomic_get_crtc_state(&state->base, intel_atomic_get_new_crtc_state(state, master_crtc_state->bigjoiner_linked_crtc);
master_crtc_state->bigjoiner_linked_crtc);
if (IS_ERR(slave_crtc_state))
return PTR_ERR(slave_crtc_state);
slave_crtc_state->bigjoiner = master_crtc_state->bigjoiner = false; slave_crtc_state->bigjoiner = master_crtc_state->bigjoiner = false;
slave_crtc_state->bigjoiner_slave = master_crtc_state->bigjoiner_slave = false; slave_crtc_state->bigjoiner_slave = master_crtc_state->bigjoiner_slave = false;
slave_crtc_state->bigjoiner_linked_crtc = master_crtc_state->bigjoiner_linked_crtc = NULL; slave_crtc_state->bigjoiner_linked_crtc = master_crtc_state->bigjoiner_linked_crtc = NULL;
intel_crtc_copy_uapi_to_hw_state(state, slave_crtc_state); intel_crtc_copy_uapi_to_hw_state(state, slave_crtc_state);
return 0;
} }
/** /**
...@@ -15519,6 +15514,13 @@ static int intel_bigjoiner_add_affected_crtcs(struct intel_atomic_state *state) ...@@ -15519,6 +15514,13 @@ static int intel_bigjoiner_add_affected_crtcs(struct intel_atomic_state *state)
return ret; return ret;
} }
for_each_new_intel_crtc_in_state(state, crtc, crtc_state, i) {
/* Kill old bigjoiner link, we may re-establish afterwards */
if (needs_modeset(crtc_state) &&
crtc_state->bigjoiner && !crtc_state->bigjoiner_slave)
kill_bigjoiner_slave(state, crtc_state);
}
return 0; return 0;
} }
...@@ -15560,13 +15562,6 @@ static int intel_atomic_check(struct drm_device *dev, ...@@ -15560,13 +15562,6 @@ static int intel_atomic_check(struct drm_device *dev,
continue; continue;
} }
/* Kill old bigjoiner link, we may re-establish afterwards */
if (old_crtc_state->bigjoiner && !old_crtc_state->bigjoiner_slave) {
ret = kill_bigjoiner_slave(state, new_crtc_state);
if (ret)
goto fail;
}
if (!new_crtc_state->uapi.enable) { if (!new_crtc_state->uapi.enable) {
if (!new_crtc_state->bigjoiner_slave) { if (!new_crtc_state->bigjoiner_slave) {
intel_crtc_copy_uapi_to_hw_state(state, new_crtc_state); intel_crtc_copy_uapi_to_hw_state(state, new_crtc_state);
......
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