[PATCH 03/24] soc: qcom: ubwc: define helper for MDSS and Adreno drivers

From: Dmitry Baryshkov

Date: Fri Mar 06 2026 - 11:48:48 EST


Define special helper returning version setting for MDSS and A8xx
drivers.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
---
include/linux/soc/qcom/ubwc.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h
index 319caed88775..8355ffe40f88 100644
--- a/include/linux/soc/qcom/ubwc.h
+++ b/include/linux/soc/qcom/ubwc.h
@@ -100,4 +100,20 @@ static inline u32 qcom_ubwc_swizzle(const struct qcom_ubwc_cfg_data *cfg)
return cfg->ubwc_swizzle;
}

+static inline u32 qcom_ubwc_version_tag(const struct qcom_ubwc_cfg_data *cfg)
+{
+ if (cfg->ubwc_enc_version >= UBWC_6_0)
+ return 5;
+ if (cfg->ubwc_enc_version >= UBWC_5_0)
+ return 4;
+ if (cfg->ubwc_enc_version >= UBWC_4_3)
+ return 3;
+ if (cfg->ubwc_enc_version >= UBWC_4_0)
+ return 2;
+ if (cfg->ubwc_enc_version >= UBWC_3_0)
+ return 1;
+
+ return 0;
+}
+
#endif /* __QCOM_UBWC_H__ */

--
2.47.3