Browse Source

Merge "disp: msm: sde: Add support to limit DSC size to 10k"

qctecmdr 3 years ago
parent
commit
9a562d931b
3 changed files with 19 additions and 8 deletions
  1. 5 2
      msm/sde/sde_hw_catalog.c
  2. 6 1
      msm/sde/sde_hw_catalog.h
  3. 8 5
      msm/sde/sde_hw_dsc_1_2.c

+ 5 - 2
msm/sde/sde_hw_catalog.c

@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2015-2022, The Linux Foundation. All rights reserved.
  */
 
 #define pr_fmt(fmt)	"[drm:%s:%d] " fmt, __func__, __LINE__
@@ -3271,7 +3272,8 @@ static int sde_dsc_parse_dt(struct device_node *np,
 			if (PROP_VALUE_ACCESS(prop_value, DSC_422, i))
 					set_bit(SDE_DSC_NATIVE_422_EN,
 						&dsc->features);
-
+			if (sde_cfg->has_reduced_ob_max)
+				set_bit(SDE_DSC_REDUCED_OB_MAX, &dsc->features);
 		} else {
 			set_bit(SDE_DSC_HW_REV_1_1, &dsc->features);
 		}
@@ -5148,6 +5150,7 @@ static int _sde_hardware_pre_caps(struct sde_mdss_cfg *sde_cfg, uint32_t hw_rev)
 		sde_cfg->has_cwb_crop = true;
 		sde_cfg->has_qsync = true;
 		sde_cfg->perf.min_prefill_lines = 40;
+		sde_cfg->has_reduced_ob_max = true;
 		sde_cfg->vbif_qos_nlvl = 8;
 		sde_cfg->ts_prefill_rev = 2;
 		sde_cfg->ctl_rev = SDE_CTL_CFG_VERSION_1_0_0;

+ 6 - 1
msm/sde/sde_hw_catalog.h

@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2015-2022, The Linux Foundation. All rights reserved.
  */
 
 #ifndef _SDE_HW_CATALOG_H
@@ -459,6 +460,7 @@ enum {
  * @SDE_DSC_HW_REV_1_1          dsc block supports dsc 1.1 only
  * @SDE_DSC_HW_REV_1_2          dsc block supports dsc 1.1 and 1.2
  * @SDE_DSC_NATIVE_422_EN,      Supports native422 and native420 encoding
+ * @SDE_DSC_REDUCED_OB_MAX,	DSC size is limited to 10k
  * @SDE_DSC_ENC,                DSC encoder sub block
  * @SDE_DSC_CTL,                DSC ctl sub block
  * @SDE_DSC_MAX
@@ -468,6 +470,7 @@ enum {
 	SDE_DSC_HW_REV_1_1,
 	SDE_DSC_HW_REV_1_2,
 	SDE_DSC_NATIVE_422_EN,
+	SDE_DSC_REDUCED_OB_MAX,
 	SDE_DSC_ENC,
 	SDE_DSC_CTL,
 	SDE_DSC_MAX
@@ -1522,6 +1525,7 @@ struct sde_perf_cfg {
  * @skip_inline_rot_thresh    Skip inline rotation threshold
  * @has_idle_pc        indicate if idle power collapse feature is supported
  * @allowed_dsc_reservation_switch  intf to which dsc reservation switch is supported
+ * @has_reduced_ob_max	indicate if DSC size is limited to 10k
  * @wakeup_with_touch  indicate early wake up display with input touch event
  * @has_hdr            HDR feature support
  * @has_hdr_plus       HDR10+ feature support
@@ -1615,6 +1619,7 @@ struct sde_mdss_cfg {
 	bool skip_inline_rot_threshold;
 	bool has_idle_pc;
 	u32 allowed_dsc_reservation_switch;
+	bool has_reduced_ob_max;
 	bool wakeup_with_touch;
 	u32 vbif_qos_nlvl;
 	u32 ts_prefill_rev;

+ 8 - 5
msm/sde/sde_hw_dsc_1_2.c

@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2020-2022, The Linux Foundation. All rights reserved.
  */
 
 #include "sde_hw_mdss.h"
@@ -60,19 +61,21 @@
 static int _dsc_calc_ob_max_addr(struct sde_hw_dsc *hw_dsc, int num_ss)
 {
 	enum sde_dsc idx;
+	bool reduced_ob_max;
 
 	idx = hw_dsc->idx;
+	reduced_ob_max = hw_dsc->caps->features & BIT(SDE_DSC_REDUCED_OB_MAX);
 
 	if (!(hw_dsc->caps->features & BIT(SDE_DSC_NATIVE_422_EN))) {
 		if (num_ss == 1)
-			return 2399;
+			return reduced_ob_max ? 1199 : 2399;
 		else if (num_ss == 2)
-			return 1199;
+			return reduced_ob_max ? 599 : 1199;
 	} else {
 		if (num_ss == 1)
-			return 1199;
+			return reduced_ob_max ? 599 : 1199;
 		else if (num_ss == 2)
-			return 599;
+			return reduced_ob_max ? 299 : 599;
 	}
 	return 0;
 }