From b93086c5679a5633d44f92f2dd54e360add503ee Mon Sep 17 00:00:00 2001 From: Akash Gajjar Date: Wed, 4 Jan 2023 11:24:58 +0530 Subject: [PATCH] disp: msm: dsi: add check for the invalid modeset There can be a scenario where fps change along with dynamic clock happen in a same commit. This makes newer dynamic clock configuration come to impact while leaving panel vblank to function as per the older configured fps. This is invalid modeset, add validation check for the same. Change-Id: I32f15de5260d3abdb16a4b1c3f8eefc8bd634848 Signed-off-by: Akash Gajjar --- msm/dsi/dsi_drm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/msm/dsi/dsi_drm.c b/msm/dsi/dsi_drm.c index afc85ceef2..541738018c 100644 --- a/msm/dsi/dsi_drm.c +++ b/msm/dsi/dsi_drm.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */ @@ -464,6 +464,14 @@ static bool _dsi_bridge_mode_validate_and_fixup(struct drm_bridge *bridge, adj_mode->panel_mode_caps); } + if (!dsi_display_mode_match(&cur_dsi_mode, adj_mode, + DSI_MODE_MATCH_ACTIVE_TIMINGS) && + (adj_mode->dsi_mode_flags & DSI_MODE_FLAG_DYN_CLK)) { + adj_mode->dsi_mode_flags &= ~DSI_MODE_FLAG_DYN_CLK; + DSI_ERR("DMS and dyn clk not supported in same commit\n"); + return false; + } + return rc; }