public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* Claude review: drm/amd/display: use plane color_mgmt_changed to track colorop changes
  2026-03-23 13:15 ` [PATCH v2 2/2] drm/amd/display: use plane color_mgmt_changed to track colorop changes Melissa Wen
@ 2026-03-24 21:51   ` Claude Code Review Bot
  0 siblings, 0 replies; 15+ messages in thread
From: Claude Code Review Bot @ 2026-03-24 21:51 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Overall:** Straightforward driver-side consumption of the new flag. Very small and focused.

**Observations:**

1. **`amdgpu_dm_commit_planes` change** (line 456):
   ```c
   if (new_pcrtc_state->color_mgmt_changed || new_plane_state->color_mgmt_changed) {
   ```
   This correctly triggers color block updates when either CRTC or plane colorop state changes. This is the actual bug fix for the gamescope night mode issue.

2. **`should_reset_plane` change** (lines 464-466):
   ```c
   if (new_plane_state->color_mgmt_changed)
       return true;
   ```
   This ensures plane reset (remove + re-add to DC state) happens on colorop changes. This parallels the existing `new_crtc_state->color_mgmt_changed` check just above it. The comment is clear and appropriate.

3. **Potential concern - plane reset cost**: Returning `true` from `should_reset_plane` triggers a full plane remove/re-add cycle in DC. For frequent colorop updates (e.g., animated night mode transitions), this could be heavyweight. However, this matches the existing behavior for CRTC color mgmt changes, so it's consistent with current expectations. If performance becomes an issue, it could be optimized later to only do a surface update without full reset, but that's out of scope here.

4. **No changes needed for `amdgpu_dm_atomic_check`**: The existing check path already handles plane state validation, so no additional check-phase changes are needed. This is correct since the core DRM atomic code already sets up the plane state properly in patch 1.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Claude review: drm/amd/display: use plane color_mgmt_changed to track colorop changes
  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 23:26   ` Claude Code Review Bot
  0 siblings, 0 replies; 15+ messages in thread
From: Claude Code Review Bot @ 2026-05-04 23:26 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Purpose:** Makes the AMD display driver react to plane-level `color_mgmt_changed`, completing the end-to-end fix.

**Review:**

The `amdgpu_dm_commit_planes` change is straightforward:

```c
-if (new_pcrtc_state->color_mgmt_changed) {
+if (new_pcrtc_state->color_mgmt_changed || new_plane_state->color_mgmt_changed) {
```

This correctly extends the existing CRTC-level check to also cover plane-level colorop changes.

The `should_reset_plane` addition:

```c
+if (new_plane_state->color_mgmt_changed)
+    return true;
```

This is placed right after the CRTC `color_mgmt_changed` check, which is logically consistent. However, **returning `true` from `should_reset_plane` causes plane recreation** (remove + re-add to DC state), which is a heavier operation than just updating surface properties. Is a full plane reset always necessary for colorop changes, or would just the surface update in `amdgpu_dm_commit_planes` suffice?

Looking at the existing code, the CRTC `color_mgmt_changed` also triggers a plane reset, so this follows the established pattern. The comment says "Plane color pipeline or its colorop changes" which is clear.

**Overall this patch is correct** and represents the minimal driver-side change to consume the new tracking mechanism.

---

**Summary:** The series is well-crafted and addresses a real bug. The main substantive issue is the missing return value check for `drm_object_property_get_default_value` in patch 4's `__drm_colorop_state_reset` additions. The UAPI tightening in patch 2 should be called out more explicitly. Otherwise, this looks good to merge.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Claude review: drm/amd/display: use plane color_mgmt_changed to track colorop changes
  2026-05-06 19:23 ` [PATCH v5 6/6] drm/amd/display: use plane color_mgmt_changed to track colorop changes Melissa Wen
@ 2026-05-07  3:05   ` Claude Code Review Bot
  0 siblings, 0 replies; 15+ messages in thread
From: Claude Code Review Bot @ 2026-05-07  3:05 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Assessment: Good, straightforward driver-side consumer**

This wires the new `color_mgmt_changed` flag into the AMD display driver at two critical points:

1. **`amdgpu_dm_commit_planes()`**: The color surface updates (gamma, transfer func, gamut remap, HDR mult, shaper, 3D LUT, blend TF) now also trigger when `new_plane_state->color_mgmt_changed` is set:
```c
if (new_pcrtc_state->color_mgmt_changed || new_plane_state->color_mgmt_changed) {
```
This is the actual bug fix — without this, changing colorop properties (like shaper/3D LUT for night mode) wouldn't cause DC to reprogram the color blocks.

2. **`should_reset_plane()`**: Returns true when `new_plane_state->color_mgmt_changed` is set, causing plane reset during atomic check. This ensures the DC plane state is fully recreated when colorop properties change.

Both additions are consistent with the existing CRTC `color_mgmt_changed` pattern. The comment `/* Plane color pipeline or its colorop changes. */` is appropriate.

Harry's R-b tag from v1 carried forward is noted.

**One question for the maintainer**: `should_reset_plane()` returning true can trigger full plane recreation which is relatively expensive. For the gamescope night mode use case (shaper/3D LUT data changes), this should be fine since it happens on user-initiated actions, not per-frame. But if a compositor were to update colorop properties every frame, this could cause performance issues. The existing CRTC `color_mgmt_changed` path has the same characteristic, so this is consistent, but worth keeping in mind.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Claude review: drm/amd/display: use plane color_mgmt_changed to track colorop changes
  2026-05-19 21:09 ` [PATCH v6 6/6] drm/amd/display: use plane color_mgmt_changed to track colorop changes Melissa Wen
@ 2026-05-25 12:24   ` Claude Code Review Bot
  0 siblings, 0 replies; 15+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 12:24 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Status: Looks good**

Driver-side consumption of the new `plane_state->color_mgmt_changed` flag in two places in `amdgpu_dm.c`:

1. `amdgpu_dm_commit_planes`: Extends the existing CRTC `color_mgmt_changed` check to also trigger on plane-level changes:
```c
if (new_pcrtc_state->color_mgmt_changed || new_plane_state->color_mgmt_changed) {
```

2. `should_reset_plane`: Adds a new check that forces plane reset when color management changed:
```c
if (new_plane_state->color_mgmt_changed)
    return true;
```

Both are straightforward and correct. The comment "Plane color pipeline or its colorop changes." is acceptable. This patch fixes the actual user-visible bug (gamescope night mode shaper/3D LUT updates not taking effect).

---

**Summary of required changes:**
- **Must fix**: Squash the `drm_colorop.c` syntax fixes from Patch 5 into Patch 4 to fix the build breakage and maintain bisectability. The two-character changes (`));` → `))` and `&val);` → `&val))`) belong where the code was introduced.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Claude review: drm/amd/display: use plane color_mgmt_changed to track colorop changes
  2026-05-25  9:50 ` [PATCH v7 4/4] drm/amd/display: use plane color_mgmt_changed to track colorop changes Melissa Wen
