From eaa0b9cc158ddf6f0c4c5cca820dec9ee6474a29 Mon Sep 17 00:00:00 2001 From: Krishna Manikandan Date: Thu, 2 Apr 2020 12:43:57 +0530 Subject: [PATCH] disp: msm: dsi: avoid seamless request for cwb transitions There are some scenarios where a dfps request during cwb session will result in cwb encoder not getting disabled once the cwb session is over. Add support to fail the commit if any VRR or dynamic clock change request is received during CWB transitions to handle this. Change-Id: Id3f192f79eac4ad0d7301bd34f7151fec243d685 Signed-off-by: Krishna Manikandan Signed-off-by: Satya Rama Aditya Pinapala --- msm/dsi/dsi_drm.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/msm/dsi/dsi_drm.c b/msm/dsi/dsi_drm.c index 19a41015ed..24a75d39a7 100644 --- a/msm/dsi/dsi_drm.c +++ b/msm/dsi/dsi_drm.c @@ -11,6 +11,7 @@ #include "sde_connector.h" #include "dsi_drm.h" #include "sde_trace.h" +#include "sde_encoder.h" #define to_dsi_bridge(x) container_of((x), struct dsi_bridge, base) #define to_dsi_state(x) container_of((x), struct dsi_connector_state, base) @@ -343,6 +344,8 @@ static bool dsi_bridge_mode_fixup(struct drm_bridge *bridge, struct dsi_display *display; struct dsi_display_mode dsi_mode, cur_dsi_mode, *panel_dsi_mode; struct drm_crtc_state *crtc_state; + bool clone_mode = false; + struct drm_encoder *encoder; crtc_state = container_of(mode, struct drm_crtc_state, mode); @@ -407,6 +410,14 @@ static bool dsi_bridge_mode_fixup(struct drm_bridge *bridge, return false; } + drm_for_each_encoder(encoder, crtc_state->crtc->dev) { + if (encoder->crtc != crtc_state->crtc) + continue; + + if (sde_encoder_in_clone_mode(encoder)) + clone_mode = true; + } + /* No panel mode switch when drm pipeline is changing */ if ((dsi_mode.panel_mode != cur_dsi_mode.panel_mode) && (!(dsi_mode.dsi_mode_flags & DSI_MODE_FLAG_VRR)) && @@ -423,13 +434,16 @@ static bool dsi_bridge_mode_fixup(struct drm_bridge *bridge, dsi_mode.dsi_mode_flags |= DSI_MODE_FLAG_DMS; } - /* Reject seamless transition when active changed */ - if (crtc_state->active_changed && + /* Reject seamless transition when active/connectors changed */ + if ((crtc_state->active_changed || + (crtc_state->connectors_changed && clone_mode)) && ((dsi_mode.dsi_mode_flags & DSI_MODE_FLAG_VRR) || (dsi_mode.dsi_mode_flags & DSI_MODE_FLAG_POMS) || (dsi_mode.dsi_mode_flags & DSI_MODE_FLAG_DYN_CLK))) { - DSI_ERR("seamless upon active changed 0x%x %d\n", - dsi_mode.dsi_mode_flags, crtc_state->active_changed); + DSI_ERR("seamless on active/conn(%d/%d) changed 0x%x\n", + crtc_state->active_changed, + crtc_state->connectors_changed, + dsi_mode.dsi_mode_flags); return false; }