Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/i915/guc: Enable PXP GuC autoteardown flow
@ 2024-09-06 17:40 John.C.Harrison
  2024-09-06 17:52 ` Teres Alexis, Alan Previn
                   ` (10 more replies)
  0 siblings, 11 replies; 15+ messages in thread
From: John.C.Harrison @ 2024-09-06 17:40 UTC (permalink / raw)
  To: Intel-GFX; +Cc: DRI-Devel, Juston Li, John Harrison

From: Juston Li <juston.li@intel.com>

This feature flag enables GuC autoteardown which allows for a grace
period before session teardown.

Also add a HAS_PXP() helper to share with the other place that wants
to check.

Signed-off-by: Juston Li <juston.li@intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_guc.c      | 8 ++++++++
 drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h | 1 +
 drivers/gpu/drm/i915/i915_drv.h             | 3 +++
 drivers/gpu/drm/i915/pxp/intel_pxp.c        | 2 +-
 4 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
index 097fc6bd1285e..5949ff0b0161f 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
@@ -239,8 +239,16 @@ static u32 guc_ctl_debug_flags(struct intel_guc *guc)
 
 static u32 guc_ctl_feature_flags(struct intel_guc *guc)
 {
+	struct intel_gt *gt = guc_to_gt(guc);
 	u32 flags = 0;
 
+	/*
+	 * Enable PXP GuC autoteardown flow.
+	 * NB: MTL does things differently.
+	 */
+	if (HAS_PXP(gt->i915) && !IS_METEORLAKE(gt->i915))
+		flags |= GUC_CTL_ENABLE_GUC_PXP_CTL;
+
 	if (!intel_guc_submission_is_used(guc))
 		flags |= GUC_CTL_DISABLE_SCHEDULER;
 
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h
index 263c9c3f6a034..4ce6e2332a63f 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h
@@ -105,6 +105,7 @@
 #define   GUC_WA_ENABLE_TSC_CHECK_ON_RC6	BIT(22)
 
 #define GUC_CTL_FEATURE			2
+#define   GUC_CTL_ENABLE_GUC_PXP_CTL	BIT(1)
 #define   GUC_CTL_ENABLE_SLPC		BIT(2)
 #define   GUC_CTL_DISABLE_SCHEDULER	BIT(14)
 
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 39f6614a0a99a..faeba9732422f 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -693,6 +693,9 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
 
 #define HAS_RPS(i915)	(INTEL_INFO(i915)->has_rps)
 
+#define HAS_PXP(i915) \
+	(IS_ENABLED(CONFIG_DRM_I915_PXP) && INTEL_INFO(i915)->has_pxp)
+
 #define HAS_HECI_PXP(i915) \
 	(INTEL_INFO(i915)->has_heci_pxp)
 
diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.c b/drivers/gpu/drm/i915/pxp/intel_pxp.c
index 75278e78ca90e..5e0bf776aac0f 100644
--- a/drivers/gpu/drm/i915/pxp/intel_pxp.c
+++ b/drivers/gpu/drm/i915/pxp/intel_pxp.c
@@ -170,7 +170,7 @@ static struct intel_gt *find_gt_for_required_teelink(struct drm_i915_private *i9
 
 static struct intel_gt *find_gt_for_required_protected_content(struct drm_i915_private *i915)
 {
-	if (!IS_ENABLED(CONFIG_DRM_I915_PXP) || !INTEL_INFO(i915)->has_pxp)
+	if (!HAS_PXP(i915))
 		return NULL;
 
 	/*
-- 
2.46.0


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

end of thread, other threads:[~2024-10-14 19:55 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-06 17:40 [PATCH v2] drm/i915/guc: Enable PXP GuC autoteardown flow John.C.Harrison
2024-09-06 17:52 ` Teres Alexis, Alan Previn
2024-09-06 18:34 ` ✗ Fi.CI.SPARSE: warning for " Patchwork
2024-09-06 19:02 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-09-18 19:32 ` ✗ Fi.CI.BAT: failure for drm/i915/guc: Enable PXP GuC autoteardown flow (rev2) Patchwork
2024-10-14 19:51   ` John Harrison
2024-09-26 19:47 ` ✗ Fi.CI.SPARSE: warning for drm/i915/guc: Enable PXP GuC autoteardown flow (rev3) Patchwork
2024-09-26 20:04 ` ✓ Fi.CI.BAT: success " Patchwork
2024-09-27  1:54 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-10-14 19:52   ` John Harrison
2024-09-28  0:40 ` Patchwork
2024-10-11 21:08 ` ✗ Fi.CI.SPARSE: warning for drm/i915/guc: Enable PXP GuC autoteardown flow (rev4) Patchwork
2024-10-11 21:54 ` ✓ Fi.CI.BAT: success " Patchwork
2024-10-12 15:34 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-10-14 19:55   ` John Harrison

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