Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 1/2] drm/xe: Add has_wmpt GT info
@ 2024-02-03  6:05 Nirmoy Das
  2024-02-03  6:05 ` [RFC PATCH 2/2] drm/xe/uapi: Expose wmtp as engine capability Nirmoy Das
                   ` (8 more replies)
  0 siblings, 9 replies; 16+ messages in thread
From: Nirmoy Das @ 2024-02-03  6:05 UTC (permalink / raw)
  To: intel-xe; +Cc: matthew.d.roper, joonas.lahtinen, Nirmoy Das

Add a GT info member to reflect wmtp feature status.

Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/xe/xe_gt_types.h  |  2 ++
 drivers/gpu/drm/xe/xe_hw_engine.c | 15 +++++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_gt_types.h b/drivers/gpu/drm/xe/xe_gt_types.h
index 70c615dd1498..2f2fa00c1a04 100644
--- a/drivers/gpu/drm/xe/xe_gt_types.h
+++ b/drivers/gpu/drm/xe/xe_gt_types.h
@@ -119,6 +119,8 @@ struct xe_gt {
 		u64 __engine_mask;
 		/** @info.gmdid: raw GMD_ID value from hardware */
 		u32 gmdid;
+		/** @has_wmtp: gt supports mid-thread preemption */
+		bool has_wmtp;
 	} info;
 
 	/**
diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c
index 0d17e32d70c8..82424e5d6033 100644
--- a/drivers/gpu/drm/xe/xe_hw_engine.c
+++ b/drivers/gpu/drm/xe/xe_hw_engine.c
@@ -319,14 +319,11 @@ static bool xe_hw_engine_match_fixed_cslice_mode(const struct xe_gt *gt,
 static bool xe_rtp_cfeg_wmtp_disabled(const struct xe_gt *gt,
 				      const struct xe_hw_engine *hwe)
 {
-	if (GRAPHICS_VER(gt_to_xe(gt)) < 20)
-		return false;
-
 	if (hwe->class != XE_ENGINE_CLASS_COMPUTE &&
 	    hwe->class != XE_ENGINE_CLASS_RENDER)
 		return false;
 
-	return xe_mmio_read32(hwe->gt, XEHP_FUSE4) & CFEG_WMTP_DISABLE;
+	return !gt->info.has_wmtp;
 }
 
 void
@@ -671,6 +668,15 @@ static void read_compute_fuses(struct xe_gt *gt)
 		read_compute_fuses_from_dss(gt);
 }
 
+static void read_wmpt_fuses(struct xe_gt *gt)
+{
+	if (GRAPHICS_VER(gt_to_xe(gt)) < 20)
+		return;
+
+	gt->info.has_wmtp = !(xe_mmio_read32(gt, XEHP_FUSE4) &
+			    CFEG_WMTP_DISABLE);
+}
+
 static void check_gsc_availability(struct xe_gt *gt)
 {
 	struct xe_device *xe = gt_to_xe(gt);
@@ -696,6 +702,7 @@ int xe_hw_engines_init_early(struct xe_gt *gt)
 	read_media_fuses(gt);
 	read_copy_fuses(gt);
 	read_compute_fuses(gt);
+	read_wmpt_fuses(gt);
 	check_gsc_availability(gt);
 
 	BUILD_BUG_ON(XE_HW_ENGINE_PREEMPT_TIMEOUT < XE_HW_ENGINE_PREEMPT_TIMEOUT_MIN);
-- 
2.42.0


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

end of thread, other threads:[~2024-07-15  8:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-03  6:05 [RFC PATCH 1/2] drm/xe: Add has_wmpt GT info Nirmoy Das
2024-02-03  6:05 ` [RFC PATCH 2/2] drm/xe/uapi: Expose wmtp as engine capability Nirmoy Das
2024-02-16 19:52   ` Matt Roper
2024-02-19 10:09     ` Nirmoy Das
2024-07-12 16:10       ` Francois Dugast
2024-07-15  8:21         ` Nirmoy Das
2024-07-13 13:55   ` Lucas De Marchi
2024-07-15  8:29     ` Nirmoy Das
2024-02-03  6:22 ` ✓ CI.Patch_applied: success for series starting with [RFC,1/2] drm/xe: Add has_wmpt GT info Patchwork
2024-02-03  6:22 ` ✓ CI.checkpatch: " Patchwork
2024-02-03  6:23 ` ✓ CI.KUnit: " Patchwork
2024-02-03  6:30 ` ✓ CI.Build: " Patchwork
2024-02-03  6:31 ` ✗ CI.Hooks: failure " Patchwork
2024-02-03  6:32 ` ✓ CI.checksparse: success " Patchwork
2024-02-03  6:56 ` ✗ CI.BAT: failure " Patchwork
2024-02-16 18:47 ` [RFC PATCH 1/2] " Matt Roper

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