* [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database
@ 2026-05-20 14:51 Dmitry Baryshkov
2026-05-20 14:51 ` [PATCH v5 01/28] soc: qcom: ubwc: define UBWC 3.1 Dmitry Baryshkov
` (28 more replies)
0 siblings, 29 replies; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Currently we store several settings in the configuration database. Some
of them are incorrect or not completely matching the expected
configuration settings. Others are directly derivable from the UBWC
version. Rework how we handle the values in the database, trimming it
down to the UBWC version, HBB and several flags.
The series includes patches for drm/msm as well as for the soc/qcom. My
suggestion would be to either create an immutable tag for the first
batch of soc/qcom patches, which we can pull into drm/msm or to ack
merging the first patches through drm/msm tree directly.
Bjorn, would you please ack merging first soc/qcom/ubwc patches through
the drm/msm tree? Or would you please merge them and provide the
immutable tag?
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
Changes in v5:
- Dropped applied patch
- Rebased on next, fixing conflicts
- Changed SC8180X to UBWC 3.1 (as it uses the macrotile mode) (Konrad)
- Link to v4: https://patch.msgid.link/20260507-ubwc-rework-v4-0-c19593d20c1d@oss.qualcomm.com
Changes in v4:
- Rebased on linux-next, dropping merged dependencies.
- Reworked A8xx, simplifying several corner cases.
- Link to v3: https://lore.kernel.org/r/20260312-ubwc-rework-v3-0-b7e8f800176a@oss.qualcomm.com
Changes in v3:
- Corrected UWBC_STATIC programming for MDSS 5.x platforms (Konrad)
- Switched MDSS 6.x+ to qcom_ubwc_min_acc_length_64b() too
- Added qcom_ubwc_enable_amsbc() helper
- Reworked the DPU handling of UBWC config, making it simpler to handle
minor revisions.
- Removed the comment regarding the best guess for min_acc_length
- Link to v2: https://lore.kernel.org/r/20260311-ubwc-rework-v2-0-69f718f2a1c9@oss.qualcomm.com
Changes in v2:
- Renamed MDSS UBWC programming function to make it more obvious that
they are related to the MDSS revision rather than UBWC version
(Konrad)
- Brought back the patch to use qcom_ubwc_version_tag() in msm_mdss.c,
got lost in rebases (Konrad)
- Link to v1: https://lore.kernel.org/r/20260306-ubwc-rework-v1-0-9cfdff12f2bb@oss.qualcomm.com
---
Dmitry Baryshkov (27):
soc: qcom: ubwc: define UBWC 3.1
soc: qcom: ubwc: define helper for MDSS and Adreno drivers
soc: qcom: ubwc: add helper controlling AMSBC enablement
drm/msm/adreno: use qcom_ubwc_version_tag() helper
drm/msm/mdss: use qcom_ubwc_version_tag() helper
drm/msm/adreno: use new helper to set min_acc length
drm/msm/mdss: use new helper to set min_acc length
drm/msm/adreno: use new helper to set macrotile_mode
drm/msm/mdss: use new helper to set macrotile_mode
drm/msm/mdss: use new helper to set UBWC bank spreading
drm/msm/adreno: use new helper to set ubwc_swizzle
drm/msm/dpu: use new helper to set ubwc_swizzle
drm/msm/mdss: use new helper to set ubwc_swizzle
drm/msm/adreno: write reserved UBWC-related bits
drm/msm/adreno: set fp16compoptdis for UBWC 3.0 formats
drm/msm/adreno: use new helper to set amsbc
drm/msm/adreno: use version ranges in A8xx UBWC code
drm/msm/mdss: use new helper to set amsbc
drm/msm/dpu: drop ubwc_dec_version
drm/msm/dpu: invert the order of UBWC checks
soc: qcom: ubwc: set min_acc length to 64 for all UBWC 1.0 targets
soc: qcom: ubwc: drop ubwc_dec_version
soc: qcom: ubwc: drop ubwc_bank_spread
soc: qcom: ubwc: drop macrotile_mode from the database
soc: qcom: ubwc: use fixed values for UBWC swizzle for UBWC < 4.0
soc: qcom: ubwc: sort out the rest of the UBWC swizzle settings
soc: qcom: ubwc: deduplicate UBWC configuration data
Konrad Dybcio (1):
drm/msm/adreno: Trust the SSoT UBWC config
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 11 +-
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 93 +--------
drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 50 +++--
drivers/gpu/drm/msm/adreno/adreno_gpu.c | 4 +-
drivers/gpu/drm/msm/adreno/adreno_gpu.h | 5 -
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 39 ++--
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 3 +-
drivers/gpu/drm/msm/msm_mdss.c | 43 ++--
drivers/soc/qcom/ubwc_config.c | 295 ++++++++--------------------
include/linux/soc/qcom/ubwc.h | 103 ++++++----
10 files changed, 216 insertions(+), 430 deletions(-)
---
base-commit: 687da68900cd1a46549f7d9430c7d40346cb86a0
change-id: 20260211-ubwc-rework-e6ce1d8eb520
prerequisite-patch-id: 47fdf46e2c4719c7e83bb10e7a987483ca388bbe
Best regards,
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 58+ messages in thread
* [PATCH v5 01/28] soc: qcom: ubwc: define UBWC 3.1
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 02/28] soc: qcom: ubwc: define helper for MDSS and Adreno drivers Dmitry Baryshkov
` (27 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Follow the comment for the macrotile_mode and introduce separate
revision for UBWC 3.0 + 8-channel macrotiling mode. It is not used by
the database (since the drivers are not yet changed to handle it yet).
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
include/linux/soc/qcom/ubwc.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h
index f5d0e2341261..319caed88775 100644
--- a/include/linux/soc/qcom/ubwc.h
+++ b/include/linux/soc/qcom/ubwc.h
@@ -50,6 +50,7 @@ struct qcom_ubwc_cfg_data {
#define UBWC_1_0 0x10000000
#define UBWC_2_0 0x20000000
#define UBWC_3_0 0x30000000
+#define UBWC_3_1 0x30010000 /* UBWC 3.0 + Macrotile mode */
#define UBWC_4_0 0x40000000
#define UBWC_4_3 0x40030000
#define UBWC_5_0 0x50000000
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 02/28] soc: qcom: ubwc: define helper for MDSS and Adreno drivers
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
2026-05-20 14:51 ` [PATCH v5 01/28] soc: qcom: ubwc: define UBWC 3.1 Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 03/28] soc: qcom: ubwc: add helper controlling AMSBC enablement Dmitry Baryshkov
` (26 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
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>
---
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
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 03/28] soc: qcom: ubwc: add helper controlling AMSBC enablement
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
2026-05-20 14:51 ` [PATCH v5 01/28] soc: qcom: ubwc: define UBWC 3.1 Dmitry Baryshkov
2026-05-20 14:51 ` [PATCH v5 02/28] soc: qcom: ubwc: define helper for MDSS and Adreno drivers Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 04/28] drm/msm/adreno: Trust the SSoT UBWC config Dmitry Baryshkov
` (25 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Adreno and MDSS drivers need to know whether to enable AMSBC. Add
separate helper, describing that feature.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
include/linux/soc/qcom/ubwc.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h
index 8355ffe40f88..83d2c2a7116c 100644
--- a/include/linux/soc/qcom/ubwc.h
+++ b/include/linux/soc/qcom/ubwc.h
@@ -116,4 +116,9 @@ static inline u32 qcom_ubwc_version_tag(const struct qcom_ubwc_cfg_data *cfg)
return 0;
}
+static inline bool qcom_ubwc_enable_amsbc(const struct qcom_ubwc_cfg_data *cfg)
+{
+ return cfg->ubwc_enc_version >= UBWC_3_0;
+}
+
#endif /* __QCOM_UBWC_H__ */
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 04/28] drm/msm/adreno: Trust the SSoT UBWC config
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (2 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 03/28] soc: qcom: ubwc: add helper controlling AMSBC enablement Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 05/28] drm/msm/adreno: use qcom_ubwc_version_tag() helper Dmitry Baryshkov
` (24 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Now that the highest_bank_bit value is retrieved from the running
system and the global config has been part of the tree for a couple
of releases, there is no reason to keep any hardcoded values inside
the GPU driver.
Get rid of them.
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Rob Clark <robin.clark@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 11 ++---
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 82 ++-------------------------------
drivers/gpu/drm/msm/adreno/adreno_gpu.h | 5 --
3 files changed, 6 insertions(+), 92 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index 79acae11154a..699fc0f551ed 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -1725,7 +1725,6 @@ static struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
struct msm_drm_private *priv = dev->dev_private;
struct platform_device *pdev = priv->gpu_pdev;
struct adreno_platform_config *config = pdev->dev.platform_data;
- const struct qcom_ubwc_cfg_data *common_cfg;
struct a5xx_gpu *a5xx_gpu = NULL;
struct adreno_gpu *adreno_gpu;
struct msm_gpu *gpu;
@@ -1769,13 +1768,9 @@ static struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
a5xx_preempt_init(gpu);
/* Inherit the common config and make some necessary fixups */
- common_cfg = qcom_ubwc_config_get_data();
- if (IS_ERR(common_cfg))
- return ERR_CAST(common_cfg);
-
- /* Copy the data into the internal struct to drop the const qualifier (temporarily) */
- adreno_gpu->_ubwc_config = *common_cfg;
- adreno_gpu->ubwc_config = &adreno_gpu->_ubwc_config;
+ adreno_gpu->ubwc_config = qcom_ubwc_config_get_data();
+ if (IS_ERR(adreno_gpu->ubwc_config))
+ return ERR_CAST(adreno_gpu->ubwc_config);
adreno_gpu->uche_trap_base = 0x0001ffffffff0000ull;
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 7a3e3c2f5cf3..90e814c64c6e 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -733,82 +733,6 @@ static void a6xx_set_cp_protect(struct msm_gpu *gpu)
gpu_write(gpu, REG_A6XX_CP_PROTECT(protect->count_max - 1), protect->regs[i]);
}
-static int a6xx_calc_ubwc_config(struct adreno_gpu *gpu)
-{
- const struct qcom_ubwc_cfg_data *common_cfg;
- struct qcom_ubwc_cfg_data *cfg = &gpu->_ubwc_config;
-
- /* Inherit the common config and make some necessary fixups */
- common_cfg = qcom_ubwc_config_get_data();
- if (IS_ERR(common_cfg))
- return PTR_ERR(common_cfg);
-
- /* Copy the data into the internal struct to drop the const qualifier (temporarily) */
- *cfg = *common_cfg;
-
- /* Use common config as is for A8x */
- if (!adreno_is_a8xx(gpu)) {
- cfg->ubwc_swizzle = 0x6;
- cfg->highest_bank_bit = 15;
- }
-
- if (adreno_is_a610(gpu)) {
- cfg->highest_bank_bit = 13;
- cfg->ubwc_swizzle = 0x7;
- }
-
- if (adreno_is_a612(gpu))
- cfg->highest_bank_bit = 14;
-
- if (adreno_is_a618(gpu))
- cfg->highest_bank_bit = 14;
-
- if (adreno_is_a619(gpu))
- /* TODO: Should be 14 but causes corruption at e.g. 1920x1200 on DP */
- cfg->highest_bank_bit = 13;
-
- if (adreno_is_a619_holi(gpu))
- cfg->highest_bank_bit = 13;
-
- if (adreno_is_a621(gpu))
- cfg->highest_bank_bit = 13;
-
- if (adreno_is_a623(gpu))
- cfg->highest_bank_bit = 16;
-
- if (adreno_is_a650(gpu) ||
- adreno_is_a660(gpu) ||
- adreno_is_a690(gpu) ||
- adreno_is_a730(gpu) ||
- adreno_is_a740_family(gpu)) {
- /* TODO: get ddr type from bootloader and use 15 for LPDDR4 */
- cfg->highest_bank_bit = 16;
- }
-
- if (adreno_is_a663(gpu)) {
- cfg->highest_bank_bit = 13;
- cfg->ubwc_swizzle = 0x4;
- }
-
- if (adreno_is_7c3(gpu))
- cfg->highest_bank_bit = 14;
-
- if (adreno_is_a702(gpu))
- cfg->highest_bank_bit = 14;
-
- if (cfg->highest_bank_bit != common_cfg->highest_bank_bit)
- DRM_WARN_ONCE("Inconclusive highest_bank_bit value: %u (GPU) vs %u (UBWC_CFG)\n",
- cfg->highest_bank_bit, common_cfg->highest_bank_bit);
-
- if (cfg->ubwc_swizzle != common_cfg->ubwc_swizzle)
- DRM_WARN_ONCE("Inconclusive ubwc_swizzle value: %u (GPU) vs %u (UBWC_CFG)\n",
- cfg->ubwc_swizzle, common_cfg->ubwc_swizzle);
-
- gpu->ubwc_config = &gpu->_ubwc_config;
-
- return 0;
-}
-
static void a6xx_set_ubwc_config(struct msm_gpu *gpu)
{
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
@@ -2700,10 +2624,10 @@ static struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
msm_mmu_set_fault_handler(to_msm_vm(gpu->vm)->mmu, gpu,
adreno_gpu->funcs->mmu_fault_handler);
- ret = a6xx_calc_ubwc_config(adreno_gpu);
- if (ret) {
+ adreno_gpu->ubwc_config = qcom_ubwc_config_get_data();
+ if (IS_ERR(adreno_gpu->ubwc_config)) {
a6xx_destroy(&(a6xx_gpu->base.base));
- return ERR_PTR(ret);
+ return ERR_CAST(adreno_gpu->ubwc_config);
}
/* Set up the preemption specific bits and pieces for each ringbuffer */
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
index ec643b84646b..324319762383 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
@@ -236,12 +236,7 @@ struct adreno_gpu {
/* firmware: */
const struct firmware *fw[ADRENO_FW_MAX];
- /*
- * The migration to the central UBWC config db is still in flight - keep
- * a copy containing some local fixups until that's done.
- */
const struct qcom_ubwc_cfg_data *ubwc_config;
- struct qcom_ubwc_cfg_data _ubwc_config;
/*
* Register offsets are different between some GPUs.
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 05/28] drm/msm/adreno: use qcom_ubwc_version_tag() helper
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (3 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 04/28] drm/msm/adreno: Trust the SSoT UBWC config Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 06/28] drm/msm/mdss: " Dmitry Baryshkov
` (23 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Use new helper defined to program UBWC version to the hardware.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
index ccfccc45133f..1923f904d37d 100644
--- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
@@ -282,35 +282,33 @@ static void a8xx_set_ubwc_config(struct msm_gpu *gpu)
bool rgb565_predicator = false, amsbc = false;
bool ubwc_mode = qcom_ubwc_get_ubwc_mode(cfg);
u32 ubwc_version = cfg->ubwc_enc_version;
- u32 hbb, hbb_hi, hbb_lo, mode = 1;
+ u32 hbb, hbb_hi, hbb_lo, mode;
u8 uavflagprd_inv = 2;
switch (ubwc_version) {
case UBWC_6_0:
yuvnotcomptofc = true;
- mode = 5;
break;
case UBWC_5_0:
amsbc = true;
rgb565_predicator = true;
- mode = 4;
break;
case UBWC_4_0:
amsbc = true;
rgb565_predicator = true;
fp16compoptdis = true;
rgba8888_lossless = true;
- mode = 2;
break;
case UBWC_3_0:
amsbc = true;
- mode = 1;
break;
default:
dev_err(&gpu->pdev->dev, "Unknown UBWC version: 0x%x\n", ubwc_version);
break;
}
+ mode = qcom_ubwc_version_tag(cfg);
+
/*
* We subtract 13 from the highest bank bit (13 is the minimum value
* allowed by hw) and write the lowest two bits of the remaining value
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 06/28] drm/msm/mdss: use qcom_ubwc_version_tag() helper
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (4 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 05/28] drm/msm/adreno: use qcom_ubwc_version_tag() helper Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 07/28] drm/msm/adreno: use new helper to set min_acc length Dmitry Baryshkov
` (22 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Use new helper defined to program UBWC version to the hardware.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/msm_mdss.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c
index 4a6acd468bc8..229b47415f29 100644
--- a/drivers/gpu/drm/msm/msm_mdss.c
+++ b/drivers/gpu/drm/msm/msm_mdss.c
@@ -201,7 +201,7 @@ static void msm_mdss_6x_setup_ubwc(struct msm_mdss *msm_mdss)
const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data;
u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(data->ubwc_swizzle) |
MDSS_UBWC_STATIC_HIGHEST_BANK_BIT(data->highest_bank_bit - 13);
- u32 ver, prediction_mode;
+ u32 prediction_mode;
if (data->ubwc_bank_spread)
value |= MDSS_UBWC_STATIC_UBWC_BANK_SPREAD;
@@ -219,20 +219,8 @@ static void msm_mdss_6x_setup_ubwc(struct msm_mdss *msm_mdss)
else
prediction_mode = 1;
- if (data->ubwc_enc_version >= UBWC_6_0)
- ver = 5;
- else if (data->ubwc_enc_version >= UBWC_5_0)
- ver = 4;
- else if (data->ubwc_enc_version >= UBWC_4_3)
- ver = 3;
- else if (data->ubwc_enc_version >= UBWC_4_0)
- ver = 2;
- else if (data->ubwc_enc_version >= UBWC_3_0)
- ver = 1;
- else /* UBWC 1.0 and 2.0 */
- ver = 0;
-
- writel_relaxed(ver, msm_mdss->mmio + REG_MDSS_UBWC_CTRL_2);
+ writel_relaxed(qcom_ubwc_version_tag(data),
+ msm_mdss->mmio + REG_MDSS_UBWC_CTRL_2);
writel_relaxed(prediction_mode, msm_mdss->mmio + REG_MDSS_UBWC_PREDICTION_MODE);
}
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 07/28] drm/msm/adreno: use new helper to set min_acc length
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (5 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 06/28] drm/msm/mdss: " Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 08/28] drm/msm/mdss: " Dmitry Baryshkov
` (21 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Use freshly defined helper instead of hardcoding the checks in the
driver.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 90e814c64c6e..45c966610511 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -748,7 +748,7 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu)
u32 level2_swizzling_dis = !(cfg->ubwc_swizzle & UBWC_SWIZZLE_ENABLE_LVL2);
bool ubwc_mode = qcom_ubwc_get_ubwc_mode(cfg);
bool amsbc = cfg->ubwc_enc_version >= UBWC_3_0;
- bool min_acc_len_64b = false;
+ bool min_acc_len_64b;
u8 uavflagprd_inv = 0;
u32 hbb_hi = hbb >> 2;
u32 hbb_lo = hbb & 3;
@@ -756,8 +756,7 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu)
if (adreno_is_a650_family(adreno_gpu) || adreno_is_a7xx(adreno_gpu))
uavflagprd_inv = 2;
- if (adreno_is_a610(adreno_gpu) || adreno_is_a702(adreno_gpu))
- min_acc_len_64b = true;
+ min_acc_len_64b = qcom_ubwc_min_acc_length_64b(cfg);
gpu_write(gpu, REG_A6XX_RB_NC_MODE_CNTL,
level2_swizzling_dis << 12 |
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 08/28] drm/msm/mdss: use new helper to set min_acc length
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (6 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 07/28] drm/msm/adreno: use new helper to set min_acc length Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 09/28] drm/msm/adreno: use new helper to set macrotile_mode Dmitry Baryshkov
` (20 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Use freshly defined helper instead of hardcoding the checks in the
driver.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/msm_mdss.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c
index 229b47415f29..9f2b366d45fc 100644
--- a/drivers/gpu/drm/msm/msm_mdss.c
+++ b/drivers/gpu/drm/msm/msm_mdss.c
@@ -172,8 +172,7 @@ static void msm_mdss_4x_setup_ubwc(struct msm_mdss *msm_mdss)
u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(data->ubwc_swizzle & 0x1) |
MDSS_UBWC_STATIC_HIGHEST_BANK_BIT(data->highest_bank_bit - 13);
- if (data->ubwc_enc_version == UBWC_1_0)
- value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN(1);
+ value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN(qcom_ubwc_min_acc_length_64b(data));
writel_relaxed(value, msm_mdss->mmio + REG_MDSS_UBWC_STATIC);
}
@@ -190,8 +189,7 @@ static void msm_mdss_5x_setup_ubwc(struct msm_mdss *msm_mdss)
if (data->ubwc_enc_version == UBWC_3_0)
value |= MDSS_UBWC_STATIC_UBWC_AMSBC;
- if (data->ubwc_enc_version == UBWC_1_0)
- value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN(1);
+ value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN(qcom_ubwc_min_acc_length_64b(data));
writel_relaxed(value, msm_mdss->mmio + REG_MDSS_UBWC_STATIC);
}
@@ -209,8 +207,7 @@ static void msm_mdss_6x_setup_ubwc(struct msm_mdss *msm_mdss)
if (data->macrotile_mode)
value |= MDSS_UBWC_STATIC_MACROTILE_MODE;
- if (data->ubwc_enc_version == UBWC_1_0)
- value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN(1);
+ value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN(qcom_ubwc_min_acc_length_64b(data));
writel_relaxed(value, msm_mdss->mmio + REG_MDSS_UBWC_STATIC);
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 09/28] drm/msm/adreno: use new helper to set macrotile_mode
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (7 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 08/28] drm/msm/mdss: " Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 10/28] drm/msm/mdss: " Dmitry Baryshkov
` (19 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Use freshly defined helper instead of using the raw value from the
database.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +-
drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 45c966610511..43818d1907ab 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -791,7 +791,7 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu)
min_acc_len_64b << 23 | hbb_lo << 21);
gpu_write(gpu, REG_A6XX_RBBM_NC_MODE_CNTL,
- cfg->macrotile_mode);
+ qcom_ubwc_macrotile_mode(cfg));
}
static void a7xx_patch_pwrup_reglist(struct msm_gpu *gpu)
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 03f96a1154e1..78d7ac3fd8c7 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -439,7 +439,7 @@ int adreno_get_param(struct msm_gpu *gpu, struct msm_context *ctx,
case MSM_PARAM_MACROTILE_MODE:
if (!adreno_gpu->ubwc_config)
return UERR(ENOENT, drm, "no UBWC on this platform");
- *value = adreno_gpu->ubwc_config->macrotile_mode;
+ *value = qcom_ubwc_macrotile_mode(adreno_gpu->ubwc_config);
return 0;
case MSM_PARAM_UCHE_TRAP_BASE:
*value = adreno_gpu->uche_trap_base;
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 10/28] drm/msm/mdss: use new helper to set macrotile_mode
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (8 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 09/28] drm/msm/adreno: use new helper to set macrotile_mode Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 11/28] drm/msm/mdss: use new helper to set UBWC bank spreading Dmitry Baryshkov
` (18 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Use freshly defined helper instead of using the raw value from the
database.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/msm_mdss.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c
index 9f2b366d45fc..2742d4bb2a4d 100644
--- a/drivers/gpu/drm/msm/msm_mdss.c
+++ b/drivers/gpu/drm/msm/msm_mdss.c
@@ -183,7 +183,7 @@ static void msm_mdss_5x_setup_ubwc(struct msm_mdss *msm_mdss)
u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(data->ubwc_swizzle & 0x1) |
MDSS_UBWC_STATIC_HIGHEST_BANK_BIT(data->highest_bank_bit - 13);
- if (data->macrotile_mode)
+ if (qcom_ubwc_macrotile_mode(data))
value |= MDSS_UBWC_STATIC_MACROTILE_MODE;
if (data->ubwc_enc_version == UBWC_3_0)
@@ -204,7 +204,7 @@ static void msm_mdss_6x_setup_ubwc(struct msm_mdss *msm_mdss)
if (data->ubwc_bank_spread)
value |= MDSS_UBWC_STATIC_UBWC_BANK_SPREAD;
- if (data->macrotile_mode)
+ if (qcom_ubwc_macrotile_mode(data))
value |= MDSS_UBWC_STATIC_MACROTILE_MODE;
value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN(qcom_ubwc_min_acc_length_64b(data));
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 11/28] drm/msm/mdss: use new helper to set UBWC bank spreading
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (9 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 10/28] drm/msm/mdss: " Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 12/28] drm/msm/adreno: use new helper to set ubwc_swizzle Dmitry Baryshkov
` (17 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Use freshly defined helper instead of hardcoding the checks in the
driver.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/msm_mdss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c
index 2742d4bb2a4d..bf106d849dea 100644
--- a/drivers/gpu/drm/msm/msm_mdss.c
+++ b/drivers/gpu/drm/msm/msm_mdss.c
@@ -201,7 +201,7 @@ static void msm_mdss_6x_setup_ubwc(struct msm_mdss *msm_mdss)
MDSS_UBWC_STATIC_HIGHEST_BANK_BIT(data->highest_bank_bit - 13);
u32 prediction_mode;
- if (data->ubwc_bank_spread)
+ if (qcom_ubwc_bank_spread(data))
value |= MDSS_UBWC_STATIC_UBWC_BANK_SPREAD;
if (qcom_ubwc_macrotile_mode(data))
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 12/28] drm/msm/adreno: use new helper to set ubwc_swizzle
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (10 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 11/28] drm/msm/mdss: use new helper to set UBWC bank spreading Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 13/28] drm/msm/dpu: " Dmitry Baryshkov
` (16 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Use freshly defined helper instead of using the raw value from the
database.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
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 | 4 ++--
drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +-
3 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 43818d1907ab..e7a0d315e022 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -745,7 +745,7 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu)
BUG_ON(cfg->highest_bank_bit < 13);
u32 hbb = cfg->highest_bank_bit - 13;
bool rgb565_predicator = cfg->ubwc_enc_version >= UBWC_4_0;
- u32 level2_swizzling_dis = !(cfg->ubwc_swizzle & UBWC_SWIZZLE_ENABLE_LVL2);
+ 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 min_acc_len_64b;
diff --git a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
index 1923f904d37d..53def136e0fc 100644
--- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
@@ -275,8 +275,8 @@ static void a8xx_set_ubwc_config(struct msm_gpu *gpu)
{
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
const struct qcom_ubwc_cfg_data *cfg = adreno_gpu->ubwc_config;
- u32 level2_swizzling_dis = !(cfg->ubwc_swizzle & UBWC_SWIZZLE_ENABLE_LVL2);
- u32 level3_swizzling_dis = !(cfg->ubwc_swizzle & UBWC_SWIZZLE_ENABLE_LVL3);
+ u32 level2_swizzling_dis = !(qcom_ubwc_swizzle(cfg) & UBWC_SWIZZLE_ENABLE_LVL2);
+ u32 level3_swizzling_dis = !(qcom_ubwc_swizzle(cfg) & UBWC_SWIZZLE_ENABLE_LVL3);
bool rgba8888_lossless = false, fp16compoptdis = false;
bool yuvnotcomptofc = false, min_acc_len_64b = false;
bool rgb565_predicator = false, amsbc = false;
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 78d7ac3fd8c7..6a0877e5374c 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -434,7 +434,7 @@ int adreno_get_param(struct msm_gpu *gpu, struct msm_context *ctx,
case MSM_PARAM_UBWC_SWIZZLE:
if (!adreno_gpu->ubwc_config)
return UERR(ENOENT, drm, "no UBWC on this platform");
- *value = adreno_gpu->ubwc_config->ubwc_swizzle;
+ *value = qcom_ubwc_swizzle(adreno_gpu->ubwc_config);
return 0;
case MSM_PARAM_MACROTILE_MODE:
if (!adreno_gpu->ubwc_config)
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 13/28] drm/msm/dpu: use new helper to set ubwc_swizzle
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (11 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 12/28] drm/msm/adreno: use new helper to set ubwc_swizzle Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 14/28] drm/msm/mdss: " Dmitry Baryshkov
` (15 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Use freshly defined helper instead of using the raw value from the
database.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
index d3da70009234..6089a58074ac 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
@@ -318,13 +318,14 @@ void dpu_hw_setup_format_impl(struct dpu_sw_pipe *pipe, const struct msm_format
if (ctx->ubwc->ubwc_enc_version == UBWC_1_0) {
fast_clear = fmt->alpha_enable ? BIT(31) : 0;
- ctrl_val = fast_clear | (ctx->ubwc->ubwc_swizzle & 0x1) |
+ ctrl_val = fast_clear |
+ (qcom_ubwc_swizzle(ctx->ubwc) & UBWC_SWIZZLE_ENABLE_LVL1) |
BIT(8) | (hbb << 4);
} else if (ctx->ubwc->ubwc_enc_version == UBWC_2_0) {
fast_clear = fmt->alpha_enable ? BIT(31) : 0;
- ctrl_val = fast_clear | ctx->ubwc->ubwc_swizzle | (hbb << 4);
+ ctrl_val = fast_clear | qcom_ubwc_swizzle(ctx->ubwc) | (hbb << 4);
} else if (ctx->ubwc->ubwc_enc_version == UBWC_3_0) {
- ctrl_val = BIT(30) | (ctx->ubwc->ubwc_swizzle) | (hbb << 4);
+ ctrl_val = BIT(30) | qcom_ubwc_swizzle(ctx->ubwc) | (hbb << 4);
} else if (ctx->ubwc->ubwc_enc_version == UBWC_4_0) {
ctrl_val = MSM_FORMAT_IS_YUV(fmt) ? 0 : BIT(30);
} else if (ctx->ubwc->ubwc_enc_version <= UBWC_6_0) {
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 14/28] drm/msm/mdss: use new helper to set ubwc_swizzle
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (12 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 13/28] drm/msm/dpu: " Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 15/28] drm/msm/adreno: write reserved UBWC-related bits Dmitry Baryshkov
` (14 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Use freshly defined helper instead of using the raw value from the
database.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/msm_mdss.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c
index bf106d849dea..3c1f04f12c3d 100644
--- a/drivers/gpu/drm/msm/msm_mdss.c
+++ b/drivers/gpu/drm/msm/msm_mdss.c
@@ -169,7 +169,8 @@ static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss)
static void msm_mdss_4x_setup_ubwc(struct msm_mdss *msm_mdss)
{
const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data;
- u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(data->ubwc_swizzle & 0x1) |
+ u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(qcom_ubwc_swizzle(data) &
+ UBWC_SWIZZLE_ENABLE_LVL1) |
MDSS_UBWC_STATIC_HIGHEST_BANK_BIT(data->highest_bank_bit - 13);
value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN(qcom_ubwc_min_acc_length_64b(data));
@@ -180,7 +181,8 @@ static void msm_mdss_4x_setup_ubwc(struct msm_mdss *msm_mdss)
static void msm_mdss_5x_setup_ubwc(struct msm_mdss *msm_mdss)
{
const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data;
- u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(data->ubwc_swizzle & 0x1) |
+ u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(qcom_ubwc_swizzle(data) &
+ UBWC_SWIZZLE_ENABLE_LVL1) |
MDSS_UBWC_STATIC_HIGHEST_BANK_BIT(data->highest_bank_bit - 13);
if (qcom_ubwc_macrotile_mode(data))
@@ -197,7 +199,7 @@ static void msm_mdss_5x_setup_ubwc(struct msm_mdss *msm_mdss)
static void msm_mdss_6x_setup_ubwc(struct msm_mdss *msm_mdss)
{
const struct qcom_ubwc_cfg_data *data = msm_mdss->mdss_data;
- u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(data->ubwc_swizzle) |
+ u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(qcom_ubwc_swizzle(data)) |
MDSS_UBWC_STATIC_HIGHEST_BANK_BIT(data->highest_bank_bit - 13);
u32 prediction_mode;
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 15/28] drm/msm/adreno: write reserved UBWC-related bits
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (13 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 14/28] drm/msm/mdss: " Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 16/28] drm/msm/adreno: set fp16compoptdis for UBWC 3.0 formats Dmitry Baryshkov
` (13 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel
On the latest A8xx Adreno chips several of the bits in the UBWC-related
registers are now hardwired to 1. Currently the driver doesn't write
them because there is no side-effect. In the preparation for the
refactoring in the next patch, write '1' to those bits anyway.
Reviewed-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
index 53def136e0fc..7a6223ddd8cf 100644
--- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
@@ -288,6 +288,8 @@ static void a8xx_set_ubwc_config(struct msm_gpu *gpu)
switch (ubwc_version) {
case UBWC_6_0:
yuvnotcomptofc = true;
+ amsbc = true;
+ rgb565_predicator = true;
break;
case UBWC_5_0:
amsbc = true;
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 16/28] drm/msm/adreno: set fp16compoptdis for UBWC 3.0 formats
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (14 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 15/28] drm/msm/adreno: write reserved UBWC-related bits Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 17/28] drm/msm/adreno: use new helper to set amsbc Dmitry Baryshkov
` (12 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel
The fp16compoptdis bit should be set if the system targets UBWC 3.0
format in addition to UBWC 4.0.
Reviewed-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
index 7a6223ddd8cf..867c7d05f670 100644
--- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
@@ -303,6 +303,7 @@ static void a8xx_set_ubwc_config(struct msm_gpu *gpu)
break;
case UBWC_3_0:
amsbc = true;
+ fp16compoptdis = true;
break;
default:
dev_err(&gpu->pdev->dev, "Unknown UBWC version: 0x%x\n", ubwc_version);
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 17/28] drm/msm/adreno: use new helper to set amsbc
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (15 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 16/28] drm/msm/adreno: set fp16compoptdis for UBWC 3.0 formats Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 18/28] drm/msm/adreno: use version ranges in A8xx UBWC code Dmitry Baryshkov
` (11 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Use freshly defined helper instead of checking the UBWC version
directly.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
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 | 7 ++-----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index e7a0d315e022..1c5ad3e83cc2 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -747,7 +747,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 867c7d05f670..5c73a9ebb22b 100644
--- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
@@ -279,7 +279,8 @@ static void a8xx_set_ubwc_config(struct msm_gpu *gpu)
u32 level3_swizzling_dis = !(qcom_ubwc_swizzle(cfg) & UBWC_SWIZZLE_ENABLE_LVL3);
bool rgba8888_lossless = false, fp16compoptdis = false;
bool yuvnotcomptofc = false, min_acc_len_64b = false;
- bool rgb565_predicator = false, amsbc = false;
+ bool rgb565_predicator = false;
+ bool amsbc = qcom_ubwc_enable_amsbc(cfg);
bool ubwc_mode = qcom_ubwc_get_ubwc_mode(cfg);
u32 ubwc_version = cfg->ubwc_enc_version;
u32 hbb, hbb_hi, hbb_lo, mode;
@@ -288,21 +289,17 @@ static void a8xx_set_ubwc_config(struct msm_gpu *gpu)
switch (ubwc_version) {
case UBWC_6_0:
yuvnotcomptofc = true;
- amsbc = true;
rgb565_predicator = 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;
fp16compoptdis = true;
break;
default:
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 18/28] drm/msm/adreno: use version ranges in A8xx UBWC code
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (16 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 17/28] drm/msm/adreno: use new helper to set amsbc Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 19/28] drm/msm/mdss: use new helper to set amsbc Dmitry Baryshkov
` (10 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel
In order to simplify handling of UBWC minor revisions (like 3.1 or 4.3)
use version ranges instead of a case switch.
Reviewed-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 32 +++++++++++++++-----------------
1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
index 5c73a9ebb22b..29d559fe4683 100644
--- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
@@ -286,26 +286,24 @@ static void a8xx_set_ubwc_config(struct msm_gpu *gpu)
u32 hbb, hbb_hi, hbb_lo, mode;
u8 uavflagprd_inv = 2;
- switch (ubwc_version) {
- case UBWC_6_0:
+ if (ubwc_version > UBWC_6_0)
+ dev_err(&gpu->pdev->dev, "Unknown UBWC version: 0x%x\n", ubwc_version);
+
+ if (ubwc_version == UBWC_6_0)
yuvnotcomptofc = true;
- rgb565_predicator = true;
- break;
- case UBWC_5_0:
- rgb565_predicator = true;
- break;
- case UBWC_4_0:
- rgb565_predicator = true;
- fp16compoptdis = true;
+
+ if (ubwc_version < UBWC_5_0 &&
+ ubwc_version >= UBWC_4_0)
rgba8888_lossless = true;
- break;
- case UBWC_3_0:
+
+ if (ubwc_version < UBWC_4_3)
fp16compoptdis = true;
- break;
- default:
- dev_err(&gpu->pdev->dev, "Unknown UBWC version: 0x%x\n", ubwc_version);
- break;
- }
+
+ if (cfg->ubwc_enc_version >= UBWC_4_0)
+ rgb565_predicator = true;
+
+ if (ubwc_version < UBWC_3_0)
+ dev_err(&gpu->pdev->dev, "Unsupported UBWC version: 0x%x\n", ubwc_version);
mode = qcom_ubwc_version_tag(cfg);
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 19/28] drm/msm/mdss: use new helper to set amsbc
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (17 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 18/28] drm/msm/adreno: use version ranges in A8xx UBWC code Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 20/28] drm/msm/dpu: drop ubwc_dec_version Dmitry Baryshkov
` (9 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Use freshly defined helper instead of checking the UBWC version
directly.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/msm_mdss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c
index 3c1f04f12c3d..4b230868ed90 100644
--- a/drivers/gpu/drm/msm/msm_mdss.c
+++ b/drivers/gpu/drm/msm/msm_mdss.c
@@ -188,7 +188,7 @@ static void msm_mdss_5x_setup_ubwc(struct msm_mdss *msm_mdss)
if (qcom_ubwc_macrotile_mode(data))
value |= MDSS_UBWC_STATIC_MACROTILE_MODE;
- if (data->ubwc_enc_version == UBWC_3_0)
+ if (qcom_ubwc_enable_amsbc(data))
value |= MDSS_UBWC_STATIC_UBWC_AMSBC;
value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN(qcom_ubwc_min_acc_length_64b(data));
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 20/28] drm/msm/dpu: drop ubwc_dec_version
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (18 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 19/28] drm/msm/mdss: use new helper to set amsbc Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 21/28] drm/msm/dpu: invert the order of UBWC checks Dmitry Baryshkov
` (8 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Stop using ubwc_dec_version (the version of the UBWC block in the
display subsystem) for detecting the enablement of the UBWC. Use only
ubwc_enc_version, the version of the UBWC which we are setting up for.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index 5642f3bc3568..7b92082d35a6 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -1781,8 +1781,7 @@ static bool dpu_plane_format_mod_supported(struct drm_plane *plane,
uint32_t format, uint64_t modifier)
{
struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
- bool has_no_ubwc = (dpu_kms->mdss->ubwc_enc_version == 0) &&
- (dpu_kms->mdss->ubwc_dec_version == 0);
+ bool has_no_ubwc = (dpu_kms->mdss->ubwc_enc_version == 0);
if (modifier == DRM_FORMAT_MOD_LINEAR)
return true;
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 21/28] drm/msm/dpu: invert the order of UBWC checks
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (19 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 20/28] drm/msm/dpu: drop ubwc_dec_version Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 22/28] soc: qcom: ubwc: set min_acc length to 64 for all UBWC 1.0 targets Dmitry Baryshkov
` (7 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Unlike other drivers, the DPU driver checks for exact UBWC version,
making it hard to add minor versions if necessary. Invert the order of
UBWC checks, letting the DPU driver handle new minors transparently.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 36 ++++++++++++++---------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
index 6089a58074ac..b5e50fc1916f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c
@@ -310,35 +310,35 @@ void dpu_hw_setup_format_impl(struct dpu_sw_pipe *pipe, const struct msm_format
if (fmt->fetch_mode != MDP_FETCH_LINEAR) {
u32 hbb = ctx->ubwc->highest_bank_bit - 13;
- u32 ctrl_val;
+ u32 ctrl_val = 0;
if (MSM_FORMAT_IS_UBWC(fmt))
opmode |= MDSS_MDP_OP_BWC_EN;
src_format |= (fmt->fetch_mode & 3) << 30; /*FRAME_FORMAT */
- if (ctx->ubwc->ubwc_enc_version == UBWC_1_0) {
+ if (ctx->ubwc->ubwc_enc_version > UBWC_6_0) {
+ DRM_WARN_ONCE("Unsupported UBWC version %x\n", ctx->ubwc->ubwc_enc_version);
+ } else if (ctx->ubwc->ubwc_enc_version >= UBWC_5_0) {
+ if (!MSM_FORMAT_IS_YUV(fmt)) {
+ ctrl_val = BIT(30);
+ if (!MSM_FORMAT_IS_DX(fmt)) /* and not FP16, but it's unsupported */
+ ctrl_val |= BIT(31);
+ }
+ /* SDE also sets bits for lossy formats, but we don't support them yet */
+ } else if (ctx->ubwc->ubwc_enc_version >= UBWC_4_0) {
+ ctrl_val = MSM_FORMAT_IS_YUV(fmt) ? 0 : BIT(30);
+ } else if (ctx->ubwc->ubwc_enc_version >= UBWC_3_0) {
+ ctrl_val = BIT(30) | qcom_ubwc_swizzle(ctx->ubwc) | (hbb << 4);
+ } else if (ctx->ubwc->ubwc_enc_version >= UBWC_2_0) {
+ fast_clear = fmt->alpha_enable ? BIT(31) : 0;
+ ctrl_val = fast_clear | qcom_ubwc_swizzle(ctx->ubwc) | (hbb << 4);
+ } else if (ctx->ubwc->ubwc_enc_version >= UBWC_1_0) {
fast_clear = fmt->alpha_enable ? BIT(31) : 0;
ctrl_val = fast_clear |
(qcom_ubwc_swizzle(ctx->ubwc) & UBWC_SWIZZLE_ENABLE_LVL1) |
BIT(8) | (hbb << 4);
- } else if (ctx->ubwc->ubwc_enc_version == UBWC_2_0) {
- fast_clear = fmt->alpha_enable ? BIT(31) : 0;
- ctrl_val = fast_clear | qcom_ubwc_swizzle(ctx->ubwc) | (hbb << 4);
- } else if (ctx->ubwc->ubwc_enc_version == UBWC_3_0) {
- ctrl_val = BIT(30) | qcom_ubwc_swizzle(ctx->ubwc) | (hbb << 4);
- } else if (ctx->ubwc->ubwc_enc_version == UBWC_4_0) {
- ctrl_val = MSM_FORMAT_IS_YUV(fmt) ? 0 : BIT(30);
- } else if (ctx->ubwc->ubwc_enc_version <= UBWC_6_0) {
- if (MSM_FORMAT_IS_YUV(fmt))
- ctrl_val = 0;
- else if (MSM_FORMAT_IS_DX(fmt)) /* or FP16, but it's unsupported */
- ctrl_val = BIT(30);
- else
- ctrl_val = BIT(30) | BIT(31);
- /* SDE also sets bits for lossy formats, but we don't support them yet */
} else {
DRM_WARN_ONCE("Unsupported UBWC version %x\n", ctx->ubwc->ubwc_enc_version);
- ctrl_val = 0;
}
DPU_REG_WRITE(c, ubwc_ctrl_off, ctrl_val);
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 22/28] soc: qcom: ubwc: set min_acc length to 64 for all UBWC 1.0 targets
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (20 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 21/28] drm/msm/dpu: invert the order of UBWC checks Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 23/28] soc: qcom: ubwc: drop ubwc_dec_version Dmitry Baryshkov
` (6 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
According to the documentation, the MAL should be set for all UBWC 1.0
targets, no matter what is the version of the UBWC decoders are present
on the device. The helper comes from DPU / GPU world, where there was no
separate bit to control MAL before UBWC 2.0. As the helper is now being
used by other drivers too, correct the helper to return the correct MAL
value (Iris doesn't support UBWC 1.0 devices for now, so there is no
changes of the behaviour).
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
include/linux/soc/qcom/ubwc.h | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h
index 83d2c2a7116c..0b5aa9d0343b 100644
--- a/include/linux/soc/qcom/ubwc.h
+++ b/include/linux/soc/qcom/ubwc.h
@@ -75,14 +75,9 @@ 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);
+ return cfg->ubwc_enc_version == UBWC_1_0;
}
static inline bool qcom_ubwc_macrotile_mode(const struct qcom_ubwc_cfg_data *cfg)
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 23/28] soc: qcom: ubwc: drop ubwc_dec_version
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (21 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 22/28] soc: qcom: ubwc: set min_acc length to 64 for all UBWC 1.0 targets Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 24/28] soc: qcom: ubwc: drop ubwc_bank_spread Dmitry Baryshkov
` (5 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
The ubwc_dec_version field has been inherited from the MDSS driver and
it is equal to the version of the UBWC decoder in the display block
only. Other IP Cores can have different UBWC decoders and so the version
would vary between blocks.
As the value is no longer used as is not relevant to other UBWC database
consumers, drop it from the UBWC database.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/soc/qcom/ubwc_config.c | 23 -----------------------
include/linux/soc/qcom/ubwc.h | 2 --
2 files changed, 25 deletions(-)
diff --git a/drivers/soc/qcom/ubwc_config.c b/drivers/soc/qcom/ubwc_config.c
index 3fe47d8f0f63..1344cda0fb75 100644
--- a/drivers/soc/qcom/ubwc_config.c
+++ b/drivers/soc/qcom/ubwc_config.c
@@ -18,7 +18,6 @@ static const struct qcom_ubwc_cfg_data no_ubwc_data = {
static const struct qcom_ubwc_cfg_data eliza_data = {
.ubwc_enc_version = UBWC_5_0,
- .ubwc_dec_version = UBWC_5_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.ubwc_bank_spread = true,
@@ -29,7 +28,6 @@ static const struct qcom_ubwc_cfg_data eliza_data = {
static const struct qcom_ubwc_cfg_data kaanapali_data = {
.ubwc_enc_version = UBWC_6_0,
- .ubwc_dec_version = UBWC_6_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.ubwc_bank_spread = true,
@@ -39,7 +37,6 @@ static const struct qcom_ubwc_cfg_data kaanapali_data = {
static const struct qcom_ubwc_cfg_data msm8937_data = {
.ubwc_enc_version = UBWC_1_0,
- .ubwc_dec_version = UBWC_1_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL1 |
UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
@@ -48,7 +45,6 @@ static const struct qcom_ubwc_cfg_data msm8937_data = {
static const struct qcom_ubwc_cfg_data msm8998_data = {
.ubwc_enc_version = UBWC_1_0,
- .ubwc_dec_version = UBWC_1_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL1 |
UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
@@ -62,7 +58,6 @@ static const struct qcom_ubwc_cfg_data qcm2290_data = {
static const struct qcom_ubwc_cfg_data sa8775p_data = {
.ubwc_enc_version = UBWC_4_0,
- .ubwc_dec_version = UBWC_4_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL3,
.ubwc_bank_spread = true,
.highest_bank_bit = 13,
@@ -71,7 +66,6 @@ static const struct qcom_ubwc_cfg_data sa8775p_data = {
static const struct qcom_ubwc_cfg_data sar2130p_data = {
.ubwc_enc_version = UBWC_3_0, /* 4.0.2 in hw */
- .ubwc_dec_version = UBWC_4_3,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.ubwc_bank_spread = true,
@@ -81,7 +75,6 @@ static const struct qcom_ubwc_cfg_data sar2130p_data = {
static const struct qcom_ubwc_cfg_data sc7180_data = {
.ubwc_enc_version = UBWC_2_0,
- .ubwc_dec_version = UBWC_2_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.ubwc_bank_spread = true,
@@ -90,7 +83,6 @@ static const struct qcom_ubwc_cfg_data sc7180_data = {
static const struct qcom_ubwc_cfg_data sc7280_data = {
.ubwc_enc_version = UBWC_3_0,
- .ubwc_dec_version = UBWC_4_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.ubwc_bank_spread = true,
@@ -100,7 +92,6 @@ static const struct qcom_ubwc_cfg_data sc7280_data = {
static const struct qcom_ubwc_cfg_data sc8180x_data = {
.ubwc_enc_version = UBWC_3_0,
- .ubwc_dec_version = UBWC_3_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 16,
@@ -109,7 +100,6 @@ static const struct qcom_ubwc_cfg_data sc8180x_data = {
static const struct qcom_ubwc_cfg_data sc8280xp_data = {
.ubwc_enc_version = UBWC_4_0,
- .ubwc_dec_version = UBWC_4_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.ubwc_bank_spread = true,
@@ -119,7 +109,6 @@ static const struct qcom_ubwc_cfg_data sc8280xp_data = {
static const struct qcom_ubwc_cfg_data sdm670_data = {
.ubwc_enc_version = UBWC_2_0,
- .ubwc_dec_version = UBWC_2_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 14,
@@ -127,7 +116,6 @@ static const struct qcom_ubwc_cfg_data sdm670_data = {
static const struct qcom_ubwc_cfg_data sdm845_data = {
.ubwc_enc_version = UBWC_2_0,
- .ubwc_dec_version = UBWC_2_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 15,
@@ -135,7 +123,6 @@ static const struct qcom_ubwc_cfg_data sdm845_data = {
static const struct qcom_ubwc_cfg_data sm6115_data = {
.ubwc_enc_version = UBWC_1_0,
- .ubwc_dec_version = UBWC_2_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL1 |
UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
@@ -145,7 +132,6 @@ static const struct qcom_ubwc_cfg_data sm6115_data = {
static const struct qcom_ubwc_cfg_data sm6125_data = {
.ubwc_enc_version = UBWC_1_0,
- .ubwc_dec_version = UBWC_3_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL1 |
UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
@@ -154,7 +140,6 @@ static const struct qcom_ubwc_cfg_data sm6125_data = {
static const struct qcom_ubwc_cfg_data sm6150_data = {
.ubwc_enc_version = UBWC_2_0,
- .ubwc_dec_version = UBWC_2_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 14,
@@ -162,7 +147,6 @@ static const struct qcom_ubwc_cfg_data sm6150_data = {
static const struct qcom_ubwc_cfg_data sm6350_data = {
.ubwc_enc_version = UBWC_2_0,
- .ubwc_dec_version = UBWC_2_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.ubwc_bank_spread = true,
@@ -171,7 +155,6 @@ static const struct qcom_ubwc_cfg_data sm6350_data = {
static const struct qcom_ubwc_cfg_data sm7150_data = {
.ubwc_enc_version = UBWC_2_0,
- .ubwc_dec_version = UBWC_2_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 14,
@@ -179,7 +162,6 @@ static const struct qcom_ubwc_cfg_data sm7150_data = {
static const struct qcom_ubwc_cfg_data sm8150_data = {
.ubwc_enc_version = UBWC_3_0,
- .ubwc_dec_version = UBWC_3_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 15,
@@ -187,7 +169,6 @@ static const struct qcom_ubwc_cfg_data sm8150_data = {
static const struct qcom_ubwc_cfg_data sm8250_data = {
.ubwc_enc_version = UBWC_4_0,
- .ubwc_dec_version = UBWC_4_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.ubwc_bank_spread = true,
@@ -198,7 +179,6 @@ static const struct qcom_ubwc_cfg_data sm8250_data = {
static const struct qcom_ubwc_cfg_data sm8350_data = {
.ubwc_enc_version = UBWC_4_0,
- .ubwc_dec_version = UBWC_4_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.ubwc_bank_spread = true,
@@ -209,7 +189,6 @@ static const struct qcom_ubwc_cfg_data sm8350_data = {
static const struct qcom_ubwc_cfg_data sm8550_data = {
.ubwc_enc_version = UBWC_4_0,
- .ubwc_dec_version = UBWC_4_3,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.ubwc_bank_spread = true,
@@ -220,7 +199,6 @@ static const struct qcom_ubwc_cfg_data sm8550_data = {
static const struct qcom_ubwc_cfg_data sm8750_data = {
.ubwc_enc_version = UBWC_5_0,
- .ubwc_dec_version = UBWC_5_0,
.ubwc_swizzle = 6,
.ubwc_bank_spread = true,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
@@ -230,7 +208,6 @@ static const struct qcom_ubwc_cfg_data sm8750_data = {
static const struct qcom_ubwc_cfg_data glymur_data = {
.ubwc_enc_version = UBWC_5_0,
- .ubwc_dec_version = UBWC_5_0,
.ubwc_swizzle = 0,
.ubwc_bank_spread = true,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h
index 0b5aa9d0343b..c3f9efae5db8 100644
--- a/include/linux/soc/qcom/ubwc.h
+++ b/include/linux/soc/qcom/ubwc.h
@@ -13,8 +13,6 @@
struct qcom_ubwc_cfg_data {
u32 ubwc_enc_version;
- /* Can be read from MDSS_BASE + 0x58 */
- u32 ubwc_dec_version;
/**
* @ubwc_swizzle: Whether to enable level 1, 2 & 3 bank swizzling.
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 24/28] soc: qcom: ubwc: drop ubwc_bank_spread
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (22 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 23/28] soc: qcom: ubwc: drop ubwc_dec_version Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 25/28] soc: qcom: ubwc: drop macrotile_mode from the database Dmitry Baryshkov
` (4 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
According to the documentation, UBWC bank spreading should be enabled
for all targets. It's just not all targets have separate bit to control
it. Drop the bit from the database and make the helper always return
true. If we need to change it later, the helper can be adjusted
according to the programming guides.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/soc/qcom/ubwc_config.c | 14 --------------
include/linux/soc/qcom/ubwc.h | 3 +--
2 files changed, 1 insertion(+), 16 deletions(-)
diff --git a/drivers/soc/qcom/ubwc_config.c b/drivers/soc/qcom/ubwc_config.c
index 1344cda0fb75..35cde4e9a238 100644
--- a/drivers/soc/qcom/ubwc_config.c
+++ b/drivers/soc/qcom/ubwc_config.c
@@ -20,7 +20,6 @@ static const struct qcom_ubwc_cfg_data eliza_data = {
.ubwc_enc_version = UBWC_5_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
- .ubwc_bank_spread = true,
/* TODO: highest_bank_bit = 14 for LP_DDR4 */
.highest_bank_bit = 15,
.macrotile_mode = true,
@@ -30,7 +29,6 @@ static const struct qcom_ubwc_cfg_data kaanapali_data = {
.ubwc_enc_version = UBWC_6_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
- .ubwc_bank_spread = true,
.highest_bank_bit = 16,
.macrotile_mode = true,
};
@@ -59,7 +57,6 @@ static const struct qcom_ubwc_cfg_data qcm2290_data = {
static const struct qcom_ubwc_cfg_data sa8775p_data = {
.ubwc_enc_version = UBWC_4_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL3,
- .ubwc_bank_spread = true,
.highest_bank_bit = 13,
.macrotile_mode = true,
};
@@ -68,7 +65,6 @@ static const struct qcom_ubwc_cfg_data sar2130p_data = {
.ubwc_enc_version = UBWC_3_0, /* 4.0.2 in hw */
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
- .ubwc_bank_spread = true,
.highest_bank_bit = 13,
.macrotile_mode = true,
};
@@ -77,7 +73,6 @@ static const struct qcom_ubwc_cfg_data sc7180_data = {
.ubwc_enc_version = UBWC_2_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
- .ubwc_bank_spread = true,
.highest_bank_bit = 14,
};
@@ -85,7 +80,6 @@ static const struct qcom_ubwc_cfg_data sc7280_data = {
.ubwc_enc_version = UBWC_3_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
- .ubwc_bank_spread = true,
.highest_bank_bit = 14,
.macrotile_mode = true,
};
@@ -102,7 +96,6 @@ static const struct qcom_ubwc_cfg_data sc8280xp_data = {
.ubwc_enc_version = UBWC_4_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
- .ubwc_bank_spread = true,
.highest_bank_bit = 16,
.macrotile_mode = true,
};
@@ -126,7 +119,6 @@ static const struct qcom_ubwc_cfg_data sm6115_data = {
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL1 |
UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
- .ubwc_bank_spread = true,
.highest_bank_bit = 14,
};
@@ -149,7 +141,6 @@ static const struct qcom_ubwc_cfg_data sm6350_data = {
.ubwc_enc_version = UBWC_2_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
- .ubwc_bank_spread = true,
.highest_bank_bit = 14,
};
@@ -171,7 +162,6 @@ static const struct qcom_ubwc_cfg_data sm8250_data = {
.ubwc_enc_version = UBWC_4_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
- .ubwc_bank_spread = true,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
.highest_bank_bit = 16,
.macrotile_mode = true,
@@ -181,7 +171,6 @@ static const struct qcom_ubwc_cfg_data sm8350_data = {
.ubwc_enc_version = UBWC_4_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
- .ubwc_bank_spread = true,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
.highest_bank_bit = 16,
.macrotile_mode = true,
@@ -191,7 +180,6 @@ static const struct qcom_ubwc_cfg_data sm8550_data = {
.ubwc_enc_version = UBWC_4_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
- .ubwc_bank_spread = true,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
.highest_bank_bit = 16,
.macrotile_mode = true,
@@ -200,7 +188,6 @@ static const struct qcom_ubwc_cfg_data sm8550_data = {
static const struct qcom_ubwc_cfg_data sm8750_data = {
.ubwc_enc_version = UBWC_5_0,
.ubwc_swizzle = 6,
- .ubwc_bank_spread = true,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
.highest_bank_bit = 16,
.macrotile_mode = true,
@@ -209,7 +196,6 @@ static const struct qcom_ubwc_cfg_data sm8750_data = {
static const struct qcom_ubwc_cfg_data glymur_data = {
.ubwc_enc_version = UBWC_5_0,
.ubwc_swizzle = 0,
- .ubwc_bank_spread = true,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
.highest_bank_bit = 16,
.macrotile_mode = true,
diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h
index c3f9efae5db8..254721f5ea3c 100644
--- a/include/linux/soc/qcom/ubwc.h
+++ b/include/linux/soc/qcom/ubwc.h
@@ -33,7 +33,6 @@ struct qcom_ubwc_cfg_data {
* DDR bank. This should ideally use DRAM type detection.
*/
int highest_bank_bit;
- bool ubwc_bank_spread;
/**
* @macrotile_mode: Macrotile Mode
@@ -85,7 +84,7 @@ static inline bool qcom_ubwc_macrotile_mode(const struct qcom_ubwc_cfg_data *cfg
static inline bool qcom_ubwc_bank_spread(const struct qcom_ubwc_cfg_data *cfg)
{
- return cfg->ubwc_bank_spread;
+ return true;
}
static inline u32 qcom_ubwc_swizzle(const struct qcom_ubwc_cfg_data *cfg)
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 25/28] soc: qcom: ubwc: drop macrotile_mode from the database
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (23 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 24/28] soc: qcom: ubwc: drop ubwc_bank_spread Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 26/28] soc: qcom: ubwc: use fixed values for UBWC swizzle for UBWC < 4.0 Dmitry Baryshkov
` (3 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
All the users have been migrated to using qcom_ubwc_macrotile_mode()
instead of reading the raw value from the config structure. Drop the
field from struct qcom_ubwc_cfg_data and replace it with the calculated
value. Split single UBWC_3_0 into UBWC_3_0 (no macrotile mode) and
UBWC_3_1 (with macrotile mode).
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/soc/qcom/ubwc_config.c | 18 +++---------------
include/linux/soc/qcom/ubwc.h | 18 ++++++++----------
2 files changed, 11 insertions(+), 25 deletions(-)
diff --git a/drivers/soc/qcom/ubwc_config.c b/drivers/soc/qcom/ubwc_config.c
index 35cde4e9a238..8dd91d0b3974 100644
--- a/drivers/soc/qcom/ubwc_config.c
+++ b/drivers/soc/qcom/ubwc_config.c
@@ -22,7 +22,6 @@ static const struct qcom_ubwc_cfg_data eliza_data = {
UBWC_SWIZZLE_ENABLE_LVL3,
/* TODO: highest_bank_bit = 14 for LP_DDR4 */
.highest_bank_bit = 15,
- .macrotile_mode = true,
};
static const struct qcom_ubwc_cfg_data kaanapali_data = {
@@ -30,7 +29,6 @@ static const struct qcom_ubwc_cfg_data kaanapali_data = {
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 16,
- .macrotile_mode = true,
};
static const struct qcom_ubwc_cfg_data msm8937_data = {
@@ -58,15 +56,13 @@ static const struct qcom_ubwc_cfg_data sa8775p_data = {
.ubwc_enc_version = UBWC_4_0,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 13,
- .macrotile_mode = true,
};
static const struct qcom_ubwc_cfg_data sar2130p_data = {
- .ubwc_enc_version = UBWC_3_0, /* 4.0.2 in hw */
+ .ubwc_enc_version = UBWC_3_1,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 13,
- .macrotile_mode = true,
};
static const struct qcom_ubwc_cfg_data sc7180_data = {
@@ -77,19 +73,17 @@ static const struct qcom_ubwc_cfg_data sc7180_data = {
};
static const struct qcom_ubwc_cfg_data sc7280_data = {
- .ubwc_enc_version = UBWC_3_0,
+ .ubwc_enc_version = UBWC_3_1,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 14,
- .macrotile_mode = true,
};
static const struct qcom_ubwc_cfg_data sc8180x_data = {
- .ubwc_enc_version = UBWC_3_0,
+ .ubwc_enc_version = UBWC_3_1,
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 16,
- .macrotile_mode = true,
};
static const struct qcom_ubwc_cfg_data sc8280xp_data = {
@@ -97,7 +91,6 @@ static const struct qcom_ubwc_cfg_data sc8280xp_data = {
.ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 16,
- .macrotile_mode = true,
};
static const struct qcom_ubwc_cfg_data sdm670_data = {
@@ -164,7 +157,6 @@ static const struct qcom_ubwc_cfg_data sm8250_data = {
UBWC_SWIZZLE_ENABLE_LVL3,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
.highest_bank_bit = 16,
- .macrotile_mode = true,
};
static const struct qcom_ubwc_cfg_data sm8350_data = {
@@ -173,7 +165,6 @@ static const struct qcom_ubwc_cfg_data sm8350_data = {
UBWC_SWIZZLE_ENABLE_LVL3,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
.highest_bank_bit = 16,
- .macrotile_mode = true,
};
static const struct qcom_ubwc_cfg_data sm8550_data = {
@@ -182,7 +173,6 @@ static const struct qcom_ubwc_cfg_data sm8550_data = {
UBWC_SWIZZLE_ENABLE_LVL3,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
.highest_bank_bit = 16,
- .macrotile_mode = true,
};
static const struct qcom_ubwc_cfg_data sm8750_data = {
@@ -190,7 +180,6 @@ static const struct qcom_ubwc_cfg_data sm8750_data = {
.ubwc_swizzle = 6,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
.highest_bank_bit = 16,
- .macrotile_mode = true,
};
static const struct qcom_ubwc_cfg_data glymur_data = {
@@ -198,7 +187,6 @@ static const struct qcom_ubwc_cfg_data glymur_data = {
.ubwc_swizzle = 0,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
.highest_bank_bit = 16,
- .macrotile_mode = true,
};
static const struct of_device_id qcom_ubwc_configs[] __maybe_unused = {
diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h
index 254721f5ea3c..fee778360ac2 100644
--- a/include/linux/soc/qcom/ubwc.h
+++ b/include/linux/soc/qcom/ubwc.h
@@ -33,15 +33,6 @@ struct qcom_ubwc_cfg_data {
* DDR bank. This should ideally use DRAM type detection.
*/
int highest_bank_bit;
-
- /**
- * @macrotile_mode: Macrotile Mode
- *
- * Whether to use 4-channel macrotiling mode or the newer
- * 8-channel macrotiling mode introduced in UBWC 3.1. 0 is
- * 4-channel and 1 is 8-channel.
- */
- bool macrotile_mode;
};
#define UBWC_1_0 0x10000000
@@ -77,9 +68,16 @@ static inline bool qcom_ubwc_min_acc_length_64b(const struct qcom_ubwc_cfg_data
return cfg->ubwc_enc_version == UBWC_1_0;
}
+/*
+ * @qcom_ubwc_macrotile_mode: whether to use 4-channel or 8-channel macrotiling
+ *
+ * The 8-channel macrotiling mode was introduced in UBWC 3.1.
+ *
+ * Returns: false for the 4-channel and true for 8-channel.
+ */
static inline bool qcom_ubwc_macrotile_mode(const struct qcom_ubwc_cfg_data *cfg)
{
- return cfg->macrotile_mode;
+ return cfg->ubwc_enc_version >= UBWC_3_1;
}
static inline bool qcom_ubwc_bank_spread(const struct qcom_ubwc_cfg_data *cfg)
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 26/28] soc: qcom: ubwc: use fixed values for UBWC swizzle for UBWC < 4.0
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (24 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 25/28] soc: qcom: ubwc: drop macrotile_mode from the database Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 27/28] soc: qcom: ubwc: sort out the rest of the UBWC swizzle settings Dmitry Baryshkov
` (2 subsequent siblings)
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
UBWC devices before 4.0 use standard UBWC swizzle levels. As all the
drivers now use the qcom_ubwc_swizzle() helper, move those values to the
helper, leaving UBWC 4.0+ intact for now.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/soc/qcom/ubwc_config.c | 34 ----------------------------------
include/linux/soc/qcom/ubwc.h | 33 ++++++++++++++++++++++++---------
2 files changed, 24 insertions(+), 43 deletions(-)
diff --git a/drivers/soc/qcom/ubwc_config.c b/drivers/soc/qcom/ubwc_config.c
index 8dd91d0b3974..7e321389a399 100644
--- a/drivers/soc/qcom/ubwc_config.c
+++ b/drivers/soc/qcom/ubwc_config.c
@@ -33,17 +33,11 @@ static const struct qcom_ubwc_cfg_data kaanapali_data = {
static const struct qcom_ubwc_cfg_data msm8937_data = {
.ubwc_enc_version = UBWC_1_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL1 |
- UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 14,
};
static const struct qcom_ubwc_cfg_data msm8998_data = {
.ubwc_enc_version = UBWC_1_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL1 |
- UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 15,
};
@@ -60,94 +54,66 @@ static const struct qcom_ubwc_cfg_data sa8775p_data = {
static const struct qcom_ubwc_cfg_data sar2130p_data = {
.ubwc_enc_version = UBWC_3_1,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 13,
};
static const struct qcom_ubwc_cfg_data sc7180_data = {
.ubwc_enc_version = UBWC_2_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 14,
};
static const struct qcom_ubwc_cfg_data sc7280_data = {
.ubwc_enc_version = UBWC_3_1,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 14,
};
static const struct qcom_ubwc_cfg_data sc8180x_data = {
.ubwc_enc_version = UBWC_3_1,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 16,
};
static const struct qcom_ubwc_cfg_data sc8280xp_data = {
.ubwc_enc_version = UBWC_4_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 16,
};
static const struct qcom_ubwc_cfg_data sdm670_data = {
.ubwc_enc_version = UBWC_2_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 14,
};
static const struct qcom_ubwc_cfg_data sdm845_data = {
.ubwc_enc_version = UBWC_2_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 15,
};
static const struct qcom_ubwc_cfg_data sm6115_data = {
.ubwc_enc_version = UBWC_1_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL1 |
- UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 14,
};
static const struct qcom_ubwc_cfg_data sm6125_data = {
.ubwc_enc_version = UBWC_1_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL1 |
- UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 14,
};
static const struct qcom_ubwc_cfg_data sm6150_data = {
.ubwc_enc_version = UBWC_2_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 14,
};
static const struct qcom_ubwc_cfg_data sm6350_data = {
.ubwc_enc_version = UBWC_2_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 14,
};
static const struct qcom_ubwc_cfg_data sm7150_data = {
.ubwc_enc_version = UBWC_2_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 14,
};
static const struct qcom_ubwc_cfg_data sm8150_data = {
.ubwc_enc_version = UBWC_3_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 15,
};
diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h
index fee778360ac2..7c9506741001 100644
--- a/include/linux/soc/qcom/ubwc.h
+++ b/include/linux/soc/qcom/ubwc.h
@@ -22,9 +22,6 @@ struct qcom_ubwc_cfg_data {
* UBWC 4.0 adds the optional ability to disable levels 2 & 3.
*/
u32 ubwc_swizzle;
-#define UBWC_SWIZZLE_ENABLE_LVL1 BIT(0)
-#define UBWC_SWIZZLE_ENABLE_LVL2 BIT(1)
-#define UBWC_SWIZZLE_ENABLE_LVL3 BIT(2)
/**
* @highest_bank_bit: Highest Bank Bit
@@ -55,12 +52,7 @@ static inline const struct qcom_ubwc_cfg_data *qcom_ubwc_config_get_data(void)
static inline bool qcom_ubwc_get_ubwc_mode(const struct qcom_ubwc_cfg_data *cfg)
{
- bool ret = cfg->ubwc_enc_version == UBWC_1_0;
-
- if (ret && !(cfg->ubwc_swizzle & UBWC_SWIZZLE_ENABLE_LVL1))
- pr_err("UBWC config discrepancy - level 1 swizzling disabled on UBWC 1.0\n");
-
- return ret;
+ return cfg->ubwc_enc_version == UBWC_1_0;
}
static inline bool qcom_ubwc_min_acc_length_64b(const struct qcom_ubwc_cfg_data *cfg)
@@ -85,8 +77,31 @@ static inline bool qcom_ubwc_bank_spread(const struct qcom_ubwc_cfg_data *cfg)
return true;
}
+#define UBWC_SWIZZLE_ENABLE_LVL1 BIT(0)
+#define UBWC_SWIZZLE_ENABLE_LVL2 BIT(1)
+#define UBWC_SWIZZLE_ENABLE_LVL3 BIT(2)
+
+/**
+ * @qcom_ubwc_swizzle: Whether to enable level 1, 2 & 3 bank swizzling.
+ *
+ * UBWC 1.0 always enables all three levels.
+ * UBWC 2.0 removes level 1 bank swizzling, leaving levels 2 & 3.
+ * UBWC 4.0 adds the optional ability to disable levels 2 & 3.
+ */
static inline u32 qcom_ubwc_swizzle(const struct qcom_ubwc_cfg_data *cfg)
{
+ if (cfg->ubwc_enc_version == 0)
+ return 0;
+
+ if (cfg->ubwc_enc_version == UBWC_1_0)
+ return UBWC_SWIZZLE_ENABLE_LVL1 |
+ UBWC_SWIZZLE_ENABLE_LVL2 |
+ UBWC_SWIZZLE_ENABLE_LVL3;
+
+ if (cfg->ubwc_enc_version < UBWC_4_0)
+ return UBWC_SWIZZLE_ENABLE_LVL2 |
+ UBWC_SWIZZLE_ENABLE_LVL3;
+
return cfg->ubwc_swizzle;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 27/28] soc: qcom: ubwc: sort out the rest of the UBWC swizzle settings
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (25 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 26/28] soc: qcom: ubwc: use fixed values for UBWC swizzle for UBWC < 4.0 Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 28/28] soc: qcom: ubwc: deduplicate UBWC configuration data Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: soc/qcom/ubwc: rework UBWC configuration database Claude Code Review Bot
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
Sort out the remaining UBWC swizzle values, using flags to control
whether level 2 and level 3 swizzling are enabled or not.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/soc/qcom/ubwc_config.c | 16 +++-------------
include/linux/soc/qcom/ubwc.h | 26 +++++++++++++-------------
2 files changed, 16 insertions(+), 26 deletions(-)
diff --git a/drivers/soc/qcom/ubwc_config.c b/drivers/soc/qcom/ubwc_config.c
index 7e321389a399..f27440d5c06f 100644
--- a/drivers/soc/qcom/ubwc_config.c
+++ b/drivers/soc/qcom/ubwc_config.c
@@ -18,16 +18,12 @@ static const struct qcom_ubwc_cfg_data no_ubwc_data = {
static const struct qcom_ubwc_cfg_data eliza_data = {
.ubwc_enc_version = UBWC_5_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
/* TODO: highest_bank_bit = 14 for LP_DDR4 */
.highest_bank_bit = 15,
};
static const struct qcom_ubwc_cfg_data kaanapali_data = {
.ubwc_enc_version = UBWC_6_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
.highest_bank_bit = 16,
};
@@ -48,7 +44,7 @@ static const struct qcom_ubwc_cfg_data qcm2290_data = {
static const struct qcom_ubwc_cfg_data sa8775p_data = {
.ubwc_enc_version = UBWC_4_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL3,
+ .flags = UBWC_FLAG_DISABLE_SWIZZLE_LVL2,
.highest_bank_bit = 13,
};
@@ -119,38 +115,32 @@ static const struct qcom_ubwc_cfg_data sm8150_data = {
static const struct qcom_ubwc_cfg_data sm8250_data = {
.ubwc_enc_version = UBWC_4_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
.highest_bank_bit = 16,
};
static const struct qcom_ubwc_cfg_data sm8350_data = {
.ubwc_enc_version = UBWC_4_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
.highest_bank_bit = 16,
};
static const struct qcom_ubwc_cfg_data sm8550_data = {
.ubwc_enc_version = UBWC_4_0,
- .ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
.highest_bank_bit = 16,
};
static const struct qcom_ubwc_cfg_data sm8750_data = {
.ubwc_enc_version = UBWC_5_0,
- .ubwc_swizzle = 6,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
.highest_bank_bit = 16,
};
static const struct qcom_ubwc_cfg_data glymur_data = {
.ubwc_enc_version = UBWC_5_0,
- .ubwc_swizzle = 0,
+ .flags = UBWC_FLAG_DISABLE_SWIZZLE_LVL2 |
+ UBWC_FLAG_DISABLE_SWIZZLE_LVL3,
/* TODO: highest_bank_bit = 15 for LP_DDR4 */
.highest_bank_bit = 16,
};
diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h
index 7c9506741001..a7372d9c25fb 100644
--- a/include/linux/soc/qcom/ubwc.h
+++ b/include/linux/soc/qcom/ubwc.h
@@ -14,15 +14,6 @@
struct qcom_ubwc_cfg_data {
u32 ubwc_enc_version;
- /**
- * @ubwc_swizzle: Whether to enable level 1, 2 & 3 bank swizzling.
- *
- * UBWC 1.0 always enables all three levels.
- * UBWC 2.0 removes level 1 bank swizzling, leaving levels 2 & 3.
- * UBWC 4.0 adds the optional ability to disable levels 2 & 3.
- */
- u32 ubwc_swizzle;
-
/**
* @highest_bank_bit: Highest Bank Bit
*
@@ -30,6 +21,10 @@ struct qcom_ubwc_cfg_data {
* DDR bank. This should ideally use DRAM type detection.
*/
int highest_bank_bit;
+
+ unsigned int flags;
+#define UBWC_FLAG_DISABLE_SWIZZLE_LVL2 BIT(0)
+#define UBWC_FLAG_DISABLE_SWIZZLE_LVL3 BIT(1)
};
#define UBWC_1_0 0x10000000
@@ -98,11 +93,16 @@ static inline u32 qcom_ubwc_swizzle(const struct qcom_ubwc_cfg_data *cfg)
UBWC_SWIZZLE_ENABLE_LVL2 |
UBWC_SWIZZLE_ENABLE_LVL3;
- if (cfg->ubwc_enc_version < UBWC_4_0)
- return UBWC_SWIZZLE_ENABLE_LVL2 |
- UBWC_SWIZZLE_ENABLE_LVL3;
+ u32 ubwc_swizzle = UBWC_SWIZZLE_ENABLE_LVL2 |
+ UBWC_SWIZZLE_ENABLE_LVL3;
+
+ if (cfg->flags & UBWC_FLAG_DISABLE_SWIZZLE_LVL2)
+ ubwc_swizzle &= ~UBWC_SWIZZLE_ENABLE_LVL2;
+
+ if (cfg->flags & UBWC_FLAG_DISABLE_SWIZZLE_LVL3)
+ ubwc_swizzle &= ~UBWC_SWIZZLE_ENABLE_LVL3;
- return cfg->ubwc_swizzle;
+ return ubwc_swizzle;
}
static inline u32 qcom_ubwc_version_tag(const struct qcom_ubwc_cfg_data *cfg)
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* [PATCH v5 28/28] soc: qcom: ubwc: deduplicate UBWC configuration data
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (26 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 27/28] soc: qcom: ubwc: sort out the rest of the UBWC swizzle settings Dmitry Baryshkov
@ 2026-05-20 14:51 ` Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-25 11:41 ` Claude review: soc/qcom/ubwc: rework UBWC configuration database Claude Code Review Bot
28 siblings, 1 reply; 58+ messages in thread
From: Dmitry Baryshkov @ 2026-05-20 14:51 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter,
Bjorn Andersson, Konrad Dybcio, Akhil P Oommen
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Konrad Dybcio
After removing all extra entries from the UBWC database it is easy to
define generic entries, common for all machine classes.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/soc/qcom/ubwc_config.c | 196 ++++++++++++++++-------------------------
1 file changed, 76 insertions(+), 120 deletions(-)
diff --git a/drivers/soc/qcom/ubwc_config.c b/drivers/soc/qcom/ubwc_config.c
index f27440d5c06f..4eb115a7fc50 100644
--- a/drivers/soc/qcom/ubwc_config.c
+++ b/drivers/soc/qcom/ubwc_config.c
@@ -16,125 +16,81 @@ static const struct qcom_ubwc_cfg_data no_ubwc_data = {
/* no UBWC, no HBB */
};
-static const struct qcom_ubwc_cfg_data eliza_data = {
- .ubwc_enc_version = UBWC_5_0,
- /* TODO: highest_bank_bit = 14 for LP_DDR4 */
+static const struct qcom_ubwc_cfg_data ubwc_0_0_hbb15 = {
+ /* no UBWC */
.highest_bank_bit = 15,
};
-static const struct qcom_ubwc_cfg_data kaanapali_data = {
- .ubwc_enc_version = UBWC_6_0,
- .highest_bank_bit = 16,
+static const struct qcom_ubwc_cfg_data ubwc_1_0_hbb14 = {
+ .ubwc_enc_version = UBWC_1_0,
+ .highest_bank_bit = 14,
};
-static const struct qcom_ubwc_cfg_data msm8937_data = {
+static const struct qcom_ubwc_cfg_data ubwc_1_0_hbb15 = {
.ubwc_enc_version = UBWC_1_0,
+ .highest_bank_bit = 15,
+};
+
+static const struct qcom_ubwc_cfg_data ubwc_2_0_hbb14 = {
+ .ubwc_enc_version = UBWC_2_0,
.highest_bank_bit = 14,
};
-static const struct qcom_ubwc_cfg_data msm8998_data = {
- .ubwc_enc_version = UBWC_1_0,
+static const struct qcom_ubwc_cfg_data ubwc_2_0_hbb15 = {
+ .ubwc_enc_version = UBWC_2_0,
.highest_bank_bit = 15,
};
-static const struct qcom_ubwc_cfg_data qcm2290_data = {
- /* no UBWC */
+static const struct qcom_ubwc_cfg_data ubwc_3_0_hbb15 = {
+ .ubwc_enc_version = UBWC_3_0,
.highest_bank_bit = 15,
};
-static const struct qcom_ubwc_cfg_data sa8775p_data = {
- .ubwc_enc_version = UBWC_4_0,
- .flags = UBWC_FLAG_DISABLE_SWIZZLE_LVL2,
- .highest_bank_bit = 13,
+static const struct qcom_ubwc_cfg_data ubwc_3_0_hbb16 = {
+ .ubwc_enc_version = UBWC_3_0,
+ .highest_bank_bit = 16,
};
-static const struct qcom_ubwc_cfg_data sar2130p_data = {
+static const struct qcom_ubwc_cfg_data ubwc_3_1_hbb13 = {
.ubwc_enc_version = UBWC_3_1,
.highest_bank_bit = 13,
};
-static const struct qcom_ubwc_cfg_data sc7180_data = {
- .ubwc_enc_version = UBWC_2_0,
- .highest_bank_bit = 14,
-};
-
-static const struct qcom_ubwc_cfg_data sc7280_data = {
+static const struct qcom_ubwc_cfg_data ubwc_3_1_hbb14 = {
.ubwc_enc_version = UBWC_3_1,
.highest_bank_bit = 14,
};
-static const struct qcom_ubwc_cfg_data sc8180x_data = {
+static const struct qcom_ubwc_cfg_data ubwc_3_1_hbb16 = {
.ubwc_enc_version = UBWC_3_1,
.highest_bank_bit = 16,
};
-static const struct qcom_ubwc_cfg_data sc8280xp_data = {
+static const struct qcom_ubwc_cfg_data ubwc_4_0_hbb16 = {
.ubwc_enc_version = UBWC_4_0,
.highest_bank_bit = 16,
};
-static const struct qcom_ubwc_cfg_data sdm670_data = {
- .ubwc_enc_version = UBWC_2_0,
- .highest_bank_bit = 14,
-};
-
-static const struct qcom_ubwc_cfg_data sdm845_data = {
- .ubwc_enc_version = UBWC_2_0,
- .highest_bank_bit = 15,
-};
-
-static const struct qcom_ubwc_cfg_data sm6115_data = {
- .ubwc_enc_version = UBWC_1_0,
- .highest_bank_bit = 14,
-};
-
-static const struct qcom_ubwc_cfg_data sm6125_data = {
- .ubwc_enc_version = UBWC_1_0,
- .highest_bank_bit = 14,
-};
-
-static const struct qcom_ubwc_cfg_data sm6150_data = {
- .ubwc_enc_version = UBWC_2_0,
- .highest_bank_bit = 14,
-};
-
-static const struct qcom_ubwc_cfg_data sm6350_data = {
- .ubwc_enc_version = UBWC_2_0,
- .highest_bank_bit = 14,
-};
-
-static const struct qcom_ubwc_cfg_data sm7150_data = {
- .ubwc_enc_version = UBWC_2_0,
- .highest_bank_bit = 14,
-};
-
-static const struct qcom_ubwc_cfg_data sm8150_data = {
- .ubwc_enc_version = UBWC_3_0,
+static const struct qcom_ubwc_cfg_data ubwc_5_0_hbb15 = {
+ .ubwc_enc_version = UBWC_5_0,
+ /* TODO: highest_bank_bit = 14 for LP_DDR4 */
.highest_bank_bit = 15,
};
-static const struct qcom_ubwc_cfg_data sm8250_data = {
- .ubwc_enc_version = UBWC_4_0,
- /* TODO: highest_bank_bit = 15 for LP_DDR4 */
+static const struct qcom_ubwc_cfg_data ubwc_5_0_hbb16 = {
+ .ubwc_enc_version = UBWC_5_0,
.highest_bank_bit = 16,
};
-static const struct qcom_ubwc_cfg_data sm8350_data = {
- .ubwc_enc_version = UBWC_4_0,
- /* TODO: highest_bank_bit = 15 for LP_DDR4 */
+static const struct qcom_ubwc_cfg_data ubwc_6_0_hbb16 = {
+ .ubwc_enc_version = UBWC_6_0,
.highest_bank_bit = 16,
};
-static const struct qcom_ubwc_cfg_data sm8550_data = {
+static const struct qcom_ubwc_cfg_data sa8775p_data = {
.ubwc_enc_version = UBWC_4_0,
- /* TODO: highest_bank_bit = 15 for LP_DDR4 */
- .highest_bank_bit = 16,
-};
-
-static const struct qcom_ubwc_cfg_data sm8750_data = {
- .ubwc_enc_version = UBWC_5_0,
- /* TODO: highest_bank_bit = 15 for LP_DDR4 */
- .highest_bank_bit = 16,
+ .flags = UBWC_FLAG_DISABLE_SWIZZLE_LVL2,
+ .highest_bank_bit = 13,
};
static const struct qcom_ubwc_cfg_data glymur_data = {
@@ -149,61 +105,61 @@ static const struct of_device_id qcom_ubwc_configs[] __maybe_unused = {
{ .compatible = "qcom,apq8016", .data = &no_ubwc_data },
{ .compatible = "qcom,apq8026", .data = &no_ubwc_data },
{ .compatible = "qcom,apq8074", .data = &no_ubwc_data },
- { .compatible = "qcom,apq8096", .data = &msm8998_data },
- { .compatible = "qcom,eliza", .data = &eliza_data, },
- { .compatible = "qcom,kaanapali", .data = &kaanapali_data, },
+ { .compatible = "qcom,apq8096", .data = &ubwc_1_0_hbb15 },
+ { .compatible = "qcom,eliza", .data = &ubwc_5_0_hbb15 },
{ .compatible = "qcom,glymur", .data = &glymur_data},
+ { .compatible = "qcom,kaanapali", .data = &ubwc_6_0_hbb16 },
{ .compatible = "qcom,mahua", .data = &glymur_data },
{ .compatible = "qcom,msm8226", .data = &no_ubwc_data },
{ .compatible = "qcom,msm8916", .data = &no_ubwc_data },
{ .compatible = "qcom,msm8917", .data = &no_ubwc_data },
- { .compatible = "qcom,msm8937", .data = &msm8937_data },
+ { .compatible = "qcom,msm8937", .data = &ubwc_1_0_hbb14 },
{ .compatible = "qcom,msm8929", .data = &no_ubwc_data },
{ .compatible = "qcom,msm8939", .data = &no_ubwc_data },
- { .compatible = "qcom,msm8953", .data = &msm8937_data },
+ { .compatible = "qcom,msm8953", .data = &ubwc_1_0_hbb14 },
{ .compatible = "qcom,msm8956", .data = &no_ubwc_data },
{ .compatible = "qcom,msm8974", .data = &no_ubwc_data },
{ .compatible = "qcom,msm8976", .data = &no_ubwc_data },
- { .compatible = "qcom,msm8996", .data = &msm8998_data },
- { .compatible = "qcom,msm8998", .data = &msm8998_data },
- { .compatible = "qcom,qcm2290", .data = &qcm2290_data, },
- { .compatible = "qcom,qcm6490", .data = &sc7280_data, },
- { .compatible = "qcom,qcs8300", .data = &sc8280xp_data, },
- { .compatible = "qcom,sa8155p", .data = &sm8150_data, },
- { .compatible = "qcom,sa8540p", .data = &sc8280xp_data, },
+ { .compatible = "qcom,msm8996", .data = &ubwc_1_0_hbb15 },
+ { .compatible = "qcom,msm8998", .data = &ubwc_1_0_hbb15 },
+ { .compatible = "qcom,qcm2290", .data = &ubwc_0_0_hbb15, },
+ { .compatible = "qcom,qcm6490", .data = &ubwc_3_1_hbb14, },
+ { .compatible = "qcom,qcs8300", .data = &ubwc_4_0_hbb16, },
+ { .compatible = "qcom,sa8155p", .data = &ubwc_3_0_hbb15, },
+ { .compatible = "qcom,sa8540p", .data = &ubwc_4_0_hbb16, },
{ .compatible = "qcom,sa8775p", .data = &sa8775p_data, },
- { .compatible = "qcom,sar2130p", .data = &sar2130p_data },
- { .compatible = "qcom,sc7180", .data = &sc7180_data },
- { .compatible = "qcom,sc7280", .data = &sc7280_data, },
- { .compatible = "qcom,sc8180x", .data = &sc8180x_data, },
- { .compatible = "qcom,sc8280xp", .data = &sc8280xp_data, },
- { .compatible = "qcom,sda660", .data = &msm8937_data },
- { .compatible = "qcom,sdm450", .data = &msm8937_data },
- { .compatible = "qcom,sdm630", .data = &msm8937_data },
- { .compatible = "qcom,sdm632", .data = &msm8937_data },
- { .compatible = "qcom,sdm636", .data = &msm8937_data },
- { .compatible = "qcom,sdm660", .data = &msm8937_data },
- { .compatible = "qcom,sdm670", .data = &sdm670_data, },
- { .compatible = "qcom,sdm845", .data = &sdm845_data, },
- { .compatible = "qcom,sm4250", .data = &sm6115_data, },
- { .compatible = "qcom,sm6115", .data = &sm6115_data, },
- { .compatible = "qcom,sm6125", .data = &sm6125_data, },
- { .compatible = "qcom,sm6150", .data = &sm6150_data, },
- { .compatible = "qcom,sm6350", .data = &sm6350_data, },
- { .compatible = "qcom,sm6375", .data = &sm6350_data, },
- { .compatible = "qcom,sm7125", .data = &sc7180_data },
- { .compatible = "qcom,sm7150", .data = &sm7150_data, },
- { .compatible = "qcom,sm7225", .data = &sm6350_data, },
- { .compatible = "qcom,sm7325", .data = &sc7280_data, },
- { .compatible = "qcom,sm8150", .data = &sm8150_data, },
- { .compatible = "qcom,sm8250", .data = &sm8250_data, },
- { .compatible = "qcom,sm8350", .data = &sm8350_data, },
- { .compatible = "qcom,sm8450", .data = &sm8350_data, },
- { .compatible = "qcom,sm8550", .data = &sm8550_data, },
- { .compatible = "qcom,sm8650", .data = &sm8550_data, },
- { .compatible = "qcom,sm8750", .data = &sm8750_data, },
- { .compatible = "qcom,x1e80100", .data = &sm8550_data, },
- { .compatible = "qcom,x1p42100", .data = &sm8550_data, },
+ { .compatible = "qcom,sar2130p", .data = &ubwc_3_1_hbb13 },
+ { .compatible = "qcom,sc7180", .data = &ubwc_2_0_hbb14, },
+ { .compatible = "qcom,sc7280", .data = &ubwc_3_1_hbb14, },
+ { .compatible = "qcom,sc8180x", .data = &ubwc_3_1_hbb16, },
+ { .compatible = "qcom,sc8280xp", .data = &ubwc_4_0_hbb16, },
+ { .compatible = "qcom,sda660", .data = &ubwc_1_0_hbb14 },
+ { .compatible = "qcom,sdm450", .data = &ubwc_1_0_hbb14 },
+ { .compatible = "qcom,sdm630", .data = &ubwc_1_0_hbb14 },
+ { .compatible = "qcom,sdm632", .data = &ubwc_1_0_hbb14 },
+ { .compatible = "qcom,sdm636", .data = &ubwc_1_0_hbb14 },
+ { .compatible = "qcom,sdm660", .data = &ubwc_1_0_hbb14 },
+ { .compatible = "qcom,sdm670", .data = &ubwc_2_0_hbb14, },
+ { .compatible = "qcom,sdm845", .data = &ubwc_2_0_hbb15, },
+ { .compatible = "qcom,sm4250", .data = &ubwc_1_0_hbb14, },
+ { .compatible = "qcom,sm6115", .data = &ubwc_1_0_hbb14, },
+ { .compatible = "qcom,sm6125", .data = &ubwc_1_0_hbb14, },
+ { .compatible = "qcom,sm6150", .data = &ubwc_2_0_hbb14, },
+ { .compatible = "qcom,sm6350", .data = &ubwc_2_0_hbb14, },
+ { .compatible = "qcom,sm6375", .data = &ubwc_2_0_hbb14, },
+ { .compatible = "qcom,sm7125", .data = &ubwc_2_0_hbb14, },
+ { .compatible = "qcom,sm7150", .data = &ubwc_2_0_hbb14, },
+ { .compatible = "qcom,sm7225", .data = &ubwc_2_0_hbb14, },
+ { .compatible = "qcom,sm7325", .data = &ubwc_3_1_hbb14, },
+ { .compatible = "qcom,sm8150", .data = &ubwc_3_0_hbb15, },
+ { .compatible = "qcom,sm8250", .data = &ubwc_4_0_hbb16, },
+ { .compatible = "qcom,sm8350", .data = &ubwc_4_0_hbb16, },
+ { .compatible = "qcom,sm8450", .data = &ubwc_4_0_hbb16, },
+ { .compatible = "qcom,sm8550", .data = &ubwc_4_0_hbb16, },
+ { .compatible = "qcom,sm8650", .data = &ubwc_4_0_hbb16, },
+ { .compatible = "qcom,sm8750", .data = &ubwc_5_0_hbb16, },
+ { .compatible = "qcom,x1e80100", .data = &ubwc_4_0_hbb16, },
+ { .compatible = "qcom,x1p42100", .data = &ubwc_4_0_hbb16, },
{ }
};
--
2.47.3
^ permalink raw reply related [flat|nested] 58+ messages in thread
* Claude review: soc/qcom/ubwc: rework UBWC configuration database
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
` (27 preceding siblings ...)
2026-05-20 14:51 ` [PATCH v5 28/28] soc: qcom: ubwc: deduplicate UBWC configuration data Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
28 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: soc/qcom/ubwc: rework UBWC configuration database
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patches: 29
Reviewed: 2026-05-25T21:41:56.176616
---
This is a well-structured 28-patch series that reworks the Qualcomm UBWC (Universal Bandwidth Compression) configuration database. The core thesis is sound: most UBWC configuration parameters are derivable from the UBWC encoder version, so they should be computed by inline helper functions rather than stored per-SoC in a data table. This eliminates redundancy, reduces the chance of copy-paste errors when adding new SoCs, and makes the relationship between UBWC version and configuration parameters explicit in code.
**Architecture:** The series follows a clean three-phase approach:
1. **Patches 01-03:** Add new UBWC version constants and helper functions
2. **Patches 04-21:** Migrate all driver consumers to use the new helpers
3. **Patches 22-28:** Remove the now-redundant fields from the database and deduplicate entries
This ordering is correct -- helpers are introduced before use, consumers are migrated before data is removed. Each patch is individually bisectable within its phase.
**Strengths:**
- The final `qcom_ubwc_cfg_data` struct is dramatically simplified: only `ubwc_enc_version`, `highest_bank_bit`, and `flags` remain, down from 6+ fields
- Patch 28's deduplication is a satisfying payoff -- 30+ per-SoC structs collapse to ~15 generic `ubwc_X_Y_hbbZ` entries
- All patches have Reviewed-by tags from Konrad Dybcio, and several from Akhil P Oommen
- The version-based derivation logic is well-documented in the helper functions
**Concerns:**
- The introduction of UBWC_3_1 in patches 01/25 warrants scrutiny -- it reclassifies several SoCs (sc7280, sc8180x, sar2130p) from UBWC_3_0 to UBWC_3_1, which affects the macrotile_mode derivation. This is the highest-risk change in the series.
- Patch 18 converts a switch statement to if-else chains that mix `ubwc_version` (local) and `cfg->ubwc_enc_version` (direct field access) inconsistently.
- The `amsbc` helper in patch 19 changes behavior for the MDSS driver: the old code checked `== UBWC_3_0`, but the helper returns `>= UBWC_3_0`. This is a functional change for MDSS that depends on patches 14/19 being on the same base.
**Verdict:** The series is in good shape for a v5. The design is clean, the ordering is correct, and the end result is clearly superior to the current state. A few minor nits noted per-patch below, but nothing blocking.
---
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: soc: qcom: ubwc: define UBWC 3.1
2026-05-20 14:51 ` [PATCH v5 01/28] soc: qcom: ubwc: define UBWC 3.1 Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Adds `#define UBWC_3_1 0x30010000` to the version constants.
This slots between UBWC_3_0 (`0x30000000`) and UBWC_4_0 (`0x40000000`), using the minor version field in the encoding scheme. Straightforward addition used by later patches to distinguish SoCs that were previously all lumped under UBWC_3_0.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: soc: qcom: ubwc: define helper for MDSS and Adreno drivers
2026-05-20 14:51 ` [PATCH v5 02/28] soc: qcom: ubwc: define helper for MDSS and Adreno drivers Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Adds `qcom_ubwc_version_tag()` which maps UBWC version ranges to integer tags 0-5. Used by GPU drivers for register programming.
```c
static inline u32 qcom_ubwc_version_tag(const struct qcom_ubwc_cfg_data *cfg)
```
The range-based approach (`>= UBWC_5_0` returns 5, `>= UBWC_4_0` returns 4, etc.) is future-proof for minor versions. Clean implementation.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: soc: qcom: ubwc: add helper controlling AMSBC enablement
2026-05-20 14:51 ` [PATCH v5 03/28] soc: qcom: ubwc: add helper controlling AMSBC enablement Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Adds `qcom_ubwc_enable_amsbc()` returning `cfg->ubwc_enc_version >= UBWC_3_0`. This is used later to replace scattered `>= UBWC_3_0` checks across GPU and display drivers.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/adreno: Trust the SSoT UBWC config
2026-05-20 14:51 ` [PATCH v5 04/28] drm/msm/adreno: Trust the SSoT UBWC config Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Large cleanup -- removes the `a6xx_calc_ubwc_config()` function that contained hardcoded per-GPU UBWC parameters (for a618, a619, a630, a640, a650, etc.) and the `_ubwc_config` copy in `adreno_gpu`. The a5xx and a6xx drivers now take a `const *` pointer directly from the UBWC database.
This is the biggest single-patch win in the series. The deleted function was a maintenance burden -- every new a6xx GPU required manually adding its UBWC config values. Now the centralized database handles it.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/adreno: use qcom_ubwc_version_tag() helper
2026-05-20 14:51 ` [PATCH v5 05/28] drm/msm/adreno: use qcom_ubwc_version_tag() helper Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Replaces per-case mode values in `a8xx_set_ubwc_config()` with `qcom_ubwc_version_tag(cfg)`. The switch cases that previously set `mode = 0/1/2/3/4/5` per UBWC version are eliminated.
Clean conversion.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/mdss: use qcom_ubwc_version_tag() helper
2026-05-20 14:51 ` [PATCH v5 06/28] drm/msm/mdss: " Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Same conversion for the MDSS display driver -- replaces `ubwc_dec_version` comparisons with `qcom_ubwc_version_tag()` for the `UBWC_CTRL_2` register programming.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/adreno: use new helper to set min_acc length
2026-05-20 14:51 ` [PATCH v5 07/28] drm/msm/adreno: use new helper to set min_acc length Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Migrates `a6xx_gpu.c` to use `qcom_ubwc_min_acc_length_64b()` instead of a hardcoded check.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/mdss: use new helper to set min_acc length
2026-05-20 14:51 ` [PATCH v5 08/28] drm/msm/mdss: " Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Same for MDSS display driver.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/adreno: use new helper to set macrotile_mode
2026-05-20 14:51 ` [PATCH v5 09/28] drm/msm/adreno: use new helper to set macrotile_mode Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Migrates the adreno getparam path to use `qcom_ubwc_macrotile_mode()`.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/mdss: use new helper to set macrotile_mode
2026-05-20 14:51 ` [PATCH v5 10/28] drm/msm/mdss: " Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
MDSS driver migration. Replaces `data->macrotile_mode` with `qcom_ubwc_macrotile_mode(data)`.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/mdss: use new helper to set UBWC bank spreading
2026-05-20 14:51 ` [PATCH v5 11/28] drm/msm/mdss: use new helper to set UBWC bank spreading Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Replaces `data->ubwc_bank_spread` with `qcom_ubwc_bank_spread(data)`.
```c
- if (data->ubwc_bank_spread)
+ if (qcom_ubwc_bank_spread(data))
```
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/adreno: use new helper to set ubwc_swizzle
2026-05-20 14:51 ` [PATCH v5 12/28] drm/msm/adreno: use new helper to set ubwc_swizzle Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Migrates a6xx, a8xx, and adreno_gpu.c to use `qcom_ubwc_swizzle()` instead of `cfg->ubwc_swizzle`.
```c
- u32 level2_swizzling_dis = !(cfg->ubwc_swizzle & UBWC_SWIZZLE_ENABLE_LVL2);
+ u32 level2_swizzling_dis = !(qcom_ubwc_swizzle(cfg) & UBWC_SWIZZLE_ENABLE_LVL2);
```
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/dpu: use new helper to set ubwc_swizzle
2026-05-20 14:51 ` [PATCH v5 13/28] drm/msm/dpu: " Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
DPU SSPP migration. Replaces `ctx->ubwc->ubwc_swizzle` with `qcom_ubwc_swizzle(ctx->ubwc)` and switches from raw `& 0x1` to the symbolic `& UBWC_SWIZZLE_ENABLE_LVL1`.
```c
- ctrl_val = fast_clear | (ctx->ubwc->ubwc_swizzle & 0x1) |
+ ctrl_val = fast_clear |
+ (qcom_ubwc_swizzle(ctx->ubwc) & UBWC_SWIZZLE_ENABLE_LVL1) |
```
Good cleanup replacing the magic `0x1` with the named constant.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/mdss: use new helper to set ubwc_swizzle
2026-05-20 14:51 ` [PATCH v5 14/28] drm/msm/mdss: " Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
MDSS migration. Replaces `data->ubwc_swizzle` with `qcom_ubwc_swizzle(data)`.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/adreno: write reserved UBWC-related bits
2026-05-20 14:51 ` [PATCH v5 15/28] drm/msm/adreno: write reserved UBWC-related bits Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Adds missing feature flags for UBWC_6_0 in the a8xx driver:
```c
case UBWC_6_0:
amsbc = true;
rgb565_predicator = true;
break;
```
This is a bugfix/feature addition, not just a refactor. Good to include here before the switch-to-if-else conversion.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/adreno: set fp16compoptdis for UBWC 3.0 formats
2026-05-20 14:51 ` [PATCH v5 16/28] drm/msm/adreno: set fp16compoptdis for UBWC 3.0 formats Dmitry Baryshkov
@ 2026-05-25 11:41 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:41 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Adds `fp16compoptdis = true` for the `UBWC_3_0` case in a8xx:
```c
case UBWC_3_0:
amsbc = true;
+ fp16compoptdis = true;
break;
```
Another correctness fix bundled with the refactoring series.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/adreno: use new helper to set amsbc
2026-05-20 14:51 ` [PATCH v5 17/28] drm/msm/adreno: use new helper to set amsbc Dmitry Baryshkov
@ 2026-05-25 11:42 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:42 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Replaces `amsbc = true` from each switch case with `amsbc = qcom_ubwc_enable_amsbc(cfg)` at initialization:
```c
- bool rgb565_predicator = false, amsbc = false;
+ bool rgb565_predicator = false;
+ bool amsbc = qcom_ubwc_enable_amsbc(cfg);
```
And removes the per-case `amsbc = true` lines. This depends on patch 15 having already added amsbc for UBWC_6_0, and patch 3 defining the helper as `>= UBWC_3_0`. Correct.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/adreno: use version ranges in A8xx UBWC code
2026-05-20 14:51 ` [PATCH v5 18/28] drm/msm/adreno: use version ranges in A8xx UBWC code Dmitry Baryshkov
@ 2026-05-25 11:42 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:42 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Converts the a8xx switch statement to version-range if/else chains:
```c
- switch (ubwc_version) {
- case UBWC_6_0:
+ if (ubwc_version > UBWC_6_0)
+ dev_err(...)
+ if (ubwc_version == UBWC_6_0)
yuvnotcomptofc = true;
+ if (ubwc_version < UBWC_5_0 &&
+ ubwc_version >= UBWC_4_0)
rgba8888_lossless = true;
+ if (ubwc_version < UBWC_4_3)
fp16compoptdis = true;
+ if (cfg->ubwc_enc_version >= UBWC_4_0)
rgb565_predicator = true;
```
**Minor nit:** The code mixes `ubwc_version` (a local variable) with `cfg->ubwc_enc_version` for the `rgb565_predicator` check. This is semantically equivalent since `ubwc_version = cfg->ubwc_enc_version`, but inconsistent style within the same function. Not a bug, but worth noting.
The range-based approach is better for forward compatibility -- new minor versions won't fall through to the `default` error case.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/mdss: use new helper to set amsbc
2026-05-20 14:51 ` [PATCH v5 19/28] drm/msm/mdss: use new helper to set amsbc Dmitry Baryshkov
@ 2026-05-25 11:42 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:42 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
```c
- if (data->ubwc_enc_version == UBWC_3_0)
+ if (qcom_ubwc_enable_amsbc(data))
value |= MDSS_UBWC_STATIC_UBWC_AMSBC;
```
**Note:** This changes behavior -- the old code only set AMSBC for exactly UBWC_3_0 in the MDSS `5x_setup_ubwc` path. The helper returns `>= UBWC_3_0`, which would include UBWC_4_0+ if such SoCs ever used the 5x setup path. This is correct because the 5x setup path is only used by older SoCs, and the change aligns it with how GPU drivers already treat amsbc.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/dpu: drop ubwc_dec_version
2026-05-20 14:51 ` [PATCH v5 20/28] drm/msm/dpu: drop ubwc_dec_version Dmitry Baryshkov
@ 2026-05-25 11:42 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:42 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Removes the `ubwc_dec_version` check from `dpu_plane_format_mod_supported()`:
```c
- bool has_no_ubwc = (dpu_kms->mdss->ubwc_enc_version == 0) &&
- (dpu_kms->mdss->ubwc_dec_version == 0);
+ bool has_no_ubwc = (dpu_kms->mdss->ubwc_enc_version == 0);
```
Reasonable simplification. The enc and dec versions are always both zero or both nonzero for real SoCs.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: drm/msm/dpu: invert the order of UBWC checks
2026-05-20 14:51 ` [PATCH v5 21/28] drm/msm/dpu: invert the order of UBWC checks Dmitry Baryshkov
@ 2026-05-25 11:42 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:42 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Inverts the DPU SSPP UBWC version checks from exact-match ascending to `>=` descending:
```c
- if (ctx->ubwc->ubwc_enc_version == UBWC_1_0) {
+ if (ctx->ubwc->ubwc_enc_version > UBWC_6_0) {
+ DRM_WARN_ONCE("Unsupported UBWC version %x\n", ...);
+ } else if (ctx->ubwc->ubwc_enc_version >= UBWC_5_0) {
...
+ } else if (ctx->ubwc->ubwc_enc_version >= UBWC_1_0) {
```
Good change. The old exact-match pattern would silently fall through for any minor version (like UBWC_3_1). The inverted `>=` chain handles new minor versions transparently. Also adds a `DRM_WARN_ONCE` for versions above 6.0.
**Note:** initializes `ctrl_val = 0` at declaration, which is needed because the new code flow may reach the write without going through any branch (if `> UBWC_6_0`). Correct.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: soc: qcom: ubwc: set min_acc length to 64 for all UBWC 1.0 targets
2026-05-20 14:51 ` [PATCH v5 22/28] soc: qcom: ubwc: set min_acc length to 64 for all UBWC 1.0 targets Dmitry Baryshkov
@ 2026-05-25 11:42 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:42 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Simplifies `qcom_ubwc_min_acc_length_64b()`:
```c
- return cfg->ubwc_enc_version == UBWC_1_0 &&
- (cfg->ubwc_dec_version == UBWC_2_0 ||
- cfg->ubwc_dec_version == UBWC_3_0);
+ return cfg->ubwc_enc_version == UBWC_1_0;
```
Justified by documentation saying MAL should be set for all UBWC 1.0 targets. The old check was a "best guess" inherited from the MDSS driver. Since `ubwc_dec_version` is being removed, this needs to happen.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: soc: qcom: ubwc: drop ubwc_dec_version
2026-05-20 14:51 ` [PATCH v5 23/28] soc: qcom: ubwc: drop ubwc_dec_version Dmitry Baryshkov
@ 2026-05-25 11:42 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:42 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Removes `ubwc_dec_version` from `qcom_ubwc_cfg_data` and all per-SoC entries. The field was display-subsystem-specific and not meaningful to other UBWC consumers.
Large mechanical deletion -- 23 lines removed from ubwc_config.c, 2 from ubwc.h. Depends on patches 20 and 22 having removed all consumers.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: soc: qcom: ubwc: drop ubwc_bank_spread
2026-05-20 14:51 ` [PATCH v5 24/28] soc: qcom: ubwc: drop ubwc_bank_spread Dmitry Baryshkov
@ 2026-05-25 11:42 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:42 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Removes `ubwc_bank_spread` from the struct and makes `qcom_ubwc_bank_spread()` unconditionally return `true`:
```c
- return cfg->ubwc_bank_spread;
+ return true;
```
Justified by documentation saying bank spread should be enabled for all targets. All existing entries had `ubwc_bank_spread = true`, so this is a no-op in practice.
No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: soc: qcom: ubwc: drop macrotile_mode from the database
2026-05-20 14:51 ` [PATCH v5 25/28] soc: qcom: ubwc: drop macrotile_mode from the database Dmitry Baryshkov
@ 2026-05-25 11:42 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:42 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Changes `qcom_ubwc_macrotile_mode()` to derive the value from version:
```c
return cfg->ubwc_enc_version >= UBWC_3_1;
```
This is where `UBWC_3_1` from patch 01 becomes critical. Several SoCs are reclassified:
- sc7280: UBWC_3_0 -> UBWC_3_1 (had `macrotile_mode = true`)
- sc8180x: UBWC_3_0 -> UBWC_3_1 (had `macrotile_mode = true`)
- sar2130p: UBWC_3_0 -> UBWC_3_1 (had `macrotile_mode = true`)
While sm8150 stays at UBWC_3_0 (had no macrotile_mode). The version change correctly captures the macrotile_mode distinction. This is the most important semantic change in the series.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: soc: qcom: ubwc: use fixed values for UBWC swizzle for UBWC < 4.0
2026-05-20 14:51 ` [PATCH v5 26/28] soc: qcom: ubwc: use fixed values for UBWC swizzle for UBWC < 4.0 Dmitry Baryshkov
@ 2026-05-25 11:42 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:42 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Moves swizzle constants into `qcom_ubwc_swizzle()`:
```c
if (cfg->ubwc_enc_version == UBWC_1_0)
return UBWC_SWIZZLE_ENABLE_LVL1 | UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3;
if (cfg->ubwc_enc_version < UBWC_4_0)
return UBWC_SWIZZLE_ENABLE_LVL2 | UBWC_SWIZZLE_ENABLE_LVL3;
return cfg->ubwc_swizzle;
```
Removes `ubwc_swizzle` from all per-SoC entries with UBWC < 4.0. The `UBWC_SWIZZLE_ENABLE_*` defines are moved below the struct (they were previously part of the struct's field documentation). The fallthrough to `cfg->ubwc_swizzle` handles UBWC >= 4.0 where per-SoC variation remains.
Also removes the `qcom_ubwc_get_ubwc_mode` cross-check that warned about UBWC 1.0 configs missing LVL1 swizzle -- no longer possible since the helper always returns it.
Clean and correct.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: soc: qcom: ubwc: sort out the rest of the UBWC swizzle settings
2026-05-20 14:51 ` [PATCH v5 27/28] soc: qcom: ubwc: sort out the rest of the UBWC swizzle settings Dmitry Baryshkov
@ 2026-05-25 11:42 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:42 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Replaces `ubwc_swizzle` field entirely with `flags`:
```c
- u32 ubwc_swizzle;
+ unsigned int flags;
+#define UBWC_FLAG_DISABLE_SWIZZLE_LVL2 BIT(0)
+#define UBWC_FLAG_DISABLE_SWIZZLE_LVL3 BIT(1)
```
The `qcom_ubwc_swizzle()` helper now defaults to LVL2|LVL3 enabled and only clears bits if the corresponding `UBWC_FLAG_DISABLE_*` is set. Only two SoCs need flags: `sa8775p` (disables LVL2) and `glymur` (disables both).
This is a much cleaner representation. The default-enabled-with-opt-out pattern reduces the number of SoCs that need to specify anything.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
* Claude review: soc: qcom: ubwc: deduplicate UBWC configuration data
2026-05-20 14:51 ` [PATCH v5 28/28] soc: qcom: ubwc: deduplicate UBWC configuration data Dmitry Baryshkov
@ 2026-05-25 11:42 ` Claude Code Review Bot
0 siblings, 0 replies; 58+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 11:42 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
The payoff patch. Replaces 30+ per-SoC `_data` structs with ~15 generic entries named by version and HBB:
```c
static const struct qcom_ubwc_cfg_data ubwc_1_0_hbb14 = {
.ubwc_enc_version = UBWC_1_0,
.highest_bank_bit = 14,
};
```
The `of_device_id` table now maps directly to these generics:
```c
{ .compatible = "qcom,msm8937", .data = &ubwc_1_0_hbb14 },
{ .compatible = "qcom,sm8250", .data = &ubwc_4_0_hbb16 },
```
Only `sa8775p` and `glymur` retain custom structs (due to their flags). The diff is -120/+76 lines, a net reduction of 44 lines despite adding new generic entries.
**Minor note:** There's a trailing double space in `ubwc_3_1_hbb14` and `ubwc_3_1_hbb16` declarations (cosmetic).
Good final patch that demonstrates the series achieved its goal.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 58+ messages in thread
end of thread, other threads:[~2026-05-25 11:42 UTC | newest]
Thread overview: 58+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-20 14:51 [PATCH v5 00/28] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
2026-05-20 14:51 ` [PATCH v5 01/28] soc: qcom: ubwc: define UBWC 3.1 Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 02/28] soc: qcom: ubwc: define helper for MDSS and Adreno drivers Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 03/28] soc: qcom: ubwc: add helper controlling AMSBC enablement Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 04/28] drm/msm/adreno: Trust the SSoT UBWC config Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 05/28] drm/msm/adreno: use qcom_ubwc_version_tag() helper Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 06/28] drm/msm/mdss: " Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 07/28] drm/msm/adreno: use new helper to set min_acc length Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 08/28] drm/msm/mdss: " Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 09/28] drm/msm/adreno: use new helper to set macrotile_mode Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 10/28] drm/msm/mdss: " Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 11/28] drm/msm/mdss: use new helper to set UBWC bank spreading Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 12/28] drm/msm/adreno: use new helper to set ubwc_swizzle Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 13/28] drm/msm/dpu: " Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 14/28] drm/msm/mdss: " Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 15/28] drm/msm/adreno: write reserved UBWC-related bits Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 16/28] drm/msm/adreno: set fp16compoptdis for UBWC 3.0 formats Dmitry Baryshkov
2026-05-25 11:41 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 17/28] drm/msm/adreno: use new helper to set amsbc Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 18/28] drm/msm/adreno: use version ranges in A8xx UBWC code Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 19/28] drm/msm/mdss: use new helper to set amsbc Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 20/28] drm/msm/dpu: drop ubwc_dec_version Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 21/28] drm/msm/dpu: invert the order of UBWC checks Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 22/28] soc: qcom: ubwc: set min_acc length to 64 for all UBWC 1.0 targets Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 23/28] soc: qcom: ubwc: drop ubwc_dec_version Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 24/28] soc: qcom: ubwc: drop ubwc_bank_spread Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 25/28] soc: qcom: ubwc: drop macrotile_mode from the database Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 26/28] soc: qcom: ubwc: use fixed values for UBWC swizzle for UBWC < 4.0 Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 27/28] soc: qcom: ubwc: sort out the rest of the UBWC swizzle settings Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-20 14:51 ` [PATCH v5 28/28] soc: qcom: ubwc: deduplicate UBWC configuration data Dmitry Baryshkov
2026-05-25 11:42 ` Claude review: " Claude Code Review Bot
2026-05-25 11:41 ` Claude review: soc/qcom/ubwc: rework UBWC configuration database Claude Code Review Bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox