From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/i915/dp: Decode dsc max delta bpp from sink dpcd
Date: Thu, 28 May 2026 12:24:08 +1000 [thread overview]
Message-ID: <review-patch4-20260527110849.3943338-5-nemesa.garg@intel.com> (raw)
In-Reply-To: <20260527110849.3943338-5-nemesa.garg@intel.com>
Patch Review
**Issues found:**
1. **Out-of-range delta value produces garbage.** When the delta value falls outside the valid range, `max_bpp` retains its raw DPCD field value (unscaled), which then gets shifted left by 4 and returned:
```c
case INTEL_OUTPUT_FORMAT_RGB:
case INTEL_OUTPUT_FORMAT_YCBCR444:
max_bpp = max_bpp_delta_v1 & DP_DSC_RGB_YCbCr444_MAX_BPP_DELTA_MASK;
if (max_bpp >= 1 && max_bpp <= 21)
max_bpp = max_bpp + DP_DSC_BPP_DELTA_444 - 1;
break;
```
If `max_bpp` is 0, the function returns 0 (fine, interpreted as "not available"). But if `max_bpp` is > 21 (values 22-31 for the 5-bit field), the raw field value is returned as a bpp, which is nonsensical. The same applies to the 420 case when `max_bpp` > 7. The function should either return 0 for reserved/invalid values, or clamp. Returning the raw DPCD field value as a bpp is almost certainly wrong.
2. **Superfluous double spaces.** Minor style nit: there are double spaces in two places:
```c
max_bpp = max_bpp_delta_v1 & DP_DSC_RGB_YCbCr444_MAX_BPP_DELTA_MASK;
max_bpp = max_bpp + DP_DSC_BPP_DELTA_444 - 1;
```
3. **No handling for YCBCR422.** The function handles RGB, YCbCr444, and YCbCr420 but not YCbCr422, even though patch 3 added the 422 mask and delta constant. The `default: MISSING_CASE()` path will fire if `INTEL_OUTPUT_FORMAT_YCBCR422` is ever passed. This is arguably fine for now (if 422 isn't used in this code path), but is worth noting since the header constants were clearly added with 422 in mind.
4. **The delta-to-bpp conversion semantics should be documented.** The formula `max_bpp = raw_delta + base - 1` is non-obvious. A brief comment explaining what the delta values represent per the DP spec (e.g., "delta of N maps to max bpp of N + 15 for 444") would help future readers understand the magic numbers 16 and 12.
5. **Commit message mentions `DP_DSC_MAX_BPP_DELTA` but the code uses `DP_DSC_MAX_BPP_DELTA_VERSION_1`.** The commit message references the old unversioned name. Minor, but should be consistent.
---
**Summary:** The main issues are the out-of-range delta value bug in patch 4 (which can return a nonsensical bpp value), and the misplacement of the YCbCr422 mask in patch 3 (placed under the wrong register). Both should be fixed before merging.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-28 2:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 11:08 [PATCH 0/4] DSC max delta bpp support Nemesa Garg
2026-05-27 11:08 ` [PATCH 1/4] drm/dp: Add DP_DSC_MAX_BPP_DELTA register Nemesa Garg
2026-05-28 2:24 ` Claude review: " Claude Code Review Bot
2026-05-27 11:08 ` [PATCH 2/4] drm/dp: Rename YCbCr420 bpp delta mask to native Nemesa Garg
2026-05-28 2:24 ` Claude review: " Claude Code Review Bot
2026-05-27 11:08 ` [PATCH 3/4] drm/dp: Add max bpp delta computation constants Nemesa Garg
2026-05-28 2:24 ` Claude review: " Claude Code Review Bot
2026-05-27 11:08 ` [PATCH 4/4] drm/i915/dp: Decode dsc max delta bpp from sink dpcd Nemesa Garg
2026-05-28 2:24 ` Claude Code Review Bot [this message]
2026-05-28 2:24 ` Claude review: DSC max delta bpp support Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-04-20 11:26 [PATCH 0/2] " Nemesa Garg
2026-04-20 11:26 ` [PATCH 2/2] drm/i915/dp: Decode DSC max delta bpp from sink DPCD Nemesa Garg
2026-04-23 0:06 ` 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-patch4-20260527110849.3943338-5-nemesa.garg@intel.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