From e9dd33dd1e6cfb1d59e04f08f3d3639474a6864b Mon Sep 17 00:00:00 2001 From: Jayaprakash Madisetty Date: Mon, 31 Jan 2022 20:42:44 +0530 Subject: [PATCH] disp: msm: sde: configure dest_scaler op_mode for two independent displays Destination scaler0 and scaler1 when operated in independent mode, by two built-in independent displays the op_mode gets modified concurrently and HW flushes new config. This leads to underruns on both the displays. This change programs the op_mode correctly to operate ds0 and ds1 independently. Change-Id: I01a3d4a986e0e7166f8a38b4cf35981d3e434686 Signed-off-by: Jayaprakash Madisetty --- msm/sde/sde_hw_ds.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/msm/sde/sde_hw_ds.c b/msm/sde/sde_hw_ds.c index ddbf68b200..023ea03eb9 100644 --- a/msm/sde/sde_hw_ds.c +++ b/msm/sde/sde_hw_ds.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. */ @@ -16,8 +17,18 @@ static void sde_hw_ds_setup_opmode(struct sde_hw_ds *hw_ds, u32 op_mode) { struct sde_hw_blk_reg_map *hw = &hw_ds->hw; + u32 op_mode_val; - SDE_REG_WRITE(hw, DEST_SCALER_OP_MODE, op_mode); + op_mode_val = SDE_REG_READ(hw, DEST_SCALER_OP_MODE); + + if (op_mode) + op_mode_val |= op_mode; + else if (!op_mode && (op_mode_val & SDE_DS_OP_MODE_DUAL)) + op_mode_val = 0; + else + op_mode_val &= ~BIT(hw_ds->idx - DS_0); + + SDE_REG_WRITE(hw, DEST_SCALER_OP_MODE, op_mode_val); } static void sde_hw_ds_setup_scaler3(struct sde_hw_ds *hw_ds,