From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/atomic: only add states of active or transient active colorops
Date: Wed, 27 May 2026 14:45:25 +1000 [thread overview]
Message-ID: <review-patch1-20260526142940.504911-2-mwen@igalia.com> (raw)
In-Reply-To: <20260526142940.504911-2-mwen@igalia.com>
Patch Review
**Purpose:** Replaces the call to `drm_atomic_add_affected_colorops()` in `drm_atomic_add_affected_planes()` with a new `drm_atomic_add_pipeline_colorops()` that only walks the old and new pipeline chains rather than iterating over every colorop on the plane.
**Code quality:** The new function is well-structured with clear early-exit optimization when old and new pipelines are the same.
**Issue 1 — WARN_ON condition may be too strict:**
```c
if (WARN_ON(!new_plane_state || !old_plane_state))
return -EINVAL;
```
In `drm_atomic_add_affected_planes()`, `drm_atomic_get_plane_state()` was just called, which creates both old and new plane state entries. So `new_plane_state` being NULL here should indeed be impossible. However, `old_plane_state` is also guaranteed since `drm_atomic_get_plane_state()` always sets both old and new. The WARN_ON is defensive and fine, just noting it's arguably unnecessary.
**Issue 2 — docstring update in `drm_atomic_add_affected_colorops` is incomplete:**
The patch updates the doc comment for `drm_atomic_add_affected_colorops()`:
```c
- * currently used by @plane to the atomic configuration @state. This is useful
- * when an atomic commit also needs to check all currently enabled colorop on
- * @plane, e.g. when changing the mode. It's also useful when re-enabling a plane
+ * currently used by @plane to the atomic configuration @state. It's useful
+ * when re-enabling a plane to avoid special code to force-enable all colorops.
```
But the function still adds **all** colorops for the plane (via `drm_for_each_colorop`), not just pipeline-active ones. This is correct for its remaining caller (`drm_atomic_helper_duplicate_state` in Patch 2), but the doc should clarify that this adds *all* colorops, not just those in the active pipeline. This would help future readers understand the distinction from `drm_atomic_add_pipeline_colorops`.
**Otherwise looks correct.** The implementation properly handles the pipeline transition case (old pipeline != new pipeline) by walking both chains.
---
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-27 4:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-26 14:17 [PATCH 0/3] don't allow changes to inactive colorops Melissa Wen
2026-05-26 14:17 ` [PATCH 1/3] drm/atomic: only add states of active or transient active colorops Melissa Wen
2026-05-26 23:02 ` Alex Hung
2026-05-27 4:45 ` Claude Code Review Bot [this message]
2026-05-26 14:17 ` [PATCH 2/3] drm/atomic: duplicate state of all colorops Melissa Wen
2026-05-27 4:45 ` Claude review: " Claude Code Review Bot
2026-05-26 14:17 ` [PATCH 3/3] drm/atomic: reject colorop update from inactive color pipeline Melissa Wen
2026-05-26 23:04 ` Alex Hung
2026-05-27 4:45 ` Claude review: " Claude Code Review Bot
2026-05-27 4:45 ` Claude review: don't allow changes to inactive colorops 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-20260526142940.504911-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