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: Add CRTC background color property
Date: Wed, 04 Mar 2026 06:54:47 +1000	[thread overview]
Message-ID: <review-patch2-20260303-rk3588-bgcolor-v8-2-fee377037ad1@collabora.com> (raw)
In-Reply-To: <20260303-rk3588-bgcolor-v8-2-fee377037ad1@collabora.com>

Patch Review

**Status: Looks good**

This is the core patch and it's well done.

**Property creation and plumbing**: The property is created as a standard property in `drm_mode_create_standard_properties()` with range `[0, U64_MAX]`, and attached to individual CRTCs via `drm_crtc_attach_background_color_property()`. This follows the established DRM pattern (similar to color management properties). The get/set in `drm_atomic_uapi.c` and state dump in `drm_atomic.c` are correct.

**Default initialization**: Setting the default to opaque black in `__drm_atomic_helper_crtc_state_reset()` is correct:

```c
+	crtc_state->background_color = DRM_ARGB64_PREP(0xffff, 0, 0, 0);
```

**ARGB64 macros**: The helper design is well thought out:

- `DRM_ARGB64_PREP()` / `DRM_ARGB64_PREP_BPC()` for packing
- `DRM_ARGB64_GET*()` / `DRM_ARGB64_GET*_BPC()` / `DRM_ARGB64_GET*_BPCS()` for extraction
- The BPC variants use proper rounding (`DIV_ROUND_CLOSEST`) for accuracy
- The BPCS variants use simple right-shift for performance

The scaling math is correct: `DIV_ROUND_CLOSEST(c * 0xFFFF, (2^bpc - 1))` properly maps the input range to 16-bit. I verified the intermediate multiplication won't overflow since the `__u16` operands promote to at least `unsigned long` when multiplied with `__GENMASK(15, 0)`.

**Documentation**: The updated kerneldoc in `drm_blend.c` clearly describes the property semantics, including the CRTC degamma/CSC/gamma pipeline placement and the note about alpha behavior. Good.

Minor: the state dump format `%llx` works but `0x%016llx` would produce more consistently readable output for a 64-bit ARGB value.

---

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-03 20:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03 19:24 [PATCH v8 0/4] Introduce BACKGROUND_COLOR DRM CRTC property Cristian Ciocaltea
2026-03-03 19:24 ` [PATCH v8 1/4] uapi: Provide DIV_ROUND_CLOSEST() Cristian Ciocaltea
2026-03-03 20:54   ` Claude review: " Claude Code Review Bot
2026-03-03 19:24 ` [PATCH v8 2/4] drm: Add CRTC background color property Cristian Ciocaltea
2026-03-03 20:54   ` Claude Code Review Bot [this message]
2026-03-03 19:24 ` [PATCH v8 3/4] drm/vkms: Support setting custom background color Cristian Ciocaltea
2026-03-03 20:54   ` Claude review: " Claude Code Review Bot
2026-03-03 19:24 ` [PATCH v8 4/4] drm/rockchip: vop2: " Cristian Ciocaltea
2026-03-03 20:54   ` Claude review: " Claude Code Review Bot
2026-03-03 20:54 ` Claude review: Introduce BACKGROUND_COLOR DRM CRTC property 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-patch2-20260303-rk3588-bgcolor-v8-2-fee377037ad1@collabora.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