From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260602-hdmi-overscan-v1-1-31f71b817c80@flipper.net> References: <20260602-hdmi-overscan-v1-0-31f71b817c80@flipper.net> <20260602-hdmi-overscan-v1-1-31f71b817c80@flipper.net> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 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 ``, but `rockchip_drm_drv.h` already includes `` which pulls in `` which includes ``. 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