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/exynos: fbdev: Use a DRM client buffer
Date: Sat, 16 May 2026 15:38:05 +1000	[thread overview]
Message-ID: <review-patch4-20260511115538.57884-5-tzimmermann@suse.de> (raw)
In-Reply-To: <20260511115538.57884-5-tzimmermann@suse.de>

Patch Review

**Status: Good**

This is the core change. The old flow created a framebuffer directly via `exynos_drm_framebuffer_init()`. The new flow:

1. Creates a GEM handle via `drm_gem_handle_create()`
2. Creates a client buffer via `drm_client_buffer_create()` (which internally does ADDFB2)
3. Cleans up the handle and drops the initial GEM reference

The reference counting is correct:
```c
/* The handle is only needed for creating the framebuffer. */
drm_gem_handle_delete(file, handle);

/* The framebuffer still holds a reference on the GEM object. */
drm_gem_object_put(obj);
```

After these two lines, the GEM object survives with exactly one reference held by the framebuffer created inside `drm_client_buffer_create()`. The `exynos_gem->kvaddr` read happens before `drm_gem_object_put()`, so we're dereferencing the pointer while still holding our own reference. The stored `kvaddr` value remains valid as long as the framebuffer exists.

The cleanup in `exynos_drm_fb_destroy` is simplified:
```c
-	drm_framebuffer_remove(fb);
+	drm_client_buffer_delete(fb_helper->buffer);
```

`drm_client_buffer_delete()` handles framebuffer removal and releasing the GEM reference, which is the right cleanup for the client buffer path.

The error paths correctly unwind in reverse order:
```c
err_drm_gem_handle_delete:
    drm_gem_handle_delete(file, handle);
err_drm_gem_object_put:
    drm_gem_object_put(obj);
```

Note: the old error path used `exynos_drm_gem_destroy(exynos_gem)` while the new one uses `drm_gem_object_put(obj)`. Since `exynos_drm_gem_create()` returns the object with refcount=1, `drm_gem_object_put` is the correct generic way to release it (it will call the destroy callback when refcount drops to 0). This is a clean improvement.

No concerns.

---

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-16  5:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11 11:54 [PATCH v3 0/5] drm/exynos: fbdev: Use client buffers Thomas Zimmermann
2026-05-11 11:54 ` [PATCH v3 1/5] drm/exynos: fbdev: Remove offset into screen_buffer Thomas Zimmermann
2026-05-16  5:38   ` Claude review: " Claude Code Review Bot
2026-05-11 11:54 ` [PATCH v3 2/5] drm/exynos: fbdev: Inline exynos_drm_fbdev_update() Thomas Zimmermann
2026-05-16  5:38   ` Claude review: " Claude Code Review Bot
2026-05-11 11:54 ` [PATCH v3 3/5] drm/exynos: fbdev: Calculate buffer geometry with format helpers Thomas Zimmermann
2026-05-16  5:38   ` Claude review: " Claude Code Review Bot
2026-05-11 11:54 ` [PATCH v3 4/5] drm/exynos: fbdev: Use a DRM client buffer Thomas Zimmermann
2026-05-16  5:38   ` Claude Code Review Bot [this message]
2026-05-11 11:54 ` [PATCH v3 5/5] drm/exynos: Make exynos_drm_framebuffer_init() an internal interface Thomas Zimmermann
2026-05-16  5:38   ` Claude review: " Claude Code Review Bot
2026-05-16  5:38 ` Claude review: drm/exynos: 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-20260511115538.57884-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