mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/xe: drm/xe: Improve real-time performance by limiting stolen memory usage
@ 2026-11-04  3:27 Junxiao Chang
  2026-11-04  3:27 ` [PATCH 1/2] drm/xe/display: Skip initial plane allocation from stolen memory on RT Junxiao Chang
  2026-11-04  3:27 ` [PATCH 2/2] drm/xe/gsc: warn about GSC stolen memory usage on RT kernels Junxiao Chang
  0 siblings, 2 replies; 3+ messages in thread
From: Junxiao Chang @ 2026-11-04  3:27 UTC (permalink / raw)
  To: jani.nikula, rodrigo.vivi, matthew.brost, thomas.hellstrom,
	airlied, simona, bigeasy, clrkwllms, rostedt, intel-gfx,
	intel-xe, dri-devel, linux-kernel, linux-rt-devel
  Cc: dev, junxiao.chang

Stolen memory access and allocation overhead can introduce latency spikes
and jitter, which negatively impacts real-time performance on PREEMPT_RT
kernels.

To improve real-time determinism, this series minimizes stolen memory usage
when running on an RT-enabled kernel:
1. It bypasses initial plane allocation from stolen memory to avoid hardware
   access latency, falling back to standard allocations.
2. It warns the user if the GSC microcontroller is active (which relies on
   stolen memory) and provides instructions on how to disable it.

Junxiao Chang (2):
  drm/xe/display: Skip initial plane allocation from stolen memory on RT
  drm/xe/gsc: warn about GSC stolen memory usage on RT kernels

 drivers/gpu/drm/xe/display/xe_initial_plane.c | 6 ++++++
 drivers/gpu/drm/xe/xe_gsc.c                   | 5 +++++
 2 files changed, 11 insertions(+)

-- 
2.43.0


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

* [PATCH 1/2] drm/xe/display: Skip initial plane allocation from stolen memory on RT
  2026-11-04  3:27 [PATCH 0/2] drm/xe: drm/xe: Improve real-time performance by limiting stolen memory usage Junxiao Chang
@ 2026-11-04  3:27 ` Junxiao Chang
  2026-11-04  3:27 ` [PATCH 2/2] drm/xe/gsc: warn about GSC stolen memory usage on RT kernels Junxiao Chang
  1 sibling, 0 replies; 3+ messages in thread
From: Junxiao Chang @ 2026-11-04  3:27 UTC (permalink / raw)
  To: jani.nikula, rodrigo.vivi, matthew.brost, thomas.hellstrom,
	airlied, simona, bigeasy, clrkwllms, rostedt, intel-gfx,
	intel-xe, dri-devel, linux-kernel, linux-rt-devel
  Cc: dev, junxiao.chang

CPU access to stolen memory ranges can introduce latency spikes that
compromise real-time (RT) guarantees on PREEMPT_RT kernels.

On PREEMPT_RT configurations, bypass retrieving the initial plane's
framebuffer from stolen memory. This forces the driver to fall back to
standard allocations, preventing RT latency degradation at the expense
of seamless boot display takeover.

Signed-off-by: Junxiao Chang <junxiao.chang@intel.com>
---
 drivers/gpu/drm/xe/display/xe_initial_plane.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/xe/display/xe_initial_plane.c b/drivers/gpu/drm/xe/display/xe_initial_plane.c
index 0f86b73036d03..fd0e2962412dd 100644
--- a/drivers/gpu/drm/xe/display/xe_initial_plane.c
+++ b/drivers/gpu/drm/xe/display/xe_initial_plane.c
@@ -87,6 +87,12 @@ initial_plane_bo(struct xe_device *xe,
 		struct ttm_resource_manager *stolen;
 		u64 pte;
 
+		if (IS_ENABLED(CONFIG_PREEMPT_RT)) {
+			drm_dbg_kms(&xe->drm,
+				    "Skipping FB allocation from stolen mem due to PREEMPT_RT\n");
+			return NULL;
+		}
+
 		stolen = ttm_manager_type(&xe->ttm, XE_PL_STOLEN);
 		if (!stolen) {
 			drm_dbg_kms(&xe->drm, "No stolen for initial FB\n");
-- 
2.43.0


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

* [PATCH 2/2] drm/xe/gsc: warn about GSC stolen memory usage on RT kernels
  2026-11-04  3:27 [PATCH 0/2] drm/xe: drm/xe: Improve real-time performance by limiting stolen memory usage Junxiao Chang
  2026-11-04  3:27 ` [PATCH 1/2] drm/xe/display: Skip initial plane allocation from stolen memory on RT Junxiao Chang
@ 2026-11-04  3:27 ` Junxiao Chang
  1 sibling, 0 replies; 3+ messages in thread
From: Junxiao Chang @ 2026-11-04  3:27 UTC (permalink / raw)
  To: jani.nikula, rodrigo.vivi, matthew.brost, thomas.hellstrom,
	airlied, simona, bigeasy, clrkwllms, rostedt, intel-gfx,
	intel-xe, dri-devel, linux-kernel, linux-rt-devel
  Cc: dev, junxiao.chang

The GSC microcontroller requires stolen memory, which can introduce
latency spikes and negatively impact real-time performance.

Print a warning on CONFIG_PREEMPT_RT kernels to inform the user that GSC
is active and that RT performance can be improved by disabling the GSC
firmware (e.g., by setting the module parameter xe.gsc_firmware_path="").

Signed-off-by: Junxiao Chang <junxiao.chang@intel.com>
---
 drivers/gpu/drm/xe/xe_gsc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_gsc.c b/drivers/gpu/drm/xe/xe_gsc.c
index aab59dc647fbd..3d06ab6fecbe0 100644
--- a/drivers/gpu/drm/xe/xe_gsc.c
+++ b/drivers/gpu/drm/xe/xe_gsc.c
@@ -427,6 +427,11 @@ int xe_gsc_init(struct xe_gsc *gsc)
 	else if (ret)
 		goto out;
 
+	if (IS_ENABLED(CONFIG_PREEMPT_RT)) {
+		xe_gt_warn(gt, "RT performance might be impacted by GSC stolen memory usage\n");
+		xe_gt_warn(gt, "Consider disabling GSC (xe.gsc_firmware_path=\"\") to improve it\n");
+	}
+
 	ret = xe_gsc_proxy_init(gsc);
 	if (ret && ret != -ENODEV)
 		goto out;
-- 
2.43.0


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

end of thread, other threads:[~2026-11-03  3:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04  3:27 [PATCH 0/2] drm/xe: drm/xe: Improve real-time performance by limiting stolen memory usage Junxiao Chang
2026-11-04  3:27 ` [PATCH 1/2] drm/xe/display: Skip initial plane allocation from stolen memory on RT Junxiao Chang
2026-11-04  3:27 ` [PATCH 2/2] drm/xe/gsc: warn about GSC stolen memory usage on RT kernels Junxiao Chang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®