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/tegra: fbdev: Calculate buffer geometry with format helpers
Date: Thu, 23 Apr 2026 08:46:58 +1000	[thread overview]
Message-ID: <review-patch3-20260421073646.144712-4-tzimmermann@suse.de> (raw)
In-Reply-To: <20260421073646.144712-4-tzimmermann@suse.de>

Patch Review

**Status: Good, one minor style nit**

Replaces the manual `bytes_per_pixel` / pitch / size calculation with the standard DRM format helpers:

```c
fourcc = drm_mode_legacy_fb_format(sizes->surface_bpp, sizes->surface_depth);
format = drm_get_format_info(drm, fourcc, DRM_FORMAT_MOD_LINEAR);
pitch = round_up(drm_format_info_min_pitch(format, 0, sizes->surface_width),
		 tegra->pitch_align);
size = ALIGN(pitch * sizes->surface_height, PAGE_SIZE);
```

The `DRM_FORMAT_MOD_LINEAR` argument is equivalent to the old zero-initialized `cmd.modifier[0]`. The added `PAGE_SIZE` alignment on size is an improvement — `tegra_bo_create` will round up anyway, and this makes the allocation explicit.

Using `bo->gem.size` instead of the locally calculated `size` for `screen_size` / `smem_len` is correct — it reflects the actual allocated buffer size after any internal alignment by the GEM allocator:

```c
-	info->screen_size = size;
+	info->screen_size = bo->gem.size;
```

**Minor nit:** Variable declarations are not in reverse-christmas-tree order — `const struct drm_format_info *format` is declared after the shorter variables. Very minor and not worth blocking.

---
Generated by Claude Code Patch Reviewer

  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 Code Review Bot [this message]
2026-04-21  7:29 ` [PATCH 4/5] drm/tegra: fbdev: Use a DRM client buffer Thomas Zimmermann
2026-04-22 22:46   ` Claude review: " Claude Code Review Bot
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-patch3-20260421073646.144712-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