public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/vblank: Add DRM_VBLANK_FLAG_SIMULATED
Date: Thu, 28 May 2026 12:19:14 +1000	[thread overview]
Message-ID: <review-patch2-20260527133917.207150-3-tzimmermann@suse.de> (raw)
In-Reply-To: <20260527133917.207150-3-tzimmermann@suse.de>

Patch Review

This is the core behavioral patch. It defines `DRM_VBLANK_FLAG_SIMULATED` as `BIT(1)` and adds early-return checks in three ioctl handlers.

**Observations:**

- **BIT(1) not BIT(0):** The flag starts at `BIT(1)` rather than `BIT(0)`. This is unusual but perhaps intentional to reserve BIT(0) for something else, or a minor mistake. It works correctly either way since the flags field starts at 0, but it's worth asking whether this was deliberate. If there's no planned BIT(0), starting at BIT(0) would be more conventional.

- The three ioctl checks are placed at sensible positions — after the vblank struct is obtained but before any real work is done:

  In `drm_wait_vblank_ioctl`:
  ```c
  +	if (vblank->flags & DRM_VBLANK_FLAG_SIMULATED)
  +		return -EOPNOTSUPP;
  ```

  In `drm_crtc_get_sequence_ioctl`:
  ```c
  +	if (vblank->flags & DRM_VBLANK_FLAG_SIMULATED)
  +		return -EOPNOTSUPP;
  ```

  In `drm_crtc_queue_sequence_ioctl`:
  ```c
  +	if (vblank->flags & DRM_VBLANK_FLAG_SIMULATED)
  +		return -EOPNOTSUPP;
  ```

- **Error code choice:** `-EOPNOTSUPP` is reasonable for "this operation is not supported on this CRTC." The alternative would be `-ENOTSUP` (same value on Linux) or `-EINVAL`. The choice here is fine — it clearly communicates that the operation itself is understood but not available for this device.

- **Potential concern in `drm_crtc_queue_sequence_ioctl`:** The flag check is placed *after* the `kzalloc_obj(*e)` call... wait, re-reading the diff more carefully:
  ```c
  +	if (vblank->flags & DRM_VBLANK_FLAG_SIMULATED)
  +		return -EOPNOTSUPP;
  +
   	e = kzalloc_obj(*e);
  ```
  Actually the check is placed *before* the allocation. Good — this avoids allocating and then immediately freeing.

- **UAPI impact:** This changes behavior for existing userspace applications. Programs that currently call `DRM_IOCTL_WAIT_VBLANK` on these virtual GPU devices will start getting `-EOPNOTSUPP` instead of (potentially misleading) success. The cover letter notes that major compositors (Weston, KWin, Mutter) don't rely on this ioctl for rate-limiting, and this was discussed on IRC. This seems adequately vetted.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-28  2:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-27 13:32 [PATCH v2 0/9] drm: Limit DRM_IOCTL_WAIT_VBLANK to vblank interrupts Thomas Zimmermann
2026-05-27 13:32 ` [PATCH v2 1/9] drm/vblank: Add drmm_vblank_init() to indicate managed cleanup Thomas Zimmermann
2026-05-28  2:19   ` Claude review: " Claude Code Review Bot
2026-05-27 13:32 ` [PATCH v2 2/9] drm/vblank: Add DRM_VBLANK_FLAG_SIMULATED Thomas Zimmermann
2026-05-28  2:19   ` Claude Code Review Bot [this message]
2026-05-27 13:32 ` [PATCH v2 3/9] drm/amdgpu: vkms: Set DRM_VBLANK_FLAG_SIMULATED Thomas Zimmermann
2026-05-28  2:19   ` Claude review: " Claude Code Review Bot
2026-05-27 13:32 ` [PATCH v2 4/9] drm/bochs: " Thomas Zimmermann
2026-05-28  2:19   ` Claude review: " Claude Code Review Bot
2026-05-27 13:32 ` [PATCH v2 5/9] drm/cirrus: " Thomas Zimmermann
2026-05-28  2:19   ` Claude review: " Claude Code Review Bot
2026-05-27 13:32 ` [PATCH v2 6/9] drm/hypervdrm: " Thomas Zimmermann
2026-05-28  2:19   ` Claude review: " Claude Code Review Bot
2026-05-27 13:32 ` [PATCH v2 7/9] drm/qxl: " Thomas Zimmermann
2026-05-28  2:19   ` Claude review: " Claude Code Review Bot
2026-05-27 13:32 ` [PATCH v2 8/9] drm/virtgpu: " Thomas Zimmermann
2026-05-28  2:19   ` Claude review: " Claude Code Review Bot
2026-05-27 13:32 ` [PATCH v2 9/9] drm/vkms: " Thomas Zimmermann
2026-05-28  2:19   ` Claude review: " Claude Code Review Bot
2026-05-27 16:31 ` [PATCH v2 0/9] drm: Limit DRM_IOCTL_WAIT_VBLANK to vblank interrupts Julian Orth
2026-05-28  2:19 ` Claude review: " Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-15 11:55 [PATCH 0/9] " Thomas Zimmermann
2026-05-15 11:55 ` [PATCH 2/9] drm/vblank: Add DRM_VBLANK_FLAG_SIMULATED Thomas Zimmermann
2026-05-15 23:20   ` 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-20260527133917.207150-3-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