[PATCH v3 16/27] drm/msm/adreno: use new helper to set amsbc

Dmitry Baryshkov
2026-03-12T13:30:00Z

Use freshly defined helper instead of checking the UBWC version
directly.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +-
drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 7be31de3b525..f6bd906f2ac9 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -743,7 +743,7 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu)
bool rgb565_predicator = cfg->ubwc_enc_version >= UBWC_4_0;
u32 level2_swizzling_dis = !(qcom_ubwc_swizzle(cfg) & UBWC_SWIZZLE_ENABLE_LVL2);
bool ubwc_mode = qcom_ubwc_get_ubwc_mode(cfg);
- bool amsbc = cfg->ubwc_enc_version >= UBWC_3_0;
+ bool amsbc = qcom_ubwc_enable_amsbc(cfg);
bool min_acc_len_64b;
u8 uavflagprd_inv = 0;
u32 hbb_hi = hbb >> 2;
diff --git a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
index 680f0b1803a1..63934d21c831 100644
--- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
@@ -275,22 +275,22 @@ static void a8xx_set_ubwc_config(struct msm_gpu *gpu)
u32 hbb, hbb_hi, hbb_lo, mode;
u8 uavflagprd_inv = 2;

+ if (ubwc_version < UBWC_6_0)
+ amsbc = qcom_ubwc_enable_amsbc(cfg);
+
switch (ubwc_version) {
case UBWC_6_0:
yuvnotcomptofc = true;
break;
case UBWC_5_0:
- amsbc = true;
rgb565_predicator = true;
break;
case UBWC_4_0:
- amsbc = true;
rgb565_predicator = true;
fp16compoptdis = true;
rgba8888_lossless = true;
break;
case UBWC_3_0:
- amsbc = true;
break;
default:
dev_err(&gpu->pdev->dev, "Unknown UBWC version: 0x%x\n", ubwc_version);

--
2.47.3