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/dumb-buffers: Increase size limits to match current devices
Date: Thu, 04 Jun 2026 13:08:23 +1000	[thread overview]
Message-ID: <review-patch1-20260602073027.192758-1-tzimmermann@suse.de> (raw)
In-Reply-To: <20260602073027.192758-1-tzimmermann@suse.de>

Patch Review

**Correctness of the new limits:**

The worst-case arithmetic at the new limits (16384 x 16384 x 64bpp):
- `cpp = DIV_ROUND_UP(64, 8) = 8`
- `stride = 8 * 16384 = 131,072`
- `size = 16384 * 131,072 = 2,147,483,648` (0x80000000)

This fits within `u32` (max ~4.29 billion) and `PAGE_ALIGN(0x80000000)` is non-zero, so all downstream overflow checks in the old `drm_mode_create_dumb()` pass. The arithmetic is safe.

**The `>=` to `>` change is correct and intentional:**

```c
-	if (args->width >= 8192 || args->height >= 8192 || args->bpp > 32)
+	if (args->width > 16384 || args->height > 16384 || args->bpp > 64)
```

The old code rejected `width == 8192` (off-by-one — the comment said "8192x8192" but the `>=` operator excluded that size). The new code correctly allows `width == 16384` using `>`. This is a good fix.

**64bpp is a legitimate value:**

The current drm-next tree explicitly handles `case 64` in `drm_mode_size_dumb()` for `DRM_FORMAT_{XRGB,XBGR,ARGB,ABGR}16161616F` formats, confirming 64bpp is a real use case. The original 32bpp limit was too restrictive.

**Comment update is appropriate:**

```c
+	/*
+	 * Reject unreasonable inputs early. Dumb buffers are for software
+	 * rendering; nothing legitimate needs more than 16384x16384 at
+	 * 64 bpp. This prevents overflows in downstream alignment helpers.
 	 */
```

The comment accurately describes the new limits and the multi-line comment style is reformatted to kernel coding style (opening `/*` on its own line).

**Minor observations:**

1. The `Fixes:` tag placement is after `Signed-off-by:` — while not strictly wrong, the conventional ordering in the kernel is `Fixes:` before `Signed-off-by:`. This is a trivial style point.

2. The patch is well-scoped and minimal — it changes exactly what needs to change for the fix.

3. As noted above, this patch is **superseded on drm-next** where the hardcoded limits have been entirely replaced with overflow-safe arithmetic. If this is intended for stable backport to kernels that still have the original limiting code, it looks correct. If it's intended for drm-next, it will need to be dropped or reworked since the target code no longer exists.

**Verdict:** The patch is correct for the codebase version it targets. The arithmetic is safe within u32 bounds, the off-by-one fix (`>=` to `>`) is an improvement, and 64bpp / 16384 resolution are justified by real hardware and formats. The main concern is applicability — this should be applied to the branch containing `5ab62dd3687b`, not drm-next where the code has been refactored away.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-06-04  3:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02  7:30 [PATCH] drm/dumb-buffers: Increase size limits to match current devices Thomas Zimmermann
2026-06-02 10:37 ` Saarinen, Jani
2026-06-02 10:53   ` Jani Nikula
2026-06-02 11:23     ` Thomas Zimmermann
2026-06-04  3:08 ` Claude Code Review Bot [this message]
2026-06-04  3:08 ` Claude review: " 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-20260602073027.192758-1-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