From cdc962d109c3574fe1b85fda13b72614b83ff92e Mon Sep 17 00:00:00 2001 From: Jayaprakash Madisetty Date: Tue, 31 Oct 2023 15:13:29 +0530 Subject: [PATCH] disp: msm: update seamless check for cwb + any modeset When there is CWB enablement + dynamic clock change request in single commit, during modeset enables the cwb seamless check is hit for primary connector causing bridge pre enable and enable calls skipped for dsi connector. This change ensures the above seamless transition is taken care with any modeset case as well. Change-Id: I8d7ef4f8c579d44ddb0bfd5dc584fe5c778df886 Signed-off-by: Jayaprakash Madisetty --- msm/msm_atomic.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/msm/msm_atomic.c b/msm/msm_atomic.c index 441f7d8c..362cd417 100644 --- a/msm/msm_atomic.c +++ b/msm/msm_atomic.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. * Copyright (C) 2014 Red Hat * Author: Rob Clark @@ -114,11 +114,23 @@ static inline bool _msm_seamless_for_conn(struct drm_connector *connector, if (!old_conn_state || !old_conn_state->crtc) return false; + if (!priv || !priv->kms || !priv->kms->funcs->get_msm_mode) + return false; + + msm_mode = priv->kms->funcs->get_msm_mode( + _msm_get_conn_state(old_conn_state->crtc->state)); + if (!msm_mode) + return false; + if (!old_conn_state->crtc->state->mode_changed && !old_conn_state->crtc->state->active_changed && old_conn_state->crtc->state->connectors_changed) { - if (old_conn_state->crtc == connector->state->crtc) + if (old_conn_state->crtc == connector->state->crtc) { + if (enable && msm_is_private_mode_changed( + _msm_get_conn_state(old_conn_state->crtc->state))) + return false; return true; + } } if (enable) @@ -128,14 +140,6 @@ static inline bool _msm_seamless_for_conn(struct drm_connector *connector, old_conn_state->crtc->state->connectors_changed) return false; - if (!priv || !priv->kms || !priv->kms->funcs->get_msm_mode) - return false; - - msm_mode = priv->kms->funcs->get_msm_mode( - _msm_get_conn_state(old_conn_state->crtc->state)); - if (!msm_mode) - return false; - if (msm_is_mode_seamless(msm_mode) || msm_is_mode_seamless_vrr(msm_mode) || msm_is_mode_seamless_dyn_clk(msm_mode) || @@ -326,7 +330,7 @@ msm_crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *old_state) if (!new_crtc_state->mode_changed && new_crtc_state->connectors_changed) { if (_msm_seamless_for_conn(connector, - old_conn_state, false)) + old_conn_state, true)) continue; } else if (!new_crtc_state->mode_changed) { if (!msm_is_private_mode_changed(