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/colorop: make lut(1/3)d_interpolation mutable
Date: Tue, 05 May 2026 09:26:01 +1000	[thread overview]
Message-ID: <review-patch4-20260501132527.522320-5-mwen@igalia.com> (raw)
In-Reply-To: <20260501132527.522320-5-mwen@igalia.com>

Patch Review

**Purpose:** Moves `lut1d_interpolation` and `lut3d_interpolation` from `struct drm_colorop` (immutable HW object) to `struct drm_colorop_state` (per-atomic-state), making them properly mutable.

**Review:**

The state reset initialization is correctly done through `drm_object_property_get_default_value`:

```c
if (colorop->lut1d_interpolation_property) {
    drm_object_property_get_default_value(&colorop->base,
                                          colorop->lut1d_interpolation_property,
                                          &val);
    colorop_state->lut1d_interpolation = val;
}
```

**Minor concern:** The return value of `drm_object_property_get_default_value` is not checked here. Looking at the existing `curve_1d_type` pattern just above:

```c
if (colorop->curve_1d_type_property) {
    drm_object_property_get_default_value(&colorop->base,
                                          colorop->curve_1d_type_property,
                                          &val))
```

Wait — in the existing code, the return value IS checked as part of an `if` condition. But in the new code for interpolation properties, it is NOT:

```c
if (colorop->lut1d_interpolation_property) {
    drm_object_property_get_default_value(&colorop->base,
                                          colorop->lut1d_interpolation_property,
                                          &val);
    colorop_state->lut1d_interpolation = val;
}
```

Looking at the existing code for `curve_1d_type`, the pattern is:
```c
if (colorop->curve_1d_type_property) {
    if (!drm_object_property_get_default_value(&colorop->base,
                                               colorop->curve_1d_type_property,
                                               &val))
        colorop_state->curve_1d_type = val;
}
```

**The new code doesn't guard the assignment with the return value check.** If `drm_object_property_get_default_value` fails, `val` would be stale from a previous call (the `curve_1d_type` lookup). This is probably benign since the property is guaranteed to exist when the property pointer is non-NULL, but it's inconsistent with the existing pattern. This should match the existing defensive style.

The removal of `colorop->lut1d_interpolation = interpolation` from the init functions is correct since the value now lives in state.

The print_state and get/set property changes are mechanical and correct.

---
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 review: " Claude Code Review Bot
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 Code Review Bot [this message]
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-patch4-20260501132527.522320-5-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