@ 2026-05-25 21:18   ` Claude Code Review Bot
  0 siblings, 0 replies; 15+ messages in thread
From: Claude Code Review Bot @ 2026-05-25 21:18 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

The AMD driver consumer of the new flag. Two changes:

1. In `amdgpu_dm_commit_planes` (line ~10201):
```c
if (new_pcrtc_state->color_mgmt_changed || new_plane_state->color_mgmt_changed) {
```
Previously only CRTC color_mgmt_changed triggered updating the surface color blocks (gamma, transfer func, gamut remap, shaper LUT, 3D LUT). Now plane-level colorop changes also trigger this. This is the actual bug fix for gamescope night mode.

2. In `should_reset_plane` (line ~12027):
```c
if (new_plane_state->color_mgmt_changed)
    return true;
```
Forces a plane reset (remove and re-add to DC state) when plane color management changes. This parallels the existing CRTC `color_mgmt_changed` check just above it.

**Question worth considering**: `should_reset_plane` returning `true` triggers a full plane remove/re-add in DC. For pure colorop property changes (e.g., just changing an interpolation mode), this may be heavier than necessary — the `amdgpu_dm_commit_planes` surface update path might be sufficient without a full reset. However, this matches the existing behavior for CRTC color management changes and is the safe approach. If performance is a concern for high-frequency colorop updates, this could be revisited later, but correctness is ensured.

No bugs found.

---

**Summary**: The series is correct and ready to merge. The change tracking logic properly detects actual value changes (not just property sets), the state management for interpolation fields follows established patterns, and the AMD driver correctly consumes the new flag. All patches have appropriate reviewed-by tags.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v8 0/4] drm/atomic: track individual colorop updates
@ 2026-06-02 21:53 Melissa Wen
  2026-06-02 21:53 ` [PATCH v8 1/4] drm/colorop: Remove read-only comments from interpolation fields Melissa Wen
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Melissa Wen @ 2026-06-02 21:53 UTC (permalink / raw)
  To: airlied, alexander.deucher, alex.hung, christian.koenig, contact,
	daniels, harry.wentland, louis.chauvet, maarten.lankhorst,
	mripard, mwen, sebastian.wick, simona, siqueira, sunpeng.li,
	tzimmermann
  Cc: Uma Shankar, Chaitanya Kumar Borah, Xaver Hugl, Pekka Paalanen,
	Matthew Schwartz, amd-gfx, kernel-dev, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, linux-arm-msm, freedreno, intel-xe, intel-gfx,
	dri-devel

This is a partial of [1], only with patches related to individual
colorop update tracking. I.e., I'm detaching from here fixes regarding
attempts of changing colorops that are not part of an active color
pipeline, or in the transition between active and inactive color
pipelines.

This series focus on tracking updates for each individual color
operation, allowing the driver to react accordingly. This new version
just adds r-b and Fixes tag accordingly. During the Display Next
Hackfest we also agree that it should be applied to drm-misc-fixes and
it can be backported by AMD after.

- Patches 1 and 2 make lut1d_interpolation and lut3d_interpolation
  colorops correctly behave as mutable, handling their changes via
  drm_colorop_state.

- Patches 3 and 4 track colorop updates of a given plane color
  pipeline by setting plane `color_mgmt_changed` flag, similar to what
  is done for tracking CRTC color mgmt property changes with CRTC
  `color_mgmt_changed` flag. The flag also tracks when a different color
  pipeline is set to a given plane, but doesn't consider as a change
  when the same color pipeline value is set to the plane COLOR_PIPELINE
  prop. That way, the driver can react accordingly and update their
  color blocks. As interpolation properties become mutable, they are
  also tracked here.

It also fixes shaper/3D LUT updates when changing night mode settings on
gamescope with a custom branch that supports `COLOR_PIPELINE`:
- https://github.com/ValveSoftware/gamescope/pull/2113

v1: https://lore.kernel.org/dri-devel/20260318162348.299807-1-mwen@igalia.com/
Changes:
- include linux types for function's bool return type (kernel bot on MSM
  driver)
- add Harry's r-b tags

v2: https://lore.kernel.org/dri-devel/20260323131942.494217-1-mwen@igalia.com/
Changes:
- [NEW] two patches to only consider colorop updates from active color
  pipelines (Chaitanya)
- [NEW] make lut interpolation properties mutable + Alex H patch for
  kernel docs
- track lut(1/3)d_interpolation updates (Chaitanya)
- rebase changes according to new patches

v3: https://lore.kernel.org/dri-devel/20260403135909.214378-1-mwen@igalia.com/
Changes: rebase on drm-misc-next

v4: https://lore.kernel.org/dri-devel/20260501132527.522320-1-mwen@igalia.com/
Changes: fix kernel doc (kernel bot)

v5: https://lore.kernel.org/dri-devel/20260506192633.16066-1-mwen@igalia.com/
Changes:
- rebase on drm-misc-next
- fix kernel-doc and correctly reword (atomic) state to plane_state (Chaitanya)
- reject inactive colorop updates in atomic check time, instead of
  during property's setup, to avoid ordering dependency as pointed out by Chaitanya
