Re: [PATCH v2 5/6] drm/msm: force mode_changed on color_mgmt_changed, not just ctm

From: Val Packett

Date: Mon Oct 26 2026 - 19:15:25 EST



On 10/26/26 5:25 PM, Xi Zhang wrote:
dpu_crtc_atomic_check calls dpu_crtc_assign_resources when
color_mgmt_changed is set, which is unsafe outside of full modeset.

Set allow_modeset and mode_changed when color_mgmt_changed is set,
not just when ctm is changed.

Also would fix
commit 42f62cd79578 ("drm/msm/dpu: try reserving the DSPP-less LM first")
which was reverted.

Closes: https://gitlab.freedesktop.org/drm/msm/-/work_items/102

Signed-off-by: Xi Zhang <xz.ca.cn@xxxxxxxxx>
---
drivers/gpu/drm/msm/msm_atomic.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c
index a8babf1dbe0d..6f0f30b0728a 100644
--- a/drivers/gpu/drm/msm/msm_atomic.c
+++ b/drivers/gpu/drm/msm/msm_atomic.c
@@ -195,8 +195,7 @@ int msm_atomic_check(struct drm_device *dev, struct drm_atomic_commit *state)
*/
for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state,
new_crtc_state, i) {
- if ((old_crtc_state->ctm && !new_crtc_state->ctm) ||
- (!old_crtc_state->ctm && new_crtc_state->ctm)) {
+ if (new_crtc_state->color_mgmt_changed) {
new_crtc_state->mode_changed = true;
state->allow_modeset = true;
}

This is also handled by patch 9 "drm/msm/dpu: only reassign resources when the encoder is reprogrammed" of the smmu fault series:

https://lore.kernel.org/all/20261024-fd-kms-fix-smmu-v5-9-a5b0b284aead@xxxxxxxxxxxxxxxx/


Thanks,
~val