From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm: verisilicon: add support for cursor planes
Date: Wed, 25 Mar 2026 07:03:51 +1000 [thread overview]
Message-ID: <review-patch2-20260324060222.2029061-3-zhengxingda@iscas.ac.cn> (raw)
In-Reply-To: <20260324060222.2029061-3-zhengxingda@iscas.ac.cn>
Patch Review
**Bug: Missing `FIELD_PREP`/shift for X_OFF and Y_OFF values**
When writing negative offsets to the CONFIG register:
```c
regmap_update_bits(dc->regs, VSDC_CURSOR_CONFIG(output),
VSDC_CURSOR_CONFIG_X_OFF_MASK,
-state->crtc_x);
```
The X_OFF field is at bits [20:16] (`GENMASK(20, 16)`), but the raw value `-state->crtc_x` is not shifted. It should use the defined `VSDC_CURSOR_CONFIG_X_OFF(v)` macro:
```c
VSDC_CURSOR_CONFIG_X_OFF(-state->crtc_x)
```
Same issue for Y_OFF at bits [12:8]:
```c
regmap_update_bits(dc->regs, VSDC_CURSOR_CONFIG(output),
VSDC_CURSOR_CONFIG_Y_OFF_MASK,
-state->crtc_y);
```
Should be `VSDC_CURSOR_CONFIG_Y_OFF(-state->crtc_y)`. Without these shifts, the offset value lands in the wrong bit positions (bits [4:0] instead of [20:16] for X, and [4:0] instead of [12:8] for Y), corrupting other fields in the CONFIG register.
**Issue: `mode_config.cursor_width/height` not set**
The DRM core exposes cursor size limits to userspace via `drm_mode_config.cursor_width` and `cursor_height`. These are not set anywhere in the driver (checked `vs_drm.c`). Without this, userspace won't know the maximum cursor size. This should be set in the mode_config init, e.g.:
```c
drm_dev->mode_config.cursor_width = dc->identity.max_cursor_size;
drm_dev->mode_config.cursor_height = dc->identity.max_cursor_size;
```
**Nit: Typos in register header**
```c
#define VSDC_CURSOR_BACKGRUOND_DEFAULT 0x00FFFFFF
#define VSDC_CURSOR_FOREGRUOND_DEFAULT 0x00AAAAAA
```
`BACKGRUOND` and `FOREGRUOND` should be `BACKGROUND` and `FOREGROUND`. These macros are currently unused but should be fixed before they get used.
**Nit: Comment typo**
```c
* To for positive left-top coordinates the
```
Should read "For positive left-top coordinates the" (remove "To", fix double space).
**Nit: `atomic_update` calls `atomic_disable` directly**
```c
if (!state->visible) {
vs_cursor_plane_atomic_disable(plane, atomic_state);
return;
}
```
This works but is unusual — normally `atomic_disable` is only called by the DRM core. The DRM atomic helper should call `atomic_disable` when the plane becomes invisible, so this explicit call may be redundant. Worth verifying that the DRM helpers handle this transition correctly for cursor planes, or if this is an intentional workaround.
**Style: `ERR_PTR(PTR_ERR(primary))` vs `ERR_CAST`**
In the existing code at `vs_crtc.c:175`:
```c
return ERR_PTR(PTR_ERR(primary));
```
The new cursor error path correctly uses `ERR_CAST(cursor)`. The pre-existing primary path should also use `ERR_CAST` for consistency, though that's outside the scope of this series.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-24 21:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 6:02 [PATCH -next v2 0/2] drm: verisilicon: add hardware cursor support Icenowy Zheng
2026-03-24 6:02 ` [PATCH -next v2 1/2] drm: verisilicon: add max cursor size to HWDB Icenowy Zheng
2026-03-24 21:03 ` Claude review: " Claude Code Review Bot
2026-03-24 6:02 ` [PATCH -next v2 2/2] drm: verisilicon: add support for cursor planes Icenowy Zheng
2026-03-24 21:03 ` Claude Code Review Bot [this message]
2026-03-24 21:03 ` Claude review: drm: verisilicon: add hardware cursor support Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-03-09 8:53 [PATCH -next 0/2] " Icenowy Zheng
2026-03-09 8:53 ` [PATCH -next 2/2] drm: verisilicon: add support for cursor planes Icenowy Zheng
2026-03-10 2:36 ` 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-patch2-20260324060222.2029061-3-zhengxingda@iscas.ac.cn \
--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