On 2023-12-07 13:25, Xaver Hugl wrote:
With VRR, every atomic commit affecting a given display must trigger
a new scanout cycle, so that userspace is able to control the refresh
rate of the display. Before this commit, this was not the case for
atomic commits that only contain cursor plane properties.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3034
Cc: sta...@vger.kernel.org

Signed-off-by: Xaver Hugl <xaver.h...@gmail.com>

Reviewed-by: Harry Wentland <harry.wentl...@amd.com>

Harry

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)

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 b452796fc6d3..b379c859fbef 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -8149,9 +8149,15 @@ static void amdgpu_dm_commit_planes(struct 
drm_atomic_state *state,
                /* Cursor plane is handled after stream updates */
                if (plane->type == DRM_PLANE_TYPE_CURSOR) {
                        if ((fb && crtc == pcrtc) ||
-                           (old_plane_state->fb && old_plane_state->crtc == 
pcrtc))
+                           (old_plane_state->fb && old_plane_state->crtc == 
pcrtc)) {
                                cursor_update = true;
-
+                               /*
+                                * With atomic modesetting, cursor changes must
+                                * also trigger a new refresh period with vrr
+                                */
+                               if (!state->legacy_cursor_update)
+                                       pflip_present = true;
+                       }
                        continue;
                }

Reply via email to