]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Reset planes for color management changes
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Wed, 1 May 2019 14:26:09 +0000 (10:26 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:24:35 +0000 (07:24 +0200)
[ Upstream commit 7316c4ad299663a16ca9ce13e5e817b4ca760809 ]

[Why]
For commits with allow_modeset=false and CRTC degamma changes the planes
aren't reset. This results in incorrect rendering.

[How]
Reset the planes when color management has changed on the CRTC.
Technically this will include regamma changes as well, but it doesn't
really after legacy userspace since those commit with
allow_modeset=true.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 31530bfd002ab645b71b0eb5a24913ccd9b12fa9..0e482349a5cb51c2589b85a9d7ca84013d87f45b 100644 (file)
@@ -6331,6 +6331,10 @@ static bool should_reset_plane(struct drm_atomic_state *state,
        if (!new_crtc_state)
                return true;
 
+       /* CRTC Degamma changes currently require us to recreate planes. */
+       if (new_crtc_state->color_mgmt_changed)
+               return true;
+
        if (drm_atomic_crtc_needs_modeset(new_crtc_state))
                return true;