- use `|= replaced` for consistency (Chaitanya)
- add Chaitanya's r-b tags to patches 1,3-5

[1] v6: https://lore.kernel.org/dri-devel/20260519211111.228303-1-mwen@igalia.com/
Changes:
- detach patches that implement individual tracking from those related
  to inactive colorop updates.

v7: https://lore.kernel.org/dri-devel/20260525100524.304263-1-mwen@igalia.com/
Changes:
- add Fixes and r-b tags

Alex Hung (1):
  drm/colorop: Remove read-only comments from interpolation fields

Melissa Wen (3):
  drm/colorop: make lut(1/3)d_interpolation props correctly behave as
    mutable
  drm/atomic: track individual colorop updates
  drm/amd/display: use plane color_mgmt_changed to track colorop changes

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  6 +-
 drivers/gpu/drm/drm_atomic.c                  |  4 +-
 drivers/gpu/drm/drm_atomic_uapi.c             | 68 +++++++++++++++----
 drivers/gpu/drm/drm_colorop.c                 | 16 ++++-
 include/drm/drm_atomic_uapi.h                 |  4 +-
 include/drm/drm_colorop.h                     | 34 +++++-----
 6 files changed, 93 insertions(+), 39 deletions(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v8 1/4] drm/colorop: Remove read-only comments from interpolation fields
  2026-06-02 21:53 [PATCH v8 0/4] drm/atomic: track individual colorop updates Melissa Wen
@ 2026-06-02 21:53 ` Melissa Wen
  2026-06-04  2:16   ` Claude review: " Claude Code Review Bot
  2026-06-02 21:53 ` [PATCH v8 2/4] drm/colorop: make lut(1/3)d_interpolation props correctly behave as mutable Melissa Wen
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Melissa Wen @ 2026-06-02 21:53 UTC (permalink / raw)
  To: airlied, alexander.deucher, alex.hung, christian.koenig, contact,
	daniels, harry.wentland, louis.chauvet, maarten.lankhorst,
	mripard, mwen, sebastian.wick, simona, siqueira, sunpeng.li,
	tzimmermann
  Cc: Uma Shankar, Chaitanya Kumar Borah, Xaver Hugl, Pekka Paalanen,
	Matthew Schwartz, amd-gfx, kernel-dev, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, linux-arm-msm, freedreno, intel-xe, intel-gfx,
	dri-devel

From: Alex Hung <alex.hung@amd.com>

The lut1d_interpolation and lut3d_interpolation fields and their
associated properties were marked as read-only, but userspace
can set them via drm_atomic_colorop_set_property().

Fixes: 7fa3ee8c0a79 ("drm/colorop: Define LUT_1D interpolation")
Fixes: db971856bbe0 ("drm/colorop: Add 3D LUT support to color pipeline")
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Melissa Wen <mwen@igalia.com>
---
 include/drm/drm_colorop.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/drm/drm_colorop.h b/include/drm/drm_colorop.h
index b4b9e4f558ab..5cea4d7c4efa 100644
--- a/include/drm/drm_colorop.h
+++ b/include/drm/drm_colorop.h
@@ -309,7 +309,6 @@ struct drm_colorop {
 	/**
 	 * @lut1d_interpolation:
 	 *
-	 * Read-only
 	 * Interpolation for DRM_COLOROP_1D_LUT
 	 */
 	enum drm_colorop_lut1d_interpolation_type lut1d_interpolation;
@@ -317,7 +316,6 @@ struct drm_colorop {
 	/**
 	 * @lut3d_interpolation:
 	 *
-	 * Read-only
 	 * Interpolation for DRM_COLOROP_3D_LUT
 	 */
 	enum drm_colorop_lut3d_interpolation_type lut3d_interpolation;
@@ -325,7 +323,7 @@ struct drm_colorop {
 	/**
 	 * @lut1d_interpolation_property:
 	 *
-	 * Read-only property for DRM_COLOROP_1D_LUT interpolation
+	 * Property for DRM_COLOROP_1D_LUT interpolation
 	 */
 	struct drm_property *lut1d_interpolation_property;
 
@@ -353,7 +351,7 @@ struct drm_colorop {
 	/**
 	 * @lut3d_interpolation_property:
 	 *
-	 * Read-only property for DRM_COLOROP_3D_LUT interpolation
+	 * Property for DRM_COLOROP_3D_LUT interpolation
 	 */
 	struct drm_property *lut3d_interpolation_property;
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v8 2/4] drm/colorop: make lut(1/3)d_interpolation props correctly behave as mutable
  2026-06-02 21:53 [PATCH v8 0/4] drm/atomic: track individual colorop updates Melissa Wen
  2026-06-02 21:53 ` [PATCH v8 1/4] drm/colorop: Remove read-only comments from interpolation fields Melissa Wen
