From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/exynos: fbdev: Calculate buffer geometry with format helpers
Date: Sat, 16 May 2026 15:38:05 +1000 [thread overview]
Message-ID: <review-patch3-20260511115538.57884-4-tzimmermann@suse.de> (raw)
In-Reply-To: <20260511115538.57884-4-tzimmermann@suse.de>
Patch Review
**Status: Good, one minor note**
This replaces the hand-rolled geometry calculation with proper DRM format helpers. The v3 error checks are thorough:
```c
fourcc = drm_mode_legacy_fb_format(sizes->surface_bpp, sizes->surface_depth);
if (fourcc == DRM_FORMAT_INVALID)
return -EINVAL;
format = drm_get_format_info(dev, fourcc, DRM_FORMAT_MOD_LINEAR);
if (!format)
return -EINVAL;
pitch = drm_format_info_min_pitch(format, 0, sizes->surface_width);
if (!pitch)
return -EINVAL;
if (check_mul_overflow(pitch, sizes->surface_height, &size))
return -EINVAL;
size = ALIGN(size, PAGE_SIZE);
if (size < PAGE_SIZE)
return -EINVAL;
```
**Minor note on types:** `drm_format_info_min_pitch()` returns `uint64_t` but `pitch` is declared as `u32`. For fbdev surface sizes this is never a practical issue, and the resulting pitch is consumed by `mode_cmd.pitches[0]` (also `u32`) and `drm_client_buffer_create(..., u32 pitch)`, so `u32` is the right type for the interface contract. The `!pitch` check catches the degenerate case where the return was 0. If the pitch somehow exceeded 32 bits (theoretically impossible for reasonable fbdev sizes), it would silently truncate, but this matches the existing API constraints.
The switch to `obj->size` for `screen_size` and `fix.smem_len` is correct — it reflects the actual allocated size (which may be larger than the requested size after GEM allocation alignment):
```c
+ info->screen_size = obj->size;
+ info->fix.smem_len = obj->size;
```
No blocking concerns.
---
---
Generated by Claude Code Patch Reviewer
next prev parent 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 Code Review Bot [this message]
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 review: " Claude Code Review Bot
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-patch3-20260511115538.57884-4-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