From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/tegra: fbdev: Use a DRM client buffer
Date: Thu, 23 Apr 2026 08:46:58 +1000 [thread overview]
Message-ID: <review-patch4-20260421073646.144712-5-tzimmermann@suse.de> (raw)
In-Reply-To: <20260421073646.144712-5-tzimmermann@suse.de>
Patch Review
**Status: Good**
This is the core patch. It replaces the direct `tegra_fb_alloc()` call with the standard `drm_client_buffer_create()` path, which goes through `drm_mode_addfb2()` → `tegra_fb_create()` → `tegra_fb_alloc()` internally.
**Reference counting analysis — all paths correct:**
*Success path:*
1. `tegra_bo_create` → gem ref = 1
2. `drm_gem_handle_create` → gem ref = 2
3. `drm_client_buffer_create` → `drm_gem_object_lookup` (ref = 3) + `drm_mode_addfb2` → `tegra_fb_create` → lookup (ref = 4, held by fb->obj[0])
4. `drm_gem_handle_delete` → ref = 3
5. `drm_gem_object_put(gem)` → ref = 2 (one in buffer->gem, one in fb->obj[0])
*Destroy path (`tegra_fbdev_fb_destroy`):*
- `drm_client_buffer_delete` → `drm_mode_rmfb` drops fb (ref = 1) → `drm_gem_object_put(buffer->gem)` (ref = 0) → freed. Correct.
*Error path (vmap fails):*
- `drm_client_buffer_delete` → ref goes 4→2, then `drm_gem_handle_delete` → 1, then `drm_gem_object_put` → 0. Correct.
*Error path (buffer create fails):*
- buffer_create cleans up internally, `drm_gem_handle_delete` → 1, `drm_gem_object_put` → 0. Correct.
The `drm_gem_vunmap` call inside `drm_client_buffer_delete` is a no-op here since tegra does its own vmap/vunmap and `buffer->map` remains zero-initialized from `kzalloc`. No issue.
The destroy function correctly cleans up with `drm_client_buffer_delete` instead of `drm_framebuffer_remove`:
```c
- drm_framebuffer_remove(fb);
+ drm_client_buffer_delete(helper->buffer);
```
No issues.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-22 22:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 7:29 [PATCH 0/5] drm/tegra: fbdev: Use client buffers Thomas Zimmermann
2026-04-21 7:29 ` [PATCH 1/5] drm/tegra: fbdev: Do not assign to struct drm_fb_helper.info Thomas Zimmermann
2026-04-22 22:46 ` Claude review: " Claude Code Review Bot
2026-04-21 7:29 ` [PATCH 2/5] drm/tegra: fbdev: Remove offset into framebuffer memory Thomas Zimmermann
2026-04-22 22:46 ` Claude review: " Claude Code Review Bot
2026-04-21 7:29 ` [PATCH 3/5] drm/tegra: fbdev: Calculate buffer geometry with format helpers Thomas Zimmermann
2026-04-22 22:46 ` Claude review: " Claude Code Review Bot
2026-04-21 7:29 ` [PATCH 4/5] drm/tegra: fbdev: Use a DRM client buffer Thomas Zimmermann
2026-04-22 22:46 ` Claude Code Review Bot [this message]
2026-04-21 7:29 ` [PATCH 5/5] drm/tegra: Make tegra_fb_alloc() an internal interface Thomas Zimmermann
2026-04-22 22:46 ` Claude review: " Claude Code Review Bot
2026-04-22 22:46 ` Claude review: drm/tegra: fbdev: Use client buffers 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-patch4-20260421073646.144712-5-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