summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>2026-05-07 16:02:59 +0300
committerBjorn Andersson <andersson@kernel.org>2026-05-20 05:29:19 +0300
commitb5f7365c44d8fd58ef0224bf4111805c4fea0a1e (patch)
treef72ea379e0db0f40f1a23b4064f5f9ed5a1678d8 /include/linux
parentab7e4d7cf6f8efd37a675a85eb0aef3d6a4954ba (diff)
downloadlinux-b5f7365c44d8fd58ef0224bf4111805c4fea0a1e.tar.xz
soc: qcom: ubwc: define helper for MDSS and Adreno drivers
Define special helper returning version setting for MDSS and A8xx drivers. Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260507-ubwc-rework-v4-3-c19593d20c1d@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/soc/qcom/ubwc.h16
1 files changed, 16 insertions, 0 deletions
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__ */