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/amdgpu: Move test for fbdev GEM object into generic helper
Date: Thu, 05 Mar 2026 13:27:24 +1000	[thread overview]
Message-ID: <review-patch1-20260304130250.59008-2-tzimmermann@suse.de> (raw)
In-Reply-To: <20260304130250.59008-2-tzimmermann@suse.de>

Patch Review

**Overall**: Good patch. The new helper correctly generalizes the amdgpu-specific check and is more flexible by also supporting the `fb_helper->fb` path (via `drm_gem_fb_get_obj`) when `buffer` isn't set.

**EXPORT_SYMBOL_GPL vs EXPORT_SYMBOL**: Every other export in `drm_fb_helper.c` uses `EXPORT_SYMBOL` (non-GPL). The new function uses:

```c
EXPORT_SYMBOL_GPL(drm_fb_helper_gem_is_fb);
```

This should be `EXPORT_SYMBOL` for consistency with the rest of the file. While both amdgpu and radeon are GPL-licensed so this works today, using `EXPORT_SYMBOL_GPL` here is inconsistent and could trip up any hypothetical non-GPL consumer that uses the other fb_helper functions.

**Typo in kdoc**: Minor typo in the documentation comment:

```c
 * Call drm_fb_helper_gem_is_fb to test is a DRM device's fbdev emulation
```

"test is" should be "test if".

**Logic correctness**: The helper's fallback logic is sound:

```c
if (fb_helper->buffer && fb_helper->buffer->gem)
    gem = fb_helper->buffer->gem;
else if (fb_helper->fb)
    gem = drm_gem_fb_get_obj(fb_helper->fb, 0);
```

This correctly handles the two paths: drivers using client buffers (amdgpu's original path checked `buffer->gem`) and drivers using `fb` directly (radeon's original path used `drm_gem_fb_get_obj(fb_helper->fb, 0)`). The original amdgpu code only checked `buffer->gem`, and the new helper adds the `fb` fallback, which is a strict superset — safe because if `buffer` is set, it will be checked first.

**Scoping improvement**: Nice touch moving `robj` into the inner block where it's actually used:

```c
-		robj = gem_to_amdgpu_bo(fb->obj[0]);
-		if (!amdgpu_display_robj_is_fb(adev, robj)) {
+		if (!drm_fb_helper_gem_is_fb(dev->fb_helper, fb->obj[0])) {
+			struct amdgpu_bo *robj = gem_to_amdgpu_bo(fb->obj[0]);
```

This avoids the unnecessary conversion when the object *is* the fbdev framebuffer.

**Header placement**: The `#else` static inline stub is correctly placed — the existing header had no `#else` for `CONFIG_DRM_FBDEV_EMULATION`, and this adds one cleanly.

---
Generated by Claude Code Patch Reviewer

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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04 12:58 [PATCH 0/2] amdgpu,radeon: Test fbdev GEM object in helper Thomas Zimmermann
2026-03-04 12:58 ` [PATCH 1/2] drm/amdgpu: Move test for fbdev GEM object into generic helper Thomas Zimmermann
2026-03-05  3:27   ` Claude Code Review Bot [this message]
2026-03-04 12:58 ` [PATCH 2/2] drm/radeon: Test for fbdev GEM object with " Thomas Zimmermann
2026-03-04 15:32   ` Alex Deucher
2026-03-04 15:49     ` Thomas Zimmermann
2026-03-05  3:27   ` Claude review: " Claude Code Review Bot
2026-03-05  3:27 ` Claude review: amdgpu,radeon: Test fbdev GEM object in helper 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-patch1-20260304130250.59008-2-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