From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/msm/dpu: calculate data_width like downstream
Date: Wed, 25 Mar 2026 08:12:58 +1000 [thread overview]
Message-ID: <review-patch1-20260322-fix-data-width-calc-v2-1-d5f28136bc4e@pm.me> (raw)
In-Reply-To: <20260322-fix-data-width-calc-v2-1-d5f28136bc4e@pm.me>
Patch Review
**Positive aspects:**
- Uses the established `msm_dsc_get_bytes_per_line()` helper already used in `dsi_host.c`, maintaining consistency.
- `DIV_ROUND_UP` is the right choice to avoid off-by-one truncation in the data width.
- The `dce_bytes_per_line` field is properly zero-initialized (struct uses `= { 0 }`) and only read when `compression_en` is set.
- The expanded comment block is a welcome improvement over the previous terse comment.
**Concern — widebus video mode divisor:**
In `dsi_host.c:1028-1035`, the widebus divisor for DSC depends on the mode:
```c
if (wide_bus_enabled && !(msm_host->mode_flags & MIPI_DSI_MODE_VIDEO))
bytes_per_pclk = 6;
else
bytes_per_pclk = 3;
```
For **video mode** with widebus, DSI host uses `bytes_per_pclk = 3` (not 6). But this patch (which is in `dpu_encoder_phys_vid.c`, i.e., video mode only) divides by 6 when widebus is enabled:
```c
if (p->wide_bus_en)
data_width = DIV_ROUND_UP(p->dce_bytes_per_line, 6);
```
These are admittedly computing different things (DSI packet timing vs. INTF data validity window), so this may be intentional and correct for the INTF hardware — but the reviewer should verify that the INTF timing engine truly expects the `data_width` to be halved for widebus even in video mode with DSC. It would be worth having a comment explaining why the INTF widebus behavior differs from the DSI host here, or citing the downstream source/hardware documentation that confirms the divide-by-6.
**Minor — commit message could be more specific:**
The commit message says "calculate data_width like downstream" but doesn't explain *what was wrong* with the existing calculation. A sentence like "The existing formula using `drm_dsc_get_bpp_int()` loses fractional BPP precision and doesn't account for actual slice geometry" would help reviewers understand the motivation.
**Nit — the "TODO: handle DSC+DP" comment is retained but could be updated:**
The comment at line 184 (`/* TODO: handle DSC+DP case... */`) still refers to the old behavior. Since this patch explicitly skips DP (`!dp_intf`) in the new compression branch, the TODO is still valid, but it might be worth noting in the commit message that DSC+DP remains unhandled.
**Summary:** The patch is a logical improvement, aligning the INTF data width calculation with the downstream approach using actual DSC byte counts. The main point to verify is whether the divide-by-6 for widebus video mode is correct for the INTF timing engine, given that the DSI host uses divide-by-3 for the same scenario.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-24 22:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-22 18:48 [PATCH v2] drm/msm/dpu: calculate data_width like downstream Alexander Koskovich
2026-03-24 0:23 ` Dmitry Baryshkov
2026-03-24 13:11 ` Pengyu Luo
2026-03-24 22:12 ` Claude review: " Claude Code Review Bot
2026-03-24 22:12 ` Claude Code Review Bot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-03-22 14:31 [PATCH RFC] " Alexander Koskovich
2026-03-24 22:16 ` Claude review: " Claude Code Review Bot
2026-03-24 22:16 ` 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-patch1-20260322-fix-data-width-calc-v2-1-d5f28136bc4e@pm.me \
--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