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/drm_blend: allow blend mode property without PREMULTI
Date: Tue, 05 May 2026 08:17:26 +1000	[thread overview]
Message-ID: <review-patch1-20260504140630.68707-2-leandro.ribeiro@collabora.com> (raw)
In-Reply-To: <20260504140630.68707-2-leandro.ribeiro@collabora.com>

Patch Review

**Verdict: Looks good, minor nit.**

The core change is clean and well-motivated. The WARN_ON condition is simplified to only reject invalid bits, and a fallback default selection is added:

```c
if (supported_modes & BIT(DRM_MODE_BLEND_PREMULTI))
    default_mode = DRM_MODE_BLEND_PREMULTI;
else if (supported_modes & BIT(DRM_MODE_BLEND_COVERAGE))
    default_mode = DRM_MODE_BLEND_COVERAGE;
else
    default_mode = DRM_MODE_BLEND_PIXEL_NONE;
```

This fallback order is reasonable — PREMULTI first (backward compat), then COVERAGE, then PIXEL_NONE.

**Minor nit:** There is no check that `supported_modes != 0`. Passing zero would create a property with zero enum values and set `default_mode = DRM_MODE_BLEND_PIXEL_NONE` (which isn't even in the enum list). The old WARN_ON would have caught this since `BIT(DRM_MODE_BLEND_PREMULTI) == 0` evaluates true. Consider adding `!supported_modes` to the WARN_ON:

```c
if (WARN_ON(!supported_modes || (supported_modes & ~valid_mode_mask)))
    return -EINVAL;
```

**Documentation update is good** — the `@supported_modes` doc now accurately reflects the new behavior.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-04 22:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 14:06 [PATCH v2 0/2] drm/drm_blend: allow blend mode property without PREMULTI Leandro Ribeiro
2026-05-04 14:06 ` [PATCH v2 1/2] " Leandro Ribeiro
2026-05-04 22:17   ` Claude Code Review Bot [this message]
2026-05-04 14:06 ` [PATCH v2 2/2] drm: ensure blend mode supported if alpha exposed Leandro Ribeiro
2026-05-04 22:17   ` Claude review: " Claude Code Review Bot
2026-05-04 22:17 ` Claude review: drm/drm_blend: allow blend mode property without PREMULTI 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-20260504140630.68707-2-leandro.ribeiro@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