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/atomic: only add colorop state from active color pipeline Date: Tue, 05 May 2026 09:26:01 +1000 Message-ID: In-Reply-To: <20260501132527.522320-2-mwen@igalia.com> References: <20260501132527.522320-1-mwen@igalia.com> <20260501132527.522320-2-mwen@igalia.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Purpose:** Changes `drm_atomic_add_affected_colorops()` to walk only the = active pipeline's linked list (`colorop->next`) instead of iterating all co= lorops on the device and filtering by plane. **Review:** The core logic change is good =E2=80=94 walking the linked list via `plane_= state->color_pipeline` / `colorop->next` is both more efficient and semanti= cally correct: ```c for (colorop =3D plane_state->color_pipeline; colorop; colorop =3D colorop->next) { colorop_state =3D drm_atomic_get_colorop_state(plane_state->state, colo= rop); ``` 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 = =E2=80=94 consider whether `plane` should be dropped from the signature ent= irely to avoid callers passing a mismatched plane. That said, it mirrors th= e 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 p= lane_state is now passed directly. The callers in `drm_atomic_add_affected_planes` and `drm_atomic_helper_dupl= icate_state` are updated cleanly =E2=80=94 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` =E2=80=94 this is fine but slightl= y unusual for kerneldoc since `@state` doesn't match the parameter name `pl= ane_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 implem= entation should match (`plane_state` in both places would be clearer). --- Generated by Claude Code Patch Reviewer