Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Ville Syrjälä and committed by
Jani Nikula
482bcc7e 45164322

+5 -15
+5 -15
drivers/gpu/drm/i915/display/intel_display.c
··· 5939 5939 return -EINVAL; 5940 5940 } 5941 5941 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 - 5953 5942 drm_dbg_kms(display->drm, 5954 5943 "[CRTC:%d:%s] Used as secondary for joiner primary [CRTC:%d:%s]\n", 5955 5944 secondary_crtc->base.base.id, secondary_crtc->base.name, ··· 6316 6327 6317 6328 for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) { 6318 6329 if (!intel_crtc_needs_modeset(new_crtc_state)) { 6319 - if (intel_crtc_is_joiner_secondary(new_crtc_state)) 6320 - copy_joiner_crtc_state_nomodeset(state, crtc); 6321 - else 6330 + if (!intel_crtc_is_joiner_secondary(new_crtc_state)) 6322 6331 intel_crtc_copy_uapi_to_hw_state_nomodeset(state, crtc); 6323 6332 continue; 6324 6333 } ··· 6447 6460 goto fail; 6448 6461 6449 6462 for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) { 6450 - if (!intel_crtc_needs_modeset(new_crtc_state)) 6463 + if (!intel_crtc_needs_modeset(new_crtc_state)) { 6464 + if (intel_crtc_is_joiner_secondary(new_crtc_state)) 6465 + copy_joiner_crtc_state_nomodeset(state, crtc); 6451 6466 continue; 6467 + } 6452 6468 6453 6469 if (intel_crtc_is_joiner_secondary(new_crtc_state)) { 6454 6470 drm_WARN_ON(display->drm, new_crtc_state->uapi.enable);