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/rockchip: vop2: honor TV margins from CRTC state for overscan compensation
Date: Thu, 04 Jun 2026 12:35:01 +1000	[thread overview]
Message-ID: <review-patch1-20260602-hdmi-overscan-v1-1-31f71b817c80@flipper.net> (raw)
In-Reply-To: <20260602-hdmi-overscan-v1-1-31f71b817c80@flipper.net>

Patch Review

**Good:**
- Cleanly replaces the hard-coded 100% margin values with the new `tv_margins` from `rockchip_crtc_state`.
- The safety check `if (m->left + m->right < hdisplay)` prevents underflow if nonsensical margins are provided.
- Keeps `rounddown(vsize/hsize, 2)` in place after the computation.

**Issues:**

1. **`drm_connector.h` include may be unnecessary.** The `struct drm_connector_tv_margins` is already defined in `<drm/drm_connector.h>`, but `rockchip_drm_drv.h` already includes `<drm/drm_atomic_helper.h>` which pulls in `<drm/drm_crtc.h>` which includes `<drm/drm_connector.h>`. Check whether the explicit include is actually needed or just defensive.

2. **No validation that margins leave a minimum visible area.** The guard checks `m->left + m->right < hdisplay`, but this allows margins that leave only 1-2 visible pixels. A more robust check would enforce a reasonable minimum (though in practice the overscan property is capped at 100 and the `/200` division limits this).

3. **Asymmetry with the old code.** The old code used percentage-based margin calculations that affected both the active start position and the scaled size. The new code computes `hsize = hdisplay - m->left - m->right` which is equivalent when margins are symmetric (as patch 2 ensures), but the direct pixel subtraction means the scaler behavior is slightly different from what the old percentage formula would give for the same effective margin. This is fine since the old code always used 100% (no margin), just worth noting.

4. **Minor: the `tv_margins` field is zero-initialized by default** (since `rockchip_crtc_state` is allocated via `kzalloc` through `drm_atomic_helper_crtc_duplicate_state`), so the default behavior (no margins) is preserved. This is correct.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-06-04  2:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02 17:00 [PATCH 0/2] drm/rockchip: dw_hdmi_qp: Add support for HDMI overscan compensation Alexey Charkov
2026-06-02 17:00 ` [PATCH 1/2] drm/rockchip: vop2: honor TV margins from CRTC state for " Alexey Charkov
2026-06-04  2:35   ` Claude Code Review Bot [this message]
2026-06-02 17:00 ` [PATCH 2/2] drm/rockchip: dw_hdmi_qp: expose "overscan" property Alexey Charkov
2026-06-03  7:55   ` Maxime Ripard
2026-06-03  8:15     ` Alexey Charkov
2026-06-03 13:11   ` Andy Yan
2026-06-04  2:35   ` Claude review: " Claude Code Review Bot
2026-06-04  2:35 ` Claude review: drm/rockchip: dw_hdmi_qp: Add support for HDMI overscan compensation 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-20260602-hdmi-overscan-v1-1-31f71b817c80@flipper.net \
    --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