msm_atomic_check() forces a modeset, and sets allow_modeset on behalf of userspace, whenever the CTM property of a CRTC is set or cleared. This was added so that DPU could reserve DSPP blocks for the CTM.
DPU is the only msm display driver that exposes color management, and dpu_crtc_check_mode_changed() now requires a modeset whenever the DSPP requirement changes, for both CTM and GAMMA_LUT. The generic check is therefore redundant. It also forces needless modesets when the CTM is toggled while a GAMMA_LUT keeps the DSPPs reserved, and it overrides the userspace decision about modesets. Remove it, as the FIXME suggested. Commits that toggle the CTM without DRM_MODE_ATOMIC_ALLOW_MODESET now fail with -EINVAL instead of silently becoming a modeset. Assisted-by: LLM Signed-off-by: Beat M. Liechti <[email protected]> --- drivers/gpu/drm/msm/msm_atomic.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c index a8babf1db..7b480981b 100644 --- a/drivers/gpu/drm/msm/msm_atomic.c +++ b/drivers/gpu/drm/msm/msm_atomic.c @@ -185,22 +185,7 @@ int msm_atomic_check(struct drm_device *dev, struct drm_atomic_commit *state) { struct msm_drm_private *priv = dev->dev_private; struct msm_kms *kms = priv->kms; - struct drm_crtc_state *old_crtc_state, *new_crtc_state; - struct drm_crtc *crtc; - int i, ret = 0; - - /* - * FIXME: stop setting allow_modeset and move this check to the DPU - * driver. - */ - 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)) { - new_crtc_state->mode_changed = true; - state->allow_modeset = true; - } - } + int ret = 0; if (kms && kms->funcs && kms->funcs->check_mode_changed) ret = kms->funcs->check_mode_changed(kms, state); -- 2.53.0
