Skip to content

Commit 07fb70d

Browse files
vsyrjalarodrigovivi
authored andcommitted
drm/i915: Make sure all planes in use by the joiner have their crtc included
Any active plane needs to have its crtc included in the atomic state. For planes enabled via uapi that is all handler in the core. But when we use a plane for joiner the uapi code things the plane is disabled and therefore doesn't have a crtc. So we need to pull those in by hand. We do it first thing in intel_joiner_add_affected_crtcs() so that any newly added crtc will subsequently pull in all of its joined crtcs as well. The symptoms from failing to do this are: - duct tape in the form of commit 1d5b09f ("drm/i915: Fix NULL ptr deref by checking new_crtc_state") - the plane's hw state will get overwritten by the disabled uapi state if it can't find the uapi counterpart plane in the atomic state from where it should copy the correct state Cc: stable@vger.kernel.org Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250212164330.16891-2-ville.syrjala@linux.intel.com (cherry picked from commit 91077d1) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent 166ce26 commit 07fb70d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6628,12 +6628,30 @@ static int intel_async_flip_check_hw(struct intel_atomic_state *state, struct in
66286628
static int intel_joiner_add_affected_crtcs(struct intel_atomic_state *state)
66296629
{
66306630
struct drm_i915_private *i915 = to_i915(state->base.dev);
6631+
const struct intel_plane_state *plane_state;
66316632
struct intel_crtc_state *crtc_state;
6633+
struct intel_plane *plane;
66326634
struct intel_crtc *crtc;
66336635
u8 affected_pipes = 0;
66346636
u8 modeset_pipes = 0;
66356637
int i;
66366638

6639+
/*
6640+
* Any plane which is in use by the joiner needs its crtc.
6641+
* Pull those in first as this will not have happened yet
6642+
* if the plane remains disabled according to uapi.
6643+
*/
6644+
for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
6645+
crtc = to_intel_crtc(plane_state->hw.crtc);
6646+
if (!crtc)
6647+
continue;
6648+
6649+
crtc_state = intel_atomic_get_crtc_state(&state->base, crtc);
6650+
if (IS_ERR(crtc_state))
6651+
return PTR_ERR(crtc_state);
6652+
}
6653+
6654+
/* Now pull in all joined crtcs */
66376655
for_each_new_intel_crtc_in_state(state, crtc, crtc_state, i) {
66386656
affected_pipes |= crtc_state->joiner_pipes;
66396657
if (intel_crtc_needs_modeset(crtc_state))

0 commit comments

Comments
 (0)