drm/amd/display: mark plane as needing reset if color props change
authorJoshua Ashton <joshua@froggi.es>
Thu, 16 Nov 2023 19:57:57 +0000 (18:57 -0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 13 Dec 2023 21:08:01 +0000 (16:08 -0500)
We should reset a plane state if at least one of the color management
properties differs from old and new state.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Co-developed-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 22c46be291d1e501d9cc0fe23e39b2dac163c8a1..0af5d908e169021b71b25ce23adc78801632758a 100644 (file)
@@ -9929,6 +9929,10 @@ static bool should_reset_plane(struct drm_atomic_state *state,
         */
        for_each_oldnew_plane_in_state(state, other, old_other_state, new_other_state, i) {
                struct amdgpu_framebuffer *old_afb, *new_afb;
+               struct dm_plane_state *dm_new_other_state, *dm_old_other_state;
+
+               dm_new_other_state = to_dm_plane_state(new_other_state);
+               dm_old_other_state = to_dm_plane_state(old_other_state);
 
                if (other->type == DRM_PLANE_TYPE_CURSOR)
                        continue;
@@ -9965,6 +9969,17 @@ static bool should_reset_plane(struct drm_atomic_state *state,
                    old_other_state->color_encoding != new_other_state->color_encoding)
                        return true;
 
+               /* HDR/Transfer Function changes. */
+               if (dm_old_other_state->degamma_tf != dm_new_other_state->degamma_tf ||
+                   dm_old_other_state->degamma_lut != dm_new_other_state->degamma_lut ||
+                   dm_old_other_state->hdr_mult != dm_new_other_state->hdr_mult ||
+                   dm_old_other_state->shaper_lut != dm_new_other_state->shaper_lut ||
+                   dm_old_other_state->shaper_tf != dm_new_other_state->shaper_tf ||
+                   dm_old_other_state->lut3d != dm_new_other_state->lut3d ||
+                   dm_old_other_state->blend_lut != dm_new_other_state->blend_lut ||
+                   dm_old_other_state->blend_tf != dm_new_other_state->blend_tf)
+                       return true;
+
                /* Framebuffer checks fall at the end. */
                if (!old_other_state->fb || !new_other_state->fb)
                        continue;