Skip to content

Commit de0780d

Browse files
Michel Dänzergregkh
authored andcommitted
drm/amd/display: Add primary plane to commits for correct VRR handling
commit 3477c1b upstream. amdgpu_dm_commit_planes calls update_freesync_state_on_stream only for the primary plane. If a commit affects a CRTC but not its primary plane, it would previously not trigger a refresh cycle or affect LFC, violating current UAPI semantics. Fixes e.g. atomic commits affecting only the cursor plane being limited to the minimum refresh rate. Don't do this for the legacy cursor ioctls though, it would break the UAPI semantics for those. Suggested-by: Xaver Hugl <xaver.hugl@kde.org> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3034 Signed-off-by: Michel Dänzer <mdaenzer@redhat.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit cc7bfba) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 96609a5 commit de0780d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,15 @@ static int amdgpu_dm_crtc_helper_atomic_check(struct drm_crtc *crtc,
664664
return -EINVAL;
665665
}
666666

667+
if (!state->legacy_cursor_update && amdgpu_dm_crtc_vrr_active(dm_crtc_state)) {
668+
struct drm_plane_state *primary_state;
669+
670+
/* Pull in primary plane for correct VRR handling */
671+
primary_state = drm_atomic_get_plane_state(state, crtc->primary);
672+
if (IS_ERR(primary_state))
673+
return PTR_ERR(primary_state);
674+
}
675+
667676
/* In some use cases, like reset, no stream is attached */
668677
if (!dm_crtc_state->stream)
669678
return 0;

0 commit comments

Comments
 (0)