]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: use plane color_mgmt_changed to track colorop changes
authorMelissa Wen <mwen@igalia.com>
Tue, 9 Jun 2026 10:20:21 +0000 (12:20 +0200)
committerMelissa Wen <melissa.srw@gmail.com>
Wed, 10 Jun 2026 10:13:37 +0000 (07:13 -0300)
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>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patch.msgid.link/20260609110420.1298352-5-mwen@igalia.com
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index e96a12ff2d31e12b298a938539f300dcb0663600..d3237f61246cdfc161d79b8155ccfe995f96b9f5 100644 (file)
@@ -10067,7 +10067,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *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;
@@ -11808,6 +11808,10 @@ static bool should_reset_plane(struct drm_atomic_state *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.