From e664bd181ffdaceddd61eceb2a28596fc44b46ec Mon Sep 17 00:00:00 2001 From: Yojana Juadi Date: Thu, 31 Aug 2023 17:33:58 +0530 Subject: [PATCH] disp: msm: sde: configure ubwc ctrl ver in hw as per devicetree This change fixes the 'commit 1aacef1e1d95 ("disp: msm: sde: fix UBWC decoder version support for Kalama")'. Ubwc_ctrl must be set with global ubwc encoder version populated from devicetree setting. Change-Id: I85dc80e2e0436536a9b14e7e43199dc7b4421485 Signed-off-by: Yojana Juadi --- msm/sde/sde_hw_top.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/msm/sde/sde_hw_top.c b/msm/sde/sde_hw_top.c index d61d6e61..e303db18 100644 --- a/msm/sde/sde_hw_top.c +++ b/msm/sde/sde_hw_top.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. */ @@ -363,19 +363,26 @@ void sde_hw_reset_ubwc(struct sde_hw_mdp *mdp, struct sde_mdss_cfg *m) c = mdp->hw; c.blk_off = 0x0; ubwc_dec_version = SDE_REG_READ(&c, UBWC_DEC_HW_VERSION); + /* global ubwc version used in input fb encoding */ ubwc_enc_version = m->ubwc_rev; if (IS_UBWC_40_SUPPORTED(ubwc_dec_version) || IS_UBWC_43_SUPPORTED(ubwc_dec_version)) { - u32 ver = IS_UBWC_43_SUPPORTED(ubwc_dec_version) ? 3 : 2; - u32 mode = 1; + /* for UBWC 2.0 ver = 0, mode = 0 will be programmed */ + u32 ver = 0; + u32 mode = 0; u32 reg = (m->mdp[0].ubwc_swizzle & 0x7) | ((m->mdp[0].ubwc_static & 0x1) << 3) | ((m->mdp[0].highest_bank_bit & 0x7) << 4) | ((m->macrotile_mode & 0x1) << 12); - if (IS_UBWC_30_SUPPORTED(ubwc_enc_version)) { + if (IS_UBWC_43_SUPPORTED(ubwc_enc_version)) { + ver = 3; + mode = 1; + } else if (IS_UBWC_40_SUPPORTED(ubwc_enc_version)) { + ver = 2; + mode = 1; + } else if (IS_UBWC_30_SUPPORTED(ubwc_enc_version)) { ver = 1; - mode = 0; } SDE_REG_WRITE(&c, UBWC_STATIC, reg);