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/panic: Fix panic logo alignment
Date: Tue, 31 Mar 2026 17:43:30 +1000	[thread overview]
Message-ID: <review-patch1-20260329102454.11357-1-dileepsankhla.ds@gmail.com> (raw)
In-Reply-To: <20260329102454.11357-1-dileepsankhla.ds@gmail.com>

Patch Review

**Approach**: The patch adds a `drm_rect_translate()` call to horizontally center `r_logo` after it's initialized by `drm_panic_logo_rect()`. This is the same pattern used at line 502 for centering `r_msg`.

**Correctness**: Since `drm_panic_logo_rect()` initializes the rect at origin (0, 0) (see line 457), `r_logo.x2` equals the logo width, so `(sb->width - r_logo.x2) / 2` correctly computes the left offset for centering. The y-translation of 0 keeps it at the top.

**Potential type concern**: `sb->width` is `unsigned int` and `r_logo.x2` is `int` (from `struct drm_rect`). If the logo is wider than the screen, `(sb->width - r_logo.x2)` could produce a large unsigned value, resulting in a bad translation. However:
1. The same pattern is already used for `r_msg` at line 502 without a guard.
2. `drm_panic_logo_draw()` (line 468) already checks `rect->x2 > sb->width` and bails out, so a garbled rect would simply not be drawn.
3. In practice, panic logos are small relative to any screen.

So this is not a new issue introduced by this patch.

**Nit**: The commit message says "Fix panic logo alignment" which implies the current behavior is a bug. It might be more accurate to say "Center panic logo" since the left-alignment may have been the original intent rather than a bug. But this is subjective — if the intent was always to center it, "Fix" is appropriate.

**Verdict**: Looks good. The change is minimal, follows existing patterns, and improves visual consistency of the user-type panic screen.

Reviewed-by: No issues found that would block merging.

---
Generated by Claude Code Patch Reviewer

      parent reply	other threads:[~2026-03-31  7:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-29 10:24 [PATCH] drm/panic: Fix panic logo alignment Dileep Sankhla
2026-03-31  7:43 ` Claude review: " Claude Code Review Bot
2026-03-31  7:43 ` Claude Code Review Bot [this message]

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-20260329102454.11357-1-dileepsankhla.ds@gmail.com \
    --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