Skip to content

Commit 482bcc7

Browse files
vsyrjalajnikula
authored andcommitted
drm/i915/joiner: Make joiner "nomodeset" state copy independent of pipe order
Currently the joiner primary->secondary hw state copy still happens from the main compute_config loop alongside the primary uapi->hw state copy. The primary uapi->hw state copy must therefore happen first, or else we'll end up copying stale junk into the secondary. We have a WARN in intel_atomic_check_joiner() to make sure the CRTCs will be walked in the correct order. The plan is to reoder the CRTCs, which would mess up the order, unless we also adjust the iterators to keep the pipe order. The actual plan is to do both, so technically we should be able to just remove the WARN and call it a day. But relying on the iteration order like this is fragile and confusing, so let's move the "nomodeset" joiner state copy into the later loop where the "modeset" state copy is also done. The first loop having completely finished, we are guaranteed to have up to date hw state on the primary when we do the copy to the secondary. Cc: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Link: https://patch.msgid.link/20260408155744.13326-2-ville.syrjala@linux.intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
1 parent 4516432 commit 482bcc7

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5939,17 +5939,6 @@ static int intel_atomic_check_joiner(struct intel_atomic_state *state,
59395939
return -EINVAL;
59405940
}
59415941

5942-
/*
5943-
* The state copy logic assumes the primary crtc gets processed
5944-
* before the secondary crtc during the main compute_config loop.
5945-
* This works because the crtcs are created in pipe order,
5946-
* and the hardware requires primary pipe < secondary pipe as well.
5947-
* Should that change we need to rethink the logic.
5948-
*/
5949-
if (WARN_ON(drm_crtc_index(&primary_crtc->base) >
5950-
drm_crtc_index(&secondary_crtc->base)))
5951-
return -EINVAL;
5952-
59535942
drm_dbg_kms(display->drm,
59545943
"[CRTC:%d:%s] Used as secondary for joiner primary [CRTC:%d:%s]\n",
59555944
secondary_crtc->base.base.id, secondary_crtc->base.name,
@@ -6327,9 +6316,7 @@ static int intel_atomic_check_config(struct intel_atomic_state *state,
63276316

63286317
for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
63296318
if (!intel_crtc_needs_modeset(new_crtc_state)) {
6330-
if (intel_crtc_is_joiner_secondary(new_crtc_state))
6331-
copy_joiner_crtc_state_nomodeset(state, crtc);
6332-
else
6319+
if (!intel_crtc_is_joiner_secondary(new_crtc_state))
63336320
intel_crtc_copy_uapi_to_hw_state_nomodeset(state, crtc);
63346321
continue;
63356322
}
@@ -6460,8 +6447,11 @@ int intel_atomic_check(struct drm_device *dev,
64606447
goto fail;
64616448

64626449
for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
6463-
if (!intel_crtc_needs_modeset(new_crtc_state))
6450+
if (!intel_crtc_needs_modeset(new_crtc_state)) {
6451+
if (intel_crtc_is_joiner_secondary(new_crtc_state))
6452+
copy_joiner_crtc_state_nomodeset(state, crtc);
64646453
continue;
6454+
}
64656455

64666456
if (intel_crtc_is_joiner_secondary(new_crtc_state)) {
64676457
drm_WARN_ON(display->drm, new_crtc_state->uapi.enable);

0 commit comments

Comments
 (0)