[PATCH v3 06/27] drm/msm/adreno: use qcom_ubwc_version_tag() helper

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

Use new helper defined to program UBWC version to the hardware.

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

diff --git a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
index b1887e0cf698..6dc1d81fcaeb 100644
--- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
@@ -272,35 +272,33 @@ static void a8xx_set_ubwc_config(struct msm_gpu *gpu)
bool rgb565_predicator = false, amsbc = false;
bool ubwc_mode = qcom_ubwc_get_ubwc_mode(cfg);
u32 ubwc_version = cfg->ubwc_enc_version;
- u32 hbb, hbb_hi, hbb_lo, mode = 1;
+ u32 hbb, hbb_hi, hbb_lo, mode;
u8 uavflagprd_inv = 2;

switch (ubwc_version) {
case UBWC_6_0:
yuvnotcomptofc = true;
- mode = 5;
break;
case UBWC_5_0:
amsbc = true;
rgb565_predicator = true;
- mode = 4;
break;
case UBWC_4_0:
amsbc = true;
rgb565_predicator = true;
fp16compoptdis = true;
rgba8888_lossless = true;
- mode = 2;
break;
case UBWC_3_0:
amsbc = true;
- mode = 1;
break;
default:
dev_err(&gpu->pdev->dev, "Unknown UBWC version: 0x%x\n", ubwc_version);
break;
}

+ mode = qcom_ubwc_version_tag(cfg);
+
/*
* We subtract 13 from the highest bank bit (13 is the minimum value
* allowed by hw) and write the lowest two bits of the remaining value

--
2.47.3