[PATCH v2 10/10] wait for psr before cursor update

Ville Syrjala ville.syrjala at linux.intel.com
Mon Jan 15 18:27:18 UTC 2024


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

v2: reorder stuff
---
 drivers/gpu/drm/i915/display/intel_cursor.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c b/drivers/gpu/drm/i915/display/intel_cursor.c
index eb23ced1daab..0a3f5837af27 100644
--- a/drivers/gpu/drm/i915/display/intel_cursor.c
+++ b/drivers/gpu/drm/i915/display/intel_cursor.c
@@ -768,11 +768,22 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
 
 	intel_vblank_evade_init(crtc_state, crtc_state, &evade);
 
-	local_irq_disable();
+	intel_psr_lock(crtc_state);
 
 	if (!drm_WARN_ON(&i915->drm, drm_crtc_vblank_get(&crtc->base))) {
+		/*
+		 * TODO: maybe check if we're still in PSR and skip the vblank
+		 * evasion entirely?
+		 */
+		intel_psr_wait_for_idle_locked(crtc_state);
+
+		local_irq_disable();
+
 		intel_vblank_evade(&evade);
+
 		drm_crtc_vblank_put(&crtc->base);
+	} else {
+		local_irq_disable();
 	}
 
 	if (new_plane_state->uapi.visible) {
@@ -784,6 +795,8 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
 
 	local_irq_enable();
 
+	intel_psr_unlock(crtc_state);
+
 	intel_plane_unpin_fb(old_plane_state);
 
 out_free:
-- 
2.41.0



More information about the Intel-gfx-trybot mailing list