From: Maarten Lankhorst <dev@lankhorst.se>
To: intel-xe@lists.freedesktop.org
Subject: [FOR CI 4/5] drm/i915/display: Disable interrupts on xe for realtime preemption
Date: Fri, 17 Oct 2025 17:37:47 +0200 [thread overview]
Message-ID: <20251017153748.26059-5-dev@lankhorst.se> (raw)
In-Reply-To: <20251017153748.26059-1-dev@lankhorst.se>
Check if it works at all, and then see what the timing results are.
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
---
drivers/gpu/drm/i915/display/intel_crtc.c | 12 +++++++-----
drivers/gpu/drm/i915/display/intel_vblank.c | 4 ++--
drivers/gpu/drm/i915/display/intel_vblank.h | 9 +++++++++
3 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
index f34745b5ea497..39a4ff902e6ce 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc.c
@@ -567,7 +567,7 @@ void intel_pipe_update_start(struct intel_atomic_state *state,
*/
intel_psr_wait_for_idle_locked(new_crtc_state);
- if (!IS_ENABLED(CONFIG_PREEMPT_RT))
+ if (intel_disable_vblank_irqs())
local_irq_disable();
crtc->debug.min_vbl = evade.min;
@@ -586,7 +586,7 @@ void intel_pipe_update_start(struct intel_atomic_state *state,
return;
irq_disable:
- if (!IS_ENABLED(CONFIG_PREEMPT_RT))
+ if (intel_disable_vblank_irqs())
local_irq_disable();
}
@@ -686,6 +686,10 @@ void intel_pipe_update_end(struct intel_atomic_state *state,
intel_crtc_has_type(new_crtc_state, INTEL_OUTPUT_DSI))
icl_dsi_frame_update(new_crtc_state);
+ preempt_disable();
+ if (intel_disable_vblank_irqs())
+ local_irq_enable();
+
/* We're still in the vblank-evade critical section, this can't race.
* Would be slightly nice to just grab the vblank count and arm the
* event outside of the critical section - the spinlock might spin for a
@@ -733,9 +737,7 @@ void intel_pipe_update_end(struct intel_atomic_state *state,
if (!state->base.legacy_cursor_update)
intel_vrr_send_push(NULL, new_crtc_state);
- if (!IS_ENABLED(CONFIG_PREEMPT_RT))
- local_irq_enable();
-
+ preempt_enable();
if (intel_vgpu_active(dev_priv))
goto out;
diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c b/drivers/gpu/drm/i915/display/intel_vblank.c
index 7826f29619a14..09be26f6a3df8 100644
--- a/drivers/gpu/drm/i915/display/intel_vblank.c
+++ b/drivers/gpu/drm/i915/display/intel_vblank.c
@@ -761,12 +761,12 @@ int intel_vblank_evade(struct intel_vblank_evade_ctx *evade)
break;
}
- if (!IS_ENABLED(CONFIG_PREEMPT_RT))
+ if (intel_disable_vblank_irqs())
local_irq_enable();
timeout = schedule_timeout(timeout);
- if (!IS_ENABLED(CONFIG_PREEMPT_RT))
+ if (intel_disable_vblank_irqs())
local_irq_disable();
}
diff --git a/drivers/gpu/drm/i915/display/intel_vblank.h b/drivers/gpu/drm/i915/display/intel_vblank.h
index 98d04cacd65f8..7207dcf7e1c5e 100644
--- a/drivers/gpu/drm/i915/display/intel_vblank.h
+++ b/drivers/gpu/drm/i915/display/intel_vblank.h
@@ -50,4 +50,13 @@ intel_pre_commit_crtc_state(struct intel_atomic_state *state,
int intel_crtc_vblank_length(const struct intel_crtc_state *crtc_state);
+static inline int intel_disable_vblank_irqs(void)
+{
+#if !defined(I915) && !IS_ENABLED(CONFIG_PREEMPT_RT)
+ return true;
+#else
+ return false;
+#endif
+}
+
#endif /* __INTEL_VBLANK_H__ */
--
2.51.0
next prev parent reply other threads:[~2025-10-17 15:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-17 15:37 [FOR CI 0/5] Testing PREEMPT_RT with disabling interrupts in the most critical section Maarten Lankhorst
2025-10-17 15:37 ` [FOR CI 1/5] drm/xe: Bump xe_device_l2_flush even higher Maarten Lankhorst
2025-10-17 15:37 ` [FOR CI 2/5] drm/i915: Use preempt_disable/enable_rt() where recommended Maarten Lankhorst
2025-10-17 15:37 ` [FOR CI 3/5] drm/i915: Don't disable interrupts on PREEMPT_RT during atomic updates Maarten Lankhorst
2025-10-17 15:37 ` Maarten Lankhorst [this message]
2025-10-17 15:37 ` [FOR CI 5/5] [FOR-CI] PREEMPT_RT injection Maarten Lankhorst
2025-10-17 16:37 ` ✗ CI.checkpatch: warning for Testing PREEMPT_RT with disabling interrupts in the most critical section Patchwork
2025-10-17 16:37 ` ✗ CI.KUnit: failure " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2025-10-17 11:57 [FOR CI 0/5] Test PREEMPT_RT with irqs disabled Maarten Lankhorst
2025-10-17 11:57 ` [FOR CI 4/5] drm/i915/display: Disable interrupts on xe for realtime preemption Maarten Lankhorst
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251017153748.26059-5-dev@lankhorst.se \
--to=dev@lankhorst.se \
--cc=intel-xe@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox