From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: soc/qcom/ubwc: rework UBWC configuration database
Date: Mon, 09 Mar 2026 08:32:14 +1000 [thread overview]
Message-ID: <review-overall-20260306-ubwc-rework-v1-0-9cfdff12f2bb@oss.qualcomm.com> (raw)
In-Reply-To: <20260306-ubwc-rework-v1-0-9cfdff12f2bb@oss.qualcomm.com>
Overall Series Review
Subject: soc/qcom/ubwc: rework UBWC configuration database
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patches: 25
Reviewed: 2026-03-09T08:32:14.521907
---
This 24-patch series by Dmitry Baryshkov (with one patch from Konrad Dybcio) systematically reworks the Qualcomm UBWC configuration database to establish the UBWC encoder version as the single source of truth from which all other UBWC parameters can be derived. The series follows a clean and well-structured approach:
1. **Foundation patches** (1-3): Fix MDSS UBWC programming to use HW revision instead of decoder version, define UBWC 3.1, and add helper functions.
2. **Driver migration** (4-13): Move all consumers (Adreno GPU, MDSS, DPU) to use the new helpers instead of raw struct fields.
3. **UBWC 3.1 adaptation** (14-17): Extend drivers to handle the newly-defined UBWC 3.1 version.
4. **Database simplification** (18-24): Progressively remove fields from `qcom_ubwc_cfg_data` (`ubwc_dec_version`, `ubwc_bank_spread`, `macrotile_mode`, `ubwc_swizzle`) and deduplicate the resulting identical configs.
**Strengths:**
- Well-ordered decomposition; each patch is self-contained and bisectable
- The end result dramatically simplifies `qcom_ubwc_cfg_data` from 6+ fields down to just `ubwc_enc_version`, `highest_bank_bit`, and `flags`
- The config database shrinks from ~22 per-SoC entries to ~14 generic entries, reducing maintenance burden
- Good use of inline helpers to derive values from the UBWC version, keeping the logic close to the header
- Patch 01 carries an appropriate Fixes tag for the incorrect decoder-version-based UBWC setup
**Concerns:**
1. **Patch 01 behavioral change in `msm_mdss_setup_ubwc_v4`**: The v4 function (MDSS HW rev 4.x) drops `ubwc_bank_spread` and masks swizzle with `& 0x1`, while the v5 function adds them. This is described as "correct" but the commit message doesn't fully explain why the old dec_20 function had bank_spread while the new v4 does not. More explanation of the MDSS HW register differences would be helpful.
2. **Patch 01 version-to-tag ladder duplication**: The version-to-tag ladder in `msm_mdss_setup_ubwc_v6` is immediately extracted to `qcom_ubwc_version_tag()` in patch 03/05, but patch 01 introduces it inline first. This creates transient code duplication. The series would be cleaner if the helper were introduced before or alongside patch 01.
3. **Patch 05 drops `UBWC_CTRL_2` write**: In the MDSS v6 setup, patch 05 removes the `writel_relaxed(ver, ...)` to `REG_MDSS_UBWC_CTRL_2` but keeps the `prediction_mode` write. This appears to be a bug -- the version tag should still be written to the register. The `qcom_ubwc_version_tag()` helper was called in the A8xx GPU path, but the MDSS path lost its CTRL_2 write entirely.
4. **UBWC 3.1 handling in `a8xx_set_ubwc_config`**: The switch statement in a8xx only has cases for `UBWC_3_0`, `UBWC_4_0`, `UBWC_5_0`, `UBWC_6_0`. After patch 15 introduces UBWC 3.1 for Adreno, `UBWC_3_1` would fall through to the `default` error case. This needs a `case UBWC_3_1:` added alongside `UBWC_3_0`.
5. **`qcom_ubwc_swizzle()` C99 mixed declarations**: The final version of `qcom_ubwc_swizzle()` declares `u32 ubwc_swizzle` after the early returns for UBWC 0 and UBWC 1.0. While this is valid C99/C11 and accepted by the kernel since 5.18, it's worth noting for style consistency.
6. **Lost TODO comments**: Patch 24 drops the `/* TODO: highest_bank_bit = 15 for LP_DDR4 */` comments from several configs during deduplication. These were reminders that the HBB should ideally use DRAM type detection. The comment on `highest_bank_bit` in the struct definition mentions this, but the per-SoC reminders are gone.
7. **Merge strategy**: The cover letter notes dependency on other SoC/UBWC patches going through linux-media. The proposed immutable tag approach is sensible but adds coordination overhead.
**Overall**: This is solid refactoring work that significantly improves the UBWC configuration architecture. The potential regression in patch 05 (missing UBWC_CTRL_2 write) needs investigation. With that addressed, the series is in good shape.
---
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-08 22:32 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 16:47 [PATCH 00/24] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
2026-03-06 16:47 ` [PATCH 01/24] drm/msm/mdss: correct UBWC programming sequences Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 02/24] soc: qcom: ubwc: define UBWC 3.1 Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 03/24] soc: qcom: ubwc: define helper for MDSS and Adreno drivers Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 04/24] drm/msm/adreno: Trust the SSoT UBWC config Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 05/24] drm/msm/adreno: use qcom_ubwc_version_tag() helper Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 06/24] drm/msm/adreno: use new helper to set min_acc length Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 07/24] drm/msm/mdss: " Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 08/24] drm/msm/adreno: use new helper to set macrotile_mode Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 09/24] drm/msm/mdss: " Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 10/24] drm/msm/mdss: use new helper to set UBWC bank spreading Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 11/24] drm/msm/adreno: use new helper to set ubwc_swizzle Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 12/24] drm/msm/dpu: " Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 13/24] drm/msm/mdss: " Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 14/24] drm/msm/dpu: drop ubwc_dec_version Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 15/24] drm/msm/adreno: adapt for UBWC 3.1 support Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 16/24] drm/msm/mdss: " Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 17/24] drm/msm/dpu: " Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 18/24] soc: qcom: ubwc: set min_acc length to 64 for all UBWC 1.0 targets Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 19/24] soc: qcom: ubwc: drop ubwc_dec_version Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 20/24] soc: qcom: ubwc: drop ubwc_bank_spread Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 21/24] soc: qcom: ubwc: drop macrotile_mode from the database Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 22/24] soc: qcom: ubwc: use fixed values for UBWC swizzle for UBWC < 4.0 Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 23/24] soc: qcom: ubwc: sort out the rest of the UBWC swizzle settings Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-06 16:47 ` [PATCH 24/24] soc: qcom: ubwc: deduplicate UBWC configuration data Dmitry Baryshkov
2026-03-08 22:32 ` Claude review: " Claude Code Review Bot
2026-03-08 22:32 ` Claude Code Review Bot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-03-11 3:22 [PATCH v2 00/25] soc/qcom/ubwc: rework UBWC configuration database Dmitry Baryshkov
2026-03-11 21:21 ` Claude review: " Claude Code Review Bot
2026-03-12 13:29 [PATCH v3 00/27] " Dmitry Baryshkov
2026-03-13 4:12 ` Claude review: " Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-overall-20260306-ubwc-rework-v1-0-9cfdff12f2bb@oss.qualcomm.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox