]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc: qcom: ubwc: add helper to get min_acc length
authorDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Sun, 25 Jan 2026 11:30:03 +0000 (13:30 +0200)
committerBjorn Andersson <andersson@kernel.org>
Mon, 30 Mar 2026 17:44:58 +0000 (12:44 -0500)
MDSS and GPU drivers use different approaches to get min_acc length.
Add helper function that can be used by all the drivers.

The helper reflects our current best guess, it blindly copies the
approach adopted by the MDSS drivers and it matches current values
selected by the GPU driver.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Acked-by: Bjorn Andersson <andersson@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260125-iris-ubwc-v4-1-1ff30644ac81@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
include/linux/soc/qcom/ubwc.h

index f052e241736c4bf92b3f3a603542082c5b608a51..5bdeca18d54df3f828c12916cc14d968a47139cf 100644 (file)
@@ -74,4 +74,14 @@ static inline bool qcom_ubwc_get_ubwc_mode(const struct qcom_ubwc_cfg_data *cfg)
        return ret;
 }
 
+/*
+ * This is the best guess, based on the MDSS driver, which worked so far.
+ */
+static inline bool qcom_ubwc_min_acc_length_64b(const struct qcom_ubwc_cfg_data *cfg)
+{
+       return cfg->ubwc_enc_version == UBWC_1_0 &&
+               (cfg->ubwc_dec_version == UBWC_2_0 ||
+                cfg->ubwc_dec_version == UBWC_3_0);
+}
+
 #endif /* __QCOM_UBWC_H__ */