intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915/display: Make intel_crtc_get_vblank_counter safe on PREEMPT_RT
@ 2025-08-29 13:17 Maarten Lankhorst
  2025-08-29 14:01 ` ✓ CI.KUnit: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Maarten Lankhorst @ 2025-08-29 13:17 UTC (permalink / raw)
  To: intel-gfx, intel-xe; +Cc: Maarten Lankhorst

drm_crtc_accurate_vblank_count takes a spinlock, which we should avoid
in tracepoints and debug functions.

This also prevents taking the spinlock 2x during the critical
section of pipe updates for DSI updates.

Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
---
 drivers/gpu/drm/i915/display/intel_crtc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
index a187db6df2d36..cee00aa2c79de 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc.c
@@ -84,8 +84,12 @@ u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc)
 	if (!crtc->active)
 		return 0;
 
-	if (!vblank->max_vblank_count)
-		return (u32)drm_crtc_accurate_vblank_count(&crtc->base);
+	if (!vblank->max_vblank_count) {
+		if (!IS_ENABLED(CONFIG_PREEMPT_RT))
+			return (u32)drm_crtc_accurate_vblank_count(&crtc->base);
+		else
+			return (u32)drm_crtc_vblank_count(&crtc->base);
+	}
 
 	return crtc->base.funcs->get_vblank_counter(&crtc->base);
 }
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-09-10 16:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-29 13:17 [PATCH] drm/i915/display: Make intel_crtc_get_vblank_counter safe on PREEMPT_RT Maarten Lankhorst
2025-08-29 14:01 ` ✓ CI.KUnit: success for " Patchwork
2025-08-29 14:45 ` ✓ Xe.CI.BAT: " Patchwork
2025-08-30  0:58 ` ✗ Xe.CI.Full: failure " Patchwork
2025-09-10 16:03 ` [PATCH] " Ville Syrjälä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).