From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/vmwgfx: Convert to DRM vblank timers
Date: Tue, 28 Apr 2026 14:31:51 +1000 [thread overview]
Message-ID: <review-patch3-20260427150250.699768-4-tzimmermann@suse.de> (raw)
In-Reply-To: <20260427150250.699768-4-tzimmermann@suse.de>
Patch Review
**Purpose:** The actual conversion — removes custom hrtimer code and wires up the DRM vblank timer infrastructure.
**Assessment: Looks good overall, with one style nit.**
**Key changes reviewed:**
1. **`vmwgfx_kms.h`**: Removal of `hrtimer timer` and `ktime_t period_ns` from the `vkms` struct in `vmw_display_unit` — correct, these are now managed by the DRM vblank timer infrastructure inside `drm_vblank_crtc`.
2. **LDU/SCRN/STDU helper_funcs**: All three display backends wire up `.handle_vblank_timeout = vmw_vkms_handle_vblank_timeout`. This is the DRM callback that gets invoked by the shared timer.
3. **`vmw_vkms_get_vblank_timestamp()`**: Replaced the manual timestamp calculation with `drm_crtc_vblank_get_vblank_timeout(crtc, vblank_time)`. The shared implementation in `drm_vblank.c:2285` handles the `!vblank->enabled` case, the race-safe count+time read loop, and the one-frame correction — all of which were done (less robustly) inline before. This is a clear improvement.
4. **`vmw_vkms_enable_vblank()`**: Replaced `hrtimer_setup()` + `hrtimer_start()` with `drm_crtc_vblank_start_timer(crtc)`. The shared function calls `drm_calc_timestamping_constants()` internally, so the explicit call is correctly removed.
5. **`vmw_vkms_disable_vblank()`**: Replaced `hrtimer_cancel()` with `drm_crtc_vblank_cancel_timer()`. Note: the shared cancel uses `hrtimer_try_to_cancel()` (non-blocking) plus an interval-zeroing approach to avoid deadlocks, which is actually better than the old `hrtimer_cancel()` (blocking). The `du->vkms.period_ns = ktime_set(0, 0)` clear is correctly removed since the period is now tracked internally.
6. **`vmw_vkms_crtc_cleanup()`**: The v2 fix: only cancels the timer when `vmw->vkms_enabled` is true. This prevents calling into the vblank timer infrastructure when it was never initialized. Good fix addressing Zack's review feedback.
7. **`vmwgfx_vkms.h`**: Removal of `#include <linux/hrtimer_types.h>` — correct, no longer needed.
**Style nit:** The `.handle_vblank_timeout` lines in ldu/scrn/stdu use double space before `=`:
```c
.handle_vblank_timeout = vmw_vkms_handle_vblank_timeout,
```
This appears to be intentional alignment with the other fields, but the surrounding fields use single-space (e.g., `.atomic_flush = ...`). This is very minor and not worth a respin.
**No functional issues found.**
---
**Summary:** Series is well-structured, the conversion is correct, and the v2 fixes address the previous review feedback. The shared DRM vblank timer provides better race handling in the timestamp calculation than the old open-coded version. Reviewed-by worthy.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-28 4:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 15:00 [PATCH v2 0/3] drm/vmwgfx: Use DRM's vblank timer Thomas Zimmermann
2026-04-27 15:00 ` [PATCH v2 1/3] drm/vmwgfx: Determine lock-waiting timeout from vblank state Thomas Zimmermann
2026-04-28 4:31 ` Claude review: " Claude Code Review Bot
2026-04-27 15:00 ` [PATCH v2 2/3] drm/vmwgfx: Move vblank handling into separate helper Thomas Zimmermann
2026-04-28 4:31 ` Claude review: " Claude Code Review Bot
2026-04-27 15:00 ` [PATCH v2 3/3] drm/vmwgfx: Convert to DRM vblank timers Thomas Zimmermann
2026-04-28 4:31 ` Claude Code Review Bot [this message]
2026-04-28 4:31 ` Claude review: drm/vmwgfx: Use DRM's vblank timer 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-patch3-20260427150250.699768-4-tzimmermann@suse.de \
--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