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>
This commit is contained in:
Dmitry Baryshkov 2026-05-07 16:02:59 +03:00 committed by Bjorn Andersson
parent ab7e4d7cf6
commit b5f7365c44

View File

@ -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__ */