[PATCH v3 09/27] drm/msm/mdss: use new helper to set min_acc length

Dmitry Baryshkov
2026-03-12T13:29:49Z

Use freshly defined helper instead of hardcoding the checks in the
driver.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/msm_mdss.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c
index e2ec1ee590e7..565e671ee402 100644
--- a/drivers/gpu/drm/msm/msm_mdss.c
+++ b/drivers/gpu/drm/msm/msm_mdss.c
@@ -172,8 +172,7 @@ static void msm_mdss_4x_setup_ubwc(struct msm_mdss *msm_mdss)
u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(data->ubwc_swizzle & 0x1) |
MDSS_UBWC_STATIC_HIGHEST_BANK_BIT(data->highest_bank_bit - 13);

- if (data->ubwc_enc_version == UBWC_1_0)
- value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN(1);
+ value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN(qcom_ubwc_min_acc_length_64b(data));

writel_relaxed(value, msm_mdss->mmio + REG_MDSS_UBWC_STATIC);
}
@@ -190,8 +189,7 @@ static void msm_mdss_5x_setup_ubwc(struct msm_mdss *msm_mdss)
if (data->ubwc_enc_version == UBWC_3_0)
value |= MDSS_UBWC_STATIC_UBWC_AMSBC;

- if (data->ubwc_enc_version == UBWC_1_0)
- value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN(1);
+ value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN(qcom_ubwc_min_acc_length_64b(data));

writel_relaxed(value, msm_mdss->mmio + REG_MDSS_UBWC_STATIC);
}
@@ -209,8 +207,7 @@ static void msm_mdss_6x_setup_ubwc(struct msm_mdss *msm_mdss)
if (data->macrotile_mode)
value |= MDSS_UBWC_STATIC_MACROTILE_MODE;

- if (data->ubwc_enc_version == UBWC_1_0)
- value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN(1);
+ value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN(qcom_ubwc_min_acc_length_64b(data));

writel_relaxed(value, msm_mdss->mmio + REG_MDSS_UBWC_STATIC);

--
2.47.3