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/atomic: only add colorop state from active color pipeline
Date: Tue, 05 May 2026 09:26:01 +1000	[thread overview]
Message-ID: <review-patch1-20260501132527.522320-2-mwen@igalia.com> (raw)
In-Reply-To: <20260501132527.522320-2-mwen@igalia.com>

Patch Review

**Purpose:** Changes `drm_atomic_add_affected_colorops()` to walk only the active pipeline's linked list (`colorop->next`) instead of iterating all colorops on the device and filtering by plane.

**Review:**

The core logic change is good — walking the linked list via `plane_state->color_pipeline` / `colorop->next` is both more efficient and semantically correct:

```c
for (colorop = plane_state->color_pipeline;
     colorop;
     colorop = colorop->next) {
    colorop_state = drm_atomic_get_colorop_state(plane_state->state, colorop);
```

However, the function signature change is a notable API change:

```c
-drm_atomic_add_affected_colorops(struct drm_atomic_state *state,
+drm_atomic_add_affected_colorops(struct drm_plane_state *plane_state,
                                  struct drm_plane *plane)
```

**Concern:** The `plane` parameter is now redundant since it can be derived from `plane_state->plane`. Keeping both parameters is mildly inconsistent — consider whether `plane` should be dropped from the signature entirely to avoid callers passing a mismatched plane. That said, it mirrors the pattern of other DRM helpers that take both state and object, so this is acceptable as-is.

The null-guard at the top is a good addition:
```c
if (!plane_state || !plane_state->color_pipeline)
    return 0;
```

The removal of the `WARN_ON` for missing plane state is correct since the plane_state is now passed directly.

The callers in `drm_atomic_add_affected_planes` and `drm_atomic_helper_duplicate_state` are updated cleanly — the redundant `if (plane_state->color_pipeline)` checks are moved inside the function itself.

**Minor nit:** The `@state` parameter documentation says "DRM plane state" but the parameter is named `plane_state` — this is fine but slightly unusual for kerneldoc since `@state` doesn't match the parameter name `plane_state`. Looking at the header, the declaration parameter name is `state`, so the mismatch is between the .c and .h files. The declaration in `drm_atomic.h` uses `state` as the parameter name:

```c
drm_atomic_add_affected_colorops(struct drm_plane_state *state,
                                 struct drm_plane *plane);
```

This is acceptable, but ideally the parameter name in the header and implementation should match (`plane_state` in both places would be clearer).

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-04 23:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01 13:06 [PATCH v4 0/6] drm/atomic: track colorop changes of a given plane Melissa Wen
2026-05-01 13:06 ` [PATCH v4 1/6] drm/atomic: only add colorop state from active color pipeline Melissa Wen
2026-05-04 23:26   ` Claude Code Review Bot [this message]
2026-05-01 13:06 ` [PATCH v4 2/6] drm/atomic: don't set colorop properties of inactive color pipelines Melissa Wen
2026-05-04 23:26   ` Claude review: " Claude Code Review Bot
2026-05-01 13:06 ` [PATCH v4 3/6] drm/colorop: Remove read-only comments from interpolation fields Melissa Wen
2026-05-04 23:26   ` Claude review: " Claude Code Review Bot
2026-05-01 13:06 ` [PATCH v4 4/6] drm/colorop: make lut(1/3)d_interpolation mutable Melissa Wen
2026-05-04 23:26   ` Claude review: " Claude Code Review Bot
2026-05-01 13:06 ` [PATCH v4 5/6] drm/atomic: track individual colorop updates Melissa Wen
2026-05-04 23:26   ` Claude review: " Claude Code Review Bot
2026-05-01 13:06 ` [PATCH v4 6/6] drm/amd/display: use plane color_mgmt_changed to track colorop changes Melissa Wen
2026-05-04 21:08   ` kernel test robot
2026-05-04 23:26   ` Claude review: " Claude Code Review Bot
2026-05-04 23:26 ` Claude review: drm/atomic: track colorop changes of a given plane 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-20260501132527.522320-2-mwen@igalia.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