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/msm: restore GEM-related IOCTLs for KMS devices
Date: Thu, 05 Mar 2026 13:25:16 +1000	[thread overview]
Message-ID: <review-patch1-20260304-msm-restore-ioctls-v1-1-b28f9231fcd2@oss.qualcomm.com> (raw)
In-Reply-To: <20260304-msm-restore-ioctls-v1-1-b28f9231fcd2@oss.qualcomm.com>

Patch Review

**Correctness of ioctl table indexing: OK**

The `DRM_IOCTL_DEF_DRV` macro uses designated initializers:
```c
[DRM_IOCTL_NR(DRM_IOCTL_##ioctl) - DRM_COMMAND_BASE] = { ... }
```
So entries in `msm_kms_ioctls[]` will be placed at their correct indices (e.g., `MSM_GEM_NEW` at index 2, `MSM_GEM_MADVISE` at index 8) with zero-filled gaps. `ARRAY_SIZE()` will correctly yield 9. This is fine.

**Concern 1: `MSM_INFO_GET_IOVA` and `MSM_INFO_SET_IOVA` on KMS-only devices**

The `msm_ioctl_gem_info` handler is exposed via `MSM_GEM_INFO` in the new table. Some of its sub-commands (`MSM_INFO_GET_IOVA`, `MSM_INFO_SET_IOVA`) call `msm_ioctl_gem_info_iova()` and `msm_ioctl_gem_info_set_iova()` respectively, which check `if (!priv->gpu) return -EINVAL` (lines 428 and 452). On a KMS-only device, `priv->gpu` will be NULL, so these sub-commands will return `-EINVAL`, which is safe but could be confusing. This is probably fine since the other sub-commands (`MSM_INFO_GET_OFFSET`, `MSM_INFO_GET_FLAGS`, metadata, name) all work without a GPU. Worth confirming this matches the intended use case though.

**Concern 2: Missing `gem_prime_import` in `msm_kms_driver`**

The combined `msm_driver` has `.gem_prime_import = msm_gem_prime_import` but `msm_kms_driver` does not. If userspace allocates a GEM buffer via `MSM_GEM_NEW` on the KMS device and then exports/re-imports it, the default `drm_gem_prime_import` will be used instead of `msm_gem_prime_import`. This may or may not matter depending on the GBM backend workflow (which exports from KMS and imports into the GPU driver, not the reverse). But it's worth noting that there's an asymmetry here.

**Concern 3: Commit message notes raise a question**

The author's note:
> Note, here I assume that dumb buffers generally should not be used for
> rendering. That doesn't seem to be complete truth as Mesa kmsro on MSM
> devices uses DRM_IOCTL_MODE_CREATE_DUMB to create buffers for resources.

This is an honest acknowledgment that weakens the justification somewhat. If kmsro already uses dumb buffers successfully for rendering on MSM, then the original commit 98f11fd1cf92 may have been intentional in pushing towards that path. The patch could benefit from clarifying which specific use case is broken — is it specifically the MSM GBM backend (as opposed to kmsro), and on which platforms/configurations?

**Minor: No `MSM_GET_PARAM` / `MSM_SET_PARAM`**

The patch deliberately omits `MSM_GET_PARAM` and `MSM_SET_PARAM`. This seems intentional since those are GPU-related queries, but userspace that calls `MSM_GEM_NEW` might also query params to determine supported flags or GPU capabilities. If the GBM backend needs param queries too, this will need a follow-up.

**Summary:** The patch is technically sound and addresses a real regression. The main open question is whether this is the right set of ioctls and whether the commit message should more precisely identify the broken use case. The `!priv->gpu` guards in `gem_info` sub-commands provide adequate safety for the KMS-only case.

---
Generated by Claude Code Patch Reviewer

      parent reply	other threads:[~2026-03-05  3:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04 13:34 [PATCH] drm/msm: restore GEM-related IOCTLs for KMS devices Dmitry Baryshkov
2026-03-04 14:57 ` Rob Clark
2026-03-04 14:59   ` Rob Clark
2026-03-05  1:03     ` Dmitry Baryshkov
2026-03-04 15:57 ` Rob Clark
2026-03-05  0:44   ` Dmitry Baryshkov
2026-03-05  3:25 ` Claude review: " Claude Code Review Bot
2026-03-05  3:25 ` Claude Code Review Bot [this message]

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-20260304-msm-restore-ioctls-v1-1-b28f9231fcd2@oss.qualcomm.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