@ 2026-06-02 21:53 ` Melissa Wen
  2026-06-04  2:16   ` Claude review: " Claude Code Review Bot
  2026-06-02 21:53 ` [PATCH v8 3/4] drm/atomic: track individual colorop updates Melissa Wen
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Melissa Wen @ 2026-06-02 21:53 UTC (permalink / raw)
  To: airlied, alexander.deucher, alex.hung, christian.koenig, contact,
	daniels, harry.wentland, louis.chauvet, maarten.lankhorst,
	mripard, mwen, sebastian.wick, simona, siqueira, sunpeng.li,
	tzimmermann
  Cc: Uma Shankar, Chaitanya Kumar Borah, Xaver Hugl, Pekka Paalanen,
	Matthew Schwartz, amd-gfx, kernel-dev, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, linux-arm-msm, freedreno, intel-xe, intel-gfx,
	dri-devel

As interpolation props are actually mutable props, any changes should be
handled by drm_colorop_state. Move their enum and make it correctly
behaves as mutable.

Fixes: 7fa3ee8c0a79 ("drm/colorop: Define LUT_1D interpolation")
Fixes: db971856bbe0 ("drm/colorop: Add 3D LUT support to color pipeline")
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Melissa Wen <mwen@igalia.com>
---
 drivers/gpu/drm/drm_atomic.c      |  4 ++--
 drivers/gpu/drm/drm_atomic_uapi.c |  8 ++++----
 drivers/gpu/drm/drm_colorop.c     | 16 ++++++++++++++--
 include/drm/drm_colorop.h         | 28 ++++++++++++++--------------
 4 files changed, 34 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 3af1b9cc9a06..735ab7badc2e 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -910,7 +910,7 @@ static void drm_atomic_colorop_print_state(struct drm_printer *p,
 	case DRM_COLOROP_1D_LUT:
 		drm_printf_indent(p, 1, "size=%d\n", colorop->size);
 		drm_printf_indent(p, 1, "interpolation=%s\n",
-				  drm_get_colorop_lut1d_interpolation_name(colorop->lut1d_interpolation));
+				  drm_get_colorop_lut1d_interpolation_name(state->lut1d_interpolation));
 		drm_printf_indent(p, 1, "data blob id=%d\n", state->data ? state->data->base.id : 0);
 		break;
 	case DRM_COLOROP_CTM_3X4:
@@ -922,7 +922,7 @@ static void drm_atomic_colorop_print_state(struct drm_printer *p,
 	case DRM_COLOROP_3D_LUT:
 		drm_printf_indent(p, 1, "size=%d\n", colorop->size);
 		drm_printf_indent(p, 1, "interpolation=%s\n",
-				  drm_get_colorop_lut3d_interpolation_name(colorop->lut3d_interpolation));
+				  drm_get_colorop_lut3d_interpolation_name(state->lut3d_interpolation));
 		drm_printf_indent(p, 1, "data blob id=%d\n", state->data ? state->data->base.id : 0);
 		break;
 	default:
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index 6441b55cc274..78423905051e 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -751,13 +751,13 @@ static int drm_atomic_colorop_set_property(struct drm_colorop *colorop,
 	if (property == colorop->bypass_property) {
 		state->bypass = val;
 	} else if (property == colorop->lut1d_interpolation_property) {
-		colorop->lut1d_interpolation = val;
+		state->lut1d_interpolation = val;
 	} else if (property == colorop->curve_1d_type_property) {
 		state->curve_1d_type = val;
 	} else if (property == colorop->multiplier_property) {
 		state->multiplier = val;
 	} else if (property == colorop->lut3d_interpolation_property) {
-		colorop->lut3d_interpolation = val;
+		state->lut3d_interpolation = val;
 	} else if (property == colorop->data_property) {
 		return drm_atomic_color_set_data_property(colorop, state,
 							  property, val);
@@ -782,7 +782,7 @@ drm_atomic_colorop_get_property(struct drm_colorop *colorop,
 	else if (property == colorop->bypass_property)
 		*val = state->bypass;
 	else if (property == colorop->lut1d_interpolation_property)
-		*val = colorop->lut1d_interpolation;
+		*val = state->lut1d_interpolation;
 	else if (property == colorop->curve_1d_type_property)
 		*val = state->curve_1d_type;
 	else if (property == colorop->multiplier_property)
@@ -790,7 +790,7 @@ drm_atomic_colorop_get_property(struct drm_colorop *colorop,
 	else if (property == colorop->size_property)
 		*val = colorop->size;
 	else if (property == colorop->lut3d_interpolation_property)
-		*val = colorop->lut3d_interpolation;
+		*val = state->lut3d_interpolation;
 	else if (property == colorop->data_property)
 		*val = (state->data) ? state->data->base.id : 0;
 	else
diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c
index c0eecde8c176..682fcc651525 100644
--- a/drivers/gpu/drm/drm_colorop.c
+++ b/drivers/gpu/drm/drm_colorop.c
@@ -342,7 +342,6 @@ int drm_plane_colorop_curve_1d_lut_init(struct drm_device *dev, struct drm_color
 
 	colorop->lut1d_interpolation_property = prop;
 	drm_object_attach_property(&colorop->base, prop, interpolation);
-	colorop->lut1d_interpolation = interpolation;
 
 	/* data */
 	ret = drm_colorop_create_data_prop(dev, colorop);
@@ -442,7 +441,6 @@ int drm_plane_colorop_3dlut_init(struct drm_device *dev, struct drm_colorop *col
 
 	colorop->lut3d_interpolation_property = prop;
 	drm_object_attach_property(&colorop->base, prop, interpolation);
-	colorop->lut3d_interpolation = interpolation;
 
 	/* data */
 	ret = drm_colorop_create_data_prop(dev, colorop);
@@ -521,6 +519,20 @@ static void __drm_colorop_state_init(struct drm_colorop_state *colorop_state,
 							   &val))
 			colorop_state->curve_1d_type = val;
 	}
+
+	if (colorop->lut1d_interpolation_property) {
+		if (!drm_object_property_get_default_value(&colorop->base,
+							   colorop->lut1d_interpolation_property,
+							   &val))
+			colorop_state->lut1d_interpolation = val;
+	}
+
+	if (colorop->lut3d_interpolation_property) {
+		if (!drm_object_property_get_default_value(&colorop->base,
+							   colorop->lut3d_interpolation_property,
+							   &val))
+			colorop_state->lut3d_interpolation = val;
+	}
 }
 
 /**
diff --git a/include/drm/drm_colorop.h b/include/drm/drm_colorop.h
index 5cea4d7c4efa..224fae40ed2b 100644
--- a/include/drm/drm_colorop.h
+++ b/include/drm/drm_colorop.h
@@ -183,6 +183,20 @@ struct drm_colorop_state {
 	 */
 	struct drm_property_blob *data;
 
+	/**
+	 * @lut1d_interpolation:
+	 *
+	 * Interpolation for DRM_COLOROP_1D_LUT
+	 */
+	enum drm_colorop_lut1d_interpolation_type lut1d_interpolation;
+
+	/**
+	 * @lut3d_interpolation:
+	 *
+	 * Interpolation for DRM_COLOROP_3D_LUT
+	 */
+	enum drm_colorop_lut3d_interpolation_type lut3d_interpolation;
+
 	/** @state: backpointer to global drm_atomic_commit */
 	struct drm_atomic_commit *state;
 };
@@ -306,20 +320,6 @@ struct drm_colorop {
 	 */
 	uint32_t size;
 
-	/**
-	 * @lut1d_interpolation:
-	 *
-	 * Interpolation for DRM_COLOROP_1D_LUT
-	 */
-	enum drm_colorop_lut1d_interpolation_type lut1d_interpolation;
-
-	/**
-	 * @lut3d_interpolation:
-	 *
-	 * Interpolation for DRM_COLOROP_3D_LUT
-	 */
-	enum drm_colorop_lut3d_interpolation_type lut3d_interpolation;
-
 	/**
 	 * @lut1d_interpolation_property:
 	 *
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v8 3/4] drm/atomic: track individual colorop updates
  2026-06-02 21:53 [PATCH v8 0/4] drm/atomic: track individual colorop updates Melissa Wen
  2026-06-02 21:53 ` [PATCH v8 1/4] drm/colorop: Remove read-only comments from interpolation fields Melissa Wen
  2026-06-02 21:53 ` [PATCH v8 2/4] drm/colorop: make lut(1/3)d_interpolation props correctly behave as mutable Melissa Wen
@ 2026-06-02 21:53 ` Melissa Wen
  2026-06-04  2:16   ` Claude review: " Claude Code Review Bot
  2026-06-02 21:53 ` [PATCH v8 4/4] drm/amd/display: use plane color_mgmt_changed to track colorop changes Melissa Wen
  2026-06-04  2:16 ` Claude review: drm/atomic: track individual colorop updates Claude Code Review Bot
  4 siblings, 1 reply; 15+ messages in thread
From: Melissa Wen @ 2026-06-02 21:53 UTC (permalink / raw)
  To: airlied, alexander.deucher, alex.hung, christian.koenig, contact,
	daniels, harry.wentland, louis.chauvet, maarten.lankhorst,
	mripard, mwen, sebastian.wick, simona, siqueira, sunpeng.li,
	tzimmermann
  Cc: Uma Shankar, Chaitanya Kumar Borah, Xaver Hugl, Pekka Paalanen,
	Matthew Schwartz, amd-gfx, kernel-dev, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, linux-arm-msm, freedreno, intel-xe, intel-gfx,
	dri-devel

As we do for CRTC color mgmt properties, use color_mgmt_changed flag to
track any value changes in the color pipeline of a given plane, so that
drivers can update color blocks as soon as plane color pipeline or
individual colorop values change. Since we're here, only announce and
track changes to plane COLOR_PIPELINE prop if its value is actually
changing.

Fixes: 8c5ea1745f4c ("drm/colorop: Add BYPASS property")
Fixes: 7fa3ee8c0a79 ("drm/colorop: Define LUT_1D interpolation")
Fixes: 41651f9d42eb ("drm/colorop: Add 1D Curve subtype")
Fixes: 3410108037d5 ("drm/colorop: Add multiplier type")
Fixes: db971856bbe0 ("drm/colorop: Add 3D LUT support to color pipeline")
Fixes: e5719e7f1900 ("drm/colorop: Add 3x4 CTM type")
Fixes: 99a4e4f08abe ("drm/colorop: Add 1D Curve Custom LUT type")
Fixes: 2afc3184f3b3 ("drm/plane: Add COLOR PIPELINE property")
Reviewed-by: Harry Wentland <harry.wentland@amd.com> #v1
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Melissa Wen <mwen@igalia.com>
---
 drivers/gpu/drm/drm_atomic_uapi.c | 64 ++++++++++++++++++++++++-------
 include/drm/drm_atomic_uapi.h     |  4 +-
 2 files changed, 54 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index 78423905051e..e997917819e8 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -265,13 +265,19 @@ EXPORT_SYMBOL(drm_atomic_set_fb_for_plane);
  *
  * Helper function to select the color pipeline on a plane by setting
  * it to the first drm_colorop element of the pipeline.
+ *
+ * Return: true if plane color pipeline value changed, false otherwise.
  */
-void
+bool
 drm_atomic_set_colorop_for_plane(struct drm_plane_state *plane_state,
 				 struct drm_colorop *colorop)
 {
 	struct drm_plane *plane = plane_state->plane;
 
+	/* Color pipeline didn't change */
+	if (plane_state->color_pipeline == colorop)
+		return false;
+
 	if (colorop)
 		drm_dbg_atomic(plane->dev,
 			       "Set [COLOROP:%d] for [PLANE:%d:%s] state %p\n",
@@ -283,6 +289,8 @@ drm_atomic_set_colorop_for_plane(struct drm_plane_state *plane_state,
 			       plane->base.id, plane->name, plane_state);
 
 	plane_state->color_pipeline = colorop;
+
+	return true;
 }
 EXPORT_SYMBOL(drm_atomic_set_colorop_for_plane);
 
@@ -604,7 +612,7 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane,
 		if (val && !colorop)
 			return -EACCES;
 
-		drm_atomic_set_colorop_for_plane(state, colorop);
+		state->color_mgmt_changed |= drm_atomic_set_colorop_for_plane(state, colorop);
 	} else if (property == config->prop_fb_damage_clips) {
 		ret = drm_property_replace_blob_from_id(dev,
 					&state->fb_damage_clips,
@@ -713,11 +721,11 @@ drm_atomic_plane_get_property(struct drm_plane *plane,
 static int drm_atomic_color_set_data_property(struct drm_colorop *colorop,
 					      struct drm_colorop_state *state,
 					      struct drm_property *property,
-					      uint64_t val)
+					      uint64_t val,
+					      bool *replaced)
 {
 	ssize_t elem_size = -1;
 	ssize_t size = -1;
-	bool replaced = false;
 
 	switch (colorop->type) {
 	case DRM_COLOROP_1D_LUT:
@@ -739,28 +747,45 @@ static int drm_atomic_color_set_data_property(struct drm_colorop *colorop,
 						 &state->data,
 						 val,
 						 -1, size, elem_size,
-						 &replaced);
+						 replaced);
 }
 
 static int drm_atomic_colorop_set_property(struct drm_colorop *colorop,
 					   struct drm_colorop_state *state,
 					   struct drm_file *file_priv,
 					   struct drm_property *property,
-					   uint64_t val)
+					   uint64_t val,
+					   bool *replaced)
 {
 	if (property == colorop->bypass_property) {
-		state->bypass = val;
+		if (state->bypass != val) {
+			state->bypass = val;
+			*replaced = true;
+		}
 	} else if (property == colorop->lut1d_interpolation_property) {
-		state->lut1d_interpolation = val;
+		if (state->lut1d_interpolation != val) {
+			state->lut1d_interpolation = val;
+			*replaced = true;
+		}
 	} else if (property == colorop->curve_1d_type_property) {
-		state->curve_1d_type = val;
+		if (state->curve_1d_type != val) {
+			state->curve_1d_type = val;
+			*replaced = true;
+		}
 	} else if (property == colorop->multiplier_property) {
-		state->multiplier = val;
+		if (state->multiplier != val) {
+			state->multiplier = val;
+			*replaced = true;
+		}
 	} else if (property == colorop->lut3d_interpolation_property) {
-		state->lut3d_interpolation = val;
+		if (state->lut3d_interpolation != val) {
+			state->lut3d_interpolation = val;
+			*replaced = true;
+		}
 	} else if (property == colorop->data_property) {
 		return drm_atomic_color_set_data_property(colorop, state,
-							  property, val);
+							  property, val,
+							  replaced);
 	} else {
 		drm_dbg_atomic(colorop->dev,
 			       "[COLOROP:%d:%d] unknown property [PROP:%d:%s]\n",
@@ -1275,8 +1300,10 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 		break;
 	}
 	case DRM_MODE_OBJECT_COLOROP: {
+		struct drm_plane_state *plane_state;
 		struct drm_colorop *colorop = obj_to_colorop(obj);
 		struct drm_colorop_state *colorop_state;
+		bool replaced = false;
 
 		colorop_state = drm_atomic_get_colorop_state(state, colorop);
 		if (IS_ERR(colorop_state)) {
@@ -1285,7 +1312,18 @@ int drm_atomic_set_property(struct drm_atomic_commit *state,
 		}
 
 		ret = drm_atomic_colorop_set_property(colorop, colorop_state,
-						      file_priv, prop, prop_value);
+						      file_priv, prop, prop_value,
+						      &replaced);
+		if (ret || !replaced)
+			break;
+
+		plane_state = drm_atomic_get_plane_state(state, colorop->plane);
+		if (IS_ERR(plane_state)) {
+			ret = PTR_ERR(plane_state);
+			break;
+		}
+		plane_state->color_mgmt_changed |= replaced;
+
 		break;
 	}
 	default:
diff --git a/include/drm/drm_atomic_uapi.h b/include/drm/drm_atomic_uapi.h
index 436315523326..4e7e78f711e2 100644
--- a/include/drm/drm_atomic_uapi.h
+++ b/include/drm/drm_atomic_uapi.h
@@ -29,6 +29,8 @@
 #ifndef DRM_ATOMIC_UAPI_H_
 #define DRM_ATOMIC_UAPI_H_
 
+#include <linux/types.h>
+
 struct drm_crtc_state;
 struct drm_display_mode;
 struct drm_property_blob;
@@ -50,7 +52,7 @@ drm_atomic_set_crtc_for_plane(struct drm_plane_state *plane_state,
 			      struct drm_crtc *crtc);
 void drm_atomic_set_fb_for_plane(struct drm_plane_state *plane_state,
 				 struct drm_framebuffer *fb);
-void drm_atomic_set_colorop_for_plane(struct drm_plane_state *plane_state,
+bool drm_atomic_set_colorop_for_plane(struct drm_plane_state *plane_state,
 				      struct drm_colorop *colorop);
 int __must_check
 drm_atomic_set_crtc_for_connector(struct drm_connector_state *conn_state,
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v8 4/4] drm/amd/display: use plane color_mgmt_changed to track colorop changes
  2026-06-02 21:53 [PATCH v8 0/4] drm/atomic: track individual colorop updates Melissa Wen
                   ` (2 preceding siblings ...)
  2026-06-02 21:53 ` [PATCH v8 3/4] drm/atomic: track individual colorop updates Melissa Wen
@ 2026-06-02 21:53 ` Melissa Wen
  2026-06-04  2:16   ` Claude review: " Claude Code Review Bot
  2026-06-04  2:16 ` Claude review: drm/atomic: track individual colorop updates Claude Code Review Bot
  4 siblings, 1 reply; 15+ messages in thread
