Skip to content

Commit 5ec1ceb

Browse files
author
Manasi Navare
committed
drm/atomic: Add the crtc to affected crtc only if uapi.enable = true
In case of a modeset where a mode gets split across multiple CRTCs in the driver specific implementation (bigjoiner in i915) we wrongly count the affected CRTCs based on the drm_crtc_mask and indicate the stolen CRTC as an affected CRTC in atomic_check_only(). This triggers a warning since affected CRTCs doent match requested CRTC. To fix this in such bigjoiner configurations, we should only increment affected crtcs if that CRTC is enabled in UAPI not if it is just used internally in the driver to split the mode. v3: Add the same uapi crtc_state->enable check in requested crtc calc (Ville) Cc: Ville Syrjälä <[email protected]> Cc: Simon Ser <[email protected]> Cc: Pekka Paalanen <[email protected]> Cc: Daniel Stone <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: [email protected] Cc: <[email protected]> # v5.11+ Fixes: 919c229 ("drm/i915: Enable bigjoiner") Signed-off-by: Manasi Navare <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 016017a commit 5ec1ceb

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/gpu/drm/drm_atomic.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,8 +1310,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state)
13101310

13111311
DRM_DEBUG_ATOMIC("checking %p\n", state);
13121312

1313-
for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
1314-
requested_crtc |= drm_crtc_mask(crtc);
1313+
for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
1314+
if (new_crtc_state->enable)
1315+
requested_crtc |= drm_crtc_mask(crtc);
1316+
}
13151317

13161318
for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
13171319
ret = drm_atomic_plane_check(old_plane_state, new_plane_state);
@@ -1360,8 +1362,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state)
13601362
}
13611363
}
13621364

1363-
for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
1364-
affected_crtc |= drm_crtc_mask(crtc);
1365+
for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
1366+
if (new_crtc_state->enable)
1367+
affected_crtc |= drm_crtc_mask(crtc);
1368+
}
13651369

13661370
/*
13671371
* For commits that allow modesets drivers can add other CRTCs to the

0 commit comments

Comments
 (0)