Browse Source

disp: msm: sde: update cwb block offset for kalama target

Update the cwb block offset and stride values for kalama
target in sde hw catalog. As part of the change, allow the
ctl wb-flush bit for cwb to be set based on the wb idx used.

Change-Id: Ibf7ccda88cbb47bddacf53b5af9841d381a4766c
Signed-off-by: Veera Sundaram Sankaran <[email protected]>
Veera Sundaram Sankaran 3 years ago
parent
commit
0fa8704818
3 changed files with 16 additions and 3 deletions
  1. 5 0
      msm/sde/sde_encoder_phys_wb.c
  2. 5 2
      msm/sde/sde_hw_catalog.c
  3. 6 1
      msm/sde/sde_hw_ctl.c

+ 5 - 0
msm/sde/sde_encoder_phys_wb.c

@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // SPDX-License-Identifier: GPL-2.0-only
 /*
 /*
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  */
  */
 
 
@@ -527,6 +528,7 @@ static void _sde_encoder_phys_wb_setup_cwb(struct sde_encoder_phys *phys_enc, bo
 	struct sde_hw_dnsc_blur *hw_dnsc_blur = phys_enc->hw_dnsc_blur;
 	struct sde_hw_dnsc_blur *hw_dnsc_blur = phys_enc->hw_dnsc_blur;
 	bool need_merge = (crtc->num_mixers > 1);
 	bool need_merge = (crtc->num_mixers > 1);
 	int i = 0;
 	int i = 0;
+	const int num_wb = 1;
 
 
 	if (!phys_enc->in_clone_mode) {
 	if (!phys_enc->in_clone_mode) {
 		SDE_DEBUG("[enc:%d wb:%d] not in CWB mode. early return\n",
 		SDE_DEBUG("[enc:%d wb:%d] not in CWB mode. early return\n",
@@ -546,6 +548,9 @@ static void _sde_encoder_phys_wb_setup_cwb(struct sde_encoder_phys *phys_enc, bo
 			test_bit(SDE_WB_DCWB_CTRL, &hw_wb->caps->features))) {
 			test_bit(SDE_WB_DCWB_CTRL, &hw_wb->caps->features))) {
 		struct sde_hw_intf_cfg_v1 intf_cfg = { 0, };
 		struct sde_hw_intf_cfg_v1 intf_cfg = { 0, };
 
 
+		intf_cfg.wb_count = num_wb;
+		intf_cfg.wb[0] = hw_wb->idx;
+
 		for (i = 0; i < crtc->num_mixers; i++)
 		for (i = 0; i < crtc->num_mixers; i++)
 			intf_cfg.cwb[intf_cfg.cwb_count++] = (enum sde_cwb)
 			intf_cfg.cwb[intf_cfg.cwb_count++] = (enum sde_cwb)
 				(test_bit(SDE_WB_DCWB_CTRL, &hw_wb->caps->features) ?
 				(test_bit(SDE_WB_DCWB_CTRL, &hw_wb->caps->features) ?

+ 5 - 2
msm/sde/sde_hw_catalog.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // SPDX-License-Identifier: GPL-2.0-only
 /*
 /*
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  */
  */
 
 
@@ -2596,7 +2596,10 @@ static int sde_wb_parse_dt(struct device_node *np, struct sde_mdss_cfg *sde_cfg)
 			set_bit(SDE_WB_HAS_DCWB, &wb->features);
 			set_bit(SDE_WB_HAS_DCWB, &wb->features);
 			if (IS_SDE_CTL_REV_100(sde_cfg->ctl_rev))
 			if (IS_SDE_CTL_REV_100(sde_cfg->ctl_rev))
 				set_bit(SDE_WB_DCWB_CTRL, &wb->features);
 				set_bit(SDE_WB_DCWB_CTRL, &wb->features);
-			if (major_version >= SDE_HW_MAJOR(SDE_HW_VER_810)) {
+			if (major_version >= SDE_HW_MAJOR(SDE_HW_VER_900)) {
+				sde_cfg->cwb_blk_off = 0x67200;
+				sde_cfg->cwb_blk_stride = 0x400;
+			} else if (major_version >= SDE_HW_MAJOR(SDE_HW_VER_810)) {
 				sde_cfg->cwb_blk_off = 0x66A00;
 				sde_cfg->cwb_blk_off = 0x66A00;
 				sde_cfg->cwb_blk_stride = 0x400;
 				sde_cfg->cwb_blk_stride = 0x400;
 			} else {
 			} else {

+ 6 - 1
msm/sde/sde_hw_ctl.c

@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // SPDX-License-Identifier: GPL-2.0-only
 /*
 /*
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  */
  */
 
 
@@ -1136,7 +1137,11 @@ static int sde_hw_ctl_update_intf_cfg(struct sde_hw_ctl *ctx,
 					enable);
 					enable);
 		}
 		}
 
 
-		wb_active = enable ? BIT(2) : 0;
+		for (i = 0; i < cfg->wb_count; i++) {
+			if (cfg->wb[i] && enable)
+				wb_active |= BIT(cfg->wb[i] - WB_0);
+		}
+
 		SDE_REG_WRITE(c, CTL_CWB_ACTIVE, cwb_active);
 		SDE_REG_WRITE(c, CTL_CWB_ACTIVE, cwb_active);
 		SDE_REG_WRITE(c, CTL_WB_ACTIVE, wb_active);
 		SDE_REG_WRITE(c, CTL_WB_ACTIVE, wb_active);
 	}
 	}