From 0e257f3325320c998a85d05e0442bc08bfaf75e2 Mon Sep 17 00:00:00 2001 From: Krishna Manikandan Date: Tue, 7 Jul 2020 18:13:59 +0530 Subject: [PATCH] disp: msm: sde: add support to parse hbb and ddr type Add support to parse ddr type and corresponding highest bank bit for configuring UBWC parameters. Change-Id: I54f79a60f55fd6b146783c8f53fce1bf6c8d8d0a Signed-off-by: Krishna Manikandan --- msm/sde/sde_hw_catalog.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/msm/sde/sde_hw_catalog.c b/msm/sde/sde_hw_catalog.c index 62e7ad53595c..2a784586e58b 100644 --- a/msm/sde/sde_hw_catalog.c +++ b/msm/sde/sde_hw_catalog.c @@ -550,7 +550,8 @@ static struct sde_prop_type sde_prop[] = { {WB_LINEWIDTH, "qcom,sde-wb-linewidth", false, PROP_TYPE_U32}, {WB_LINEWIDTH_LINEAR, "qcom,sde-wb-linewidth-linear", false, PROP_TYPE_U32}, - {BANK_BIT, "qcom,sde-highest-bank-bit", false, PROP_TYPE_U32}, + {BANK_BIT, "qcom,sde-highest-bank-bit", false, + PROP_TYPE_BIT_OFFSET_ARRAY}, {UBWC_VERSION, "qcom,sde-ubwc-version", false, PROP_TYPE_U32}, {UBWC_STATIC, "qcom,sde-ubwc-static", false, PROP_TYPE_U32}, {UBWC_SWIZZLE, "qcom,sde-ubwc-swizzle", false, PROP_TYPE_U32}, @@ -1078,7 +1079,6 @@ static int _validate_dt_entry(struct device_node *np, sde_prop[i].prop_name, prop_count[i], *off_count); rc = 0; - prop_count[i] = 0; } if (prop_count[i] < 0) { prop_count[i] = 0; @@ -3675,6 +3675,7 @@ static void _sde_top_parse_dt_helper(struct sde_mdss_cfg *cfg, struct sde_dt_props *props) { int i; + u32 ddr_type; cfg->max_sspp_linewidth = props->exists[SSPP_LINEWIDTH] ? PROP_VALUE_ACCESS(props->values, SSPP_LINEWIDTH, 0) : @@ -3709,13 +3710,18 @@ static void _sde_top_parse_dt_helper(struct sde_mdss_cfg *cfg, SDE_HW_UBWC_VER(PROP_VALUE_ACCESS(props->values, UBWC_VERSION, 0)) : DEFAULT_SDE_UBWC_NONE; - cfg->mdp[0].highest_bank_bit = props->exists[BANK_BIT] ? - PROP_VALUE_ACCESS(props->values, BANK_BIT, 0) : - DEFAULT_SDE_HIGHEST_BANK_BIT; + cfg->mdp[0].highest_bank_bit = DEFAULT_SDE_HIGHEST_BANK_BIT; - if (cfg->ubwc_version == SDE_HW_UBWC_VER_40 && - of_fdt_get_ddrtype() == LP_DDR4_TYPE) - cfg->mdp[0].highest_bank_bit = 0x02; + if (props->exists[BANK_BIT]) { + for (i = 0; i < props->counts[BANK_BIT]; i++) { + ddr_type = PROP_BITVALUE_ACCESS(props->values, + BANK_BIT, i, 0); + if (!ddr_type || (of_fdt_get_ddrtype() == ddr_type)) + cfg->mdp[0].highest_bank_bit = + PROP_BITVALUE_ACCESS(props->values, + BANK_BIT, i, 1); + } + } cfg->macrotile_mode = props->exists[MACROTILE_MODE] ? PROP_VALUE_ACCESS(props->values, MACROTILE_MODE, 0) :