From: Melissa Wen @ 2026-06-02 21:53 UTC (permalink / raw)
  To: airlied, alexander.deucher, alex.hung, christian.koenig, contact,
	daniels, harry.wentland, louis.chauvet, maarten.lankhorst,
	mripard, mwen, sebastian.wick, simona, siqueira, sunpeng.li,
	tzimmermann
  Cc: Uma Shankar, Chaitanya Kumar Borah, Xaver Hugl, Pekka Paalanen,
	Matthew Schwartz, amd-gfx, kernel-dev, Rob Clark,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten, linux-arm-msm, freedreno, intel-xe, intel-gfx,
	dri-devel

Ensure the driver tracks changes in any colorop property of a plane
color pipeline by using the same mechanism of CRTC color management and
update plane color blocks when any colorop property changes. It fixes an
issue observed on gamescope settings for night mode which is done via
shaper/3D-LUT updates.

Fixes: 9ba25915efba ("drm/amd/display: Add support for sRGB EOTF in DEGAM block")
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Melissa Wen <mwen@igalia.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index ba7f98a87808..ca97f1da8c0e 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -10215,7 +10215,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_commit *state,
 			continue;
 
 		bundle->surface_updates[planes_count].surface = dc_plane;
-		if (new_pcrtc_state->color_mgmt_changed) {
+		if (new_pcrtc_state->color_mgmt_changed || new_plane_state->color_mgmt_changed) {
 			bundle->surface_updates[planes_count].gamma = &dc_plane->gamma_correction;
 			bundle->surface_updates[planes_count].in_transfer_func = &dc_plane->in_transfer_func;
 			bundle->surface_updates[planes_count].gamut_remap_matrix = &dc_plane->gamut_remap_matrix;
@@ -12057,6 +12057,10 @@ static bool should_reset_plane(struct drm_atomic_commit *state,
 	if (new_crtc_state->color_mgmt_changed)
 		return true;
 
+	/* Plane color pipeline or its colorop changes. */
+	if (new_plane_state->color_mgmt_changed)
+		return true;
+
 	/*
 	 * On zpos change, planes need to be reordered by removing and re-adding
 	 * them one by one to the dc state, in order of descending zpos.
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Claude review: drm/atomic: track individual colorop updates
  2026-06-02 21:53 [PATCH v8 0/4] drm/atomic: track individual colorop updates Melissa Wen
                   ` (3 preceding siblings ...)
  2026-06-02 21:53 ` [PATCH v8 4/4] drm/amd/display: use plane color_mgmt_changed to track colorop changes Melissa Wen
@ 2026-06-04  2:16 ` Claude Code Review Bot
  4 siblings, 0 replies; 15+ messages in thread
From: Claude Code Review Bot @ 2026-06-04  2:16 UTC (permalink / raw)
  To: dri-devel-reviews

Overall Series Review

Subject: drm/atomic: track individual colorop updates
Author: Melissa Wen <mwen@igalia.com>
Patches: 5
Reviewed: 2026-06-04T12:16:43.925332

---

This is a clean, well-structured 4-patch bug-fix series at v8. It addresses two related issues in the DRM color pipeline (colorop) infrastructure:

1. **lut1d/lut3d interpolation properties were incorrectly treated as immutable** — stored on `drm_colorop` instead of `drm_colorop_state`, meaning changes from userspace went to the wrong place and weren't tracked per-atomic-state.

2. **Individual colorop property changes were not tracked** — changing a colorop property (bypass, curve type, LUT data, multiplier, interpolation) didn't set `plane_state->color_mgmt_changed`, so drivers had no way to know color blocks needed updating. This broke gamescope night-mode (shaper/3D-LUT updates).

The series is logically ordered: first fix docs (patch 1), then fix the data model (patch 2), then add change tracking in the core (patch 3), then wire it up in AMD's driver (patch 4). Each patch is independently correct, has appropriate Fixes tags, and carries reviewed-by tags from multiple reviewers (Intel, AMD). The code is straightforward, follows existing patterns, and I found no correctness bugs.

**Recommendation: This series looks ready to merge.**

---

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Claude review: drm/colorop: Remove read-only comments from interpolation fields
  2026-06-02 21:53 ` [PATCH v8 1/4] drm/colorop: Remove read-only comments from interpolation fields Melissa Wen
@ 2026-06-04  2:16   ` Claude Code Review Bot
  0 siblings, 0 replies; 15+ messages in thread
From: Claude Code Review Bot @ 2026-06-04  2:16 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Author:** Alex Hung

Trivial documentation fix. Removes "Read-only" from kernel-doc comments on `lut1d_interpolation`, `lut3d_interpolation`, `lut1d_interpolation_property`, and `lut3d_interpolation_property` fields in `struct drm_colorop`. The comments were wrong because `drm_atomic_colorop_set_property()` already allowed userspace to write these values.

**Verdict:** Correct and straightforward. No issues.

---

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Claude review: drm/colorop: make lut(1/3)d_interpolation props correctly behave as mutable
  2026-06-02 21:53 ` [PATCH v8 2/4] drm/colorop: make lut(1/3)d_interpolation props correctly behave as mutable Melissa Wen
@ 2026-06-04  2:16   ` Claude Code Review Bot
  0 siblings, 0 replies; 15+ messages in thread
From: Claude Code Review Bot @ 2026-06-04  2:16 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Author:** Melissa Wen

This is the key data-model fix. It moves `lut1d_interpolation` and `lut3d_interpolation` from `struct drm_colorop` (the immutable base object) to `struct drm_colorop_state` (the per-atomic-commit mutable state).

**Changes reviewed:**

- **`include/drm/drm_colorop.h`**: Fields move from `drm_colorop` to `drm_colorop_state`. Clean move, correct types preserved.

- **`drm_atomic_uapi.c`**: `drm_atomic_colorop_set_property()` and `drm_atomic_colorop_get_property()` now read/write `state->lut1d_interpolation` / `state->lut3d_interpolation` instead of `colorop->lut1d_interpolation` / `colorop->lut3d_interpolation`. Correct.

- **`drm_atomic.c` (`drm_atomic_colorop_print_state`)**: Debug printing now reads from `state->` instead of `colorop->`. Correct.

- **`drm_colorop.c`**: The `__drm_colorop_state_reset()` function (called `__drm_colorop_state_init` in the mbox diff context lines — presumably renamed in the base tree) now initializes the interpolation fields from the property defaults via `drm_object_property_get_default_value()`. This follows the existing pattern for `curve_1d_type`. The `colorop->lut1d_interpolation = interpolation` assignments in `drm_plane_colorop_curve_1d_lut_init()` and `drm_plane_colorop_3dlut_init()` are correctly removed since the field no longer exists on `drm_colorop`.

**Potential concern:** The interpolation fields are unconditionally present on every `drm_colorop_state`, even for colorop types that don't use them (e.g., CTM_3X4, MULTIPLIER). This wastes a few bytes per state object but is harmless and consistent with how other fields like `data` are handled.

**Verdict:** Correct. No issues.

---

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Claude review: drm/atomic: track individual colorop updates
  2026-06-02 21:53 ` [PATCH v8 3/4] drm/atomic: track individual colorop updates Melissa Wen
@ 2026-06-04  2:16   ` Claude Code Review Bot
  0 siblings, 0 replies; 15+ messages in thread
From: Claude Code Review Bot @ 2026-06-04  2:16 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Author:** Melissa Wen

This is the largest patch and the core behavioral change. It ensures `plane_state->color_mgmt_changed` is set whenever any colorop property in the plane's color pipeline actually changes value.

**Changes reviewed:**

- **`drm_atomic_set_colorop_for_plane()`** now returns `bool` instead of `void`. It returns `false` (no change) when the same colorop pointer is set again, `true` when it actually changes. The early-return for no-change avoids unnecessary debug logging and change tracking. Only one caller exists in-tree, at line 615, which uses `|=` to combine the result into `color_mgmt_changed`. Correct.

- **`drm_atomic_colorop_set_property()`** gains a `bool *replaced` output parameter. Each property branch now compares old vs new value before writing, and only sets `*replaced = true` when the value actually changed:

  ```c
  if (state->bypass != val) {
      state->bypass = val;
      *replaced = true;
  }
  ```

  This pattern is applied to `bypass`, `lut1d_interpolation`, `curve_1d_type`, `multiplier`, and `lut3d_interpolation`. The `data` property delegates to `drm_atomic_color_set_data_property()` which passes the pointer through to `drm_property_replace_blob_from_id()` — that function already has a `bool *replaced` parameter with the correct semantics.

- **`drm_atomic_set_property()` (DRM_MODE_OBJECT_COLOROP case)**: After calling `drm_atomic_colorop_set_property()`, if `ret || !replaced` it breaks early (no plane state needed). Otherwise it fetches the plane state and sets `plane_state->color_mgmt_changed |= replaced`. The `drm_atomic_get_plane_state()` call may fail (returns ERR_PTR), which is correctly handled.

- **`include/drm/drm_atomic_uapi.h`**: Adds `#include <linux/types.h>` for the `bool` return type, and updates the declaration. Clean.

**One minor observation:** At line 1325, `plane_state->color_mgmt_changed |= replaced;` — at this point `replaced` is guaranteed `true` (the `if (ret || !replaced) break;` on line 1317 already filtered the false case), so the `|=` is equivalent to `= true`. This is fine — using `|=` is defensive and matches the convention used elsewhere (e.g., line 615).

**Verdict:** Correct and well-implemented. No issues.

---

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Claude review: drm/amd/display: use plane color_mgmt_changed to track colorop changes
  2026-06-02 21:53 ` [PATCH v8 4/4] drm/amd/display: use plane color_mgmt_changed to track colorop changes Melissa Wen
@ 2026-06-04  2:16   ` Claude Code Review Bot
  0 siblings, 0 replies; 15+ messages in thread
From: Claude Code Review Bot @ 2026-06-04  2:16 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Author:** Melissa Wen

Wires up the new `plane_state->color_mgmt_changed` flag in AMD's display driver, at two critical decision points:

1. **`amdgpu_dm_commit_planes()`** (line 10218): The condition for sending color surface updates to DC now checks `new_plane_state->color_mgmt_changed` in addition to `new_pcrtc_state->color_mgmt_changed`:

   ```c
   if (new_pcrtc_state->color_mgmt_changed || new_plane_state->color_mgmt_changed) {
   ```

   This ensures that when a colorop property changes (e.g., shaper/3D-LUT update for gamescope night mode), the driver actually sends the updated gamma, transfer functions, gamut remap, HDR mult, shaper, 3D LUT, and blend TF to DC.

2. **`should_reset_plane()`** (line 12060–12062): Returns `true` when `new_plane_state->color_mgmt_changed` is set, causing the plane to be removed from and re-added to the DC state. This is the same behavior already triggered by `new_crtc_state->color_mgmt_changed`.

**Verdict:** Correct, minimal, and directly fixes the reported gamescope issue. No issues.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-06-04  2:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-02 21:53 [PATCH v8 0/4] drm/atomic: track individual colorop updates Melissa Wen
2026-06-02 21:53 ` [PATCH v8 1/4] drm/colorop: Remove read-only comments from interpolation fields Melissa Wen
2026-06-04  2:16   ` Claude review: " Claude Code Review Bot
2026-06-02 21:53 ` [PATCH v8 2/4] drm/colorop: make lut(1/3)d_interpolation props correctly behave as mutable Melissa Wen
2026-06-04  2:16   ` Claude review: " Claude Code Review Bot
2026-06-02 21:53 ` [PATCH v8 3/4] drm/atomic: track individual colorop updates Melissa Wen
2026-06-04  2:16   ` Claude review: " Claude Code Review Bot
2026-06-02 21:53 ` [PATCH v8 4/4] drm/amd/display: use plane color_mgmt_changed to track colorop changes Melissa Wen
2026-06-04  2:16   ` Claude review: " Claude Code Review Bot
2026-06-04  2:16 ` Claude review: drm/atomic: track individual colorop updates Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-25  9:49 [PATCH v7 0/4] " Melissa Wen
2026-05-25  9:50 ` [PATCH v7 4/4] drm/amd/display: use plane color_mgmt_changed to track colorop changes Melissa Wen
2026-05-25 21:18   ` Claude review: " Claude Code Review Bot
2026-05-19 21:09 [PATCH v6 0/6] drm/atomic: track individual colorop updates Melissa Wen
2026-05-19 21:09 ` [PATCH v6 6/6] drm/amd/display: use plane color_mgmt_changed to track colorop changes Melissa Wen
2026-05-25 12:24   ` Claude review: " Claude Code Review Bot
2026-05-06 19:23 [PATCH v5 0/6] drm/atomic: track individual colorop updates Melissa Wen
2026-05-06 19:23 ` [PATCH v5 6/6] drm/amd/display: use plane color_mgmt_changed to track colorop changes Melissa Wen
2026-05-07  3:05   ` Claude review: " Claude Code Review Bot
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 6/6] drm/amd/display: use plane color_mgmt_changed to track colorop changes Melissa Wen
2026-05-04 23:26   ` Claude review: " Claude Code Review Bot
2026-03-23 13:15 [PATCH v2 0/2] drm/atomic: track colorop changes of a given plane Melissa Wen
2026-03-23 13:15 ` [PATCH v2 2/2] drm/amd/display: use plane color_mgmt_changed to track colorop changes Melissa Wen
2026-03-24 21:51   ` Claude review: " Claude Code Review Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox