All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] drm/i915: Add GETPARAM for GuC submission version
@ 2024-01-24  8:19 Joonas Lahtinen
  2024-01-24  8:43 ` ✗ Fi.CI.SPARSE: warning for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Joonas Lahtinen @ 2024-01-24  8:19 UTC (permalink / raw)
  To: Intel graphics driver community testing & development
  Cc: Paulo Zanoni, Tvrtko Ursulin, Jani Nikula, Kenneth Graunke,
	Sagar Ghuge, Rodrigo Vivi

Add reporting of the GuC submissio/VF interface version via GETPARAM
properties. Mesa intends to use this information to check for old
firmware versions with known bugs before enabling features like async
compute.

Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Jose Souza <jose.souza@intel.com>
Cc: Sagar Ghuge <sagar.ghuge@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_getparam.c | 12 ++++++++++++
 include/uapi/drm/i915_drm.h          | 13 +++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_getparam.c b/drivers/gpu/drm/i915/i915_getparam.c
index 5c3fec63cb4c1..f176372debc54 100644
--- a/drivers/gpu/drm/i915/i915_getparam.c
+++ b/drivers/gpu/drm/i915/i915_getparam.c
@@ -113,6 +113,18 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,
 		if (value < 0)
 			return value;
 		break;
+	case I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR:
+	case I915_PARAM_GUC_SUBMISSION_VERSION_MINOR:
+	case I915_PARAM_GUC_SUBMISSION_VERSION_PATCH:
+		if (!intel_uc_uses_guc_submission(&to_gt(i915)->uc))
+			return -ENODEV;
+		if (param->param == I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR)
+			value = to_gt(i915)->uc.guc.submission_version.major;
+		else if (param->param == I915_PARAM_GUC_SUBMISSION_VERSION_MINOR)
+			value = to_gt(i915)->uc.guc.submission_version.minor;
+		else
+			value = to_gt(i915)->uc.guc.submission_version.patch;
+		break;
 	case I915_PARAM_MMAP_GTT_VERSION:
 		/* Though we've started our numbering from 1, and so class all
 		 * earlier versions as 0, in effect their value is undefined as
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index fd4f9574d177a..7d5a47f182542 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -806,6 +806,19 @@ typedef struct drm_i915_irq_wait {
  */
 #define I915_PARAM_PXP_STATUS		 58
 
+/*
+ * Query for the GuC submission/VF interface version number
+ *
+ * -ENODEV is returned if GuC submission is not used
+ *
+ * On success, returns the respective GuC submission/VF interface major,
+ * minor or patch version as per the requested parameter.
+ *
+ */
+#define I915_PARAM_GUC_SUBMISSION_VERSION_MAJOR 59
+#define I915_PARAM_GUC_SUBMISSION_VERSION_MINOR 60
+#define I915_PARAM_GUC_SUBMISSION_VERSION_PATCH 61
+
 /* Must be kept compact -- no holes and well documented */
 
 /**
-- 
2.43.0


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

end of thread, other threads:[~2024-02-07 18:02 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24  8:19 [RFC PATCH] drm/i915: Add GETPARAM for GuC submission version Joonas Lahtinen
2024-01-24  8:43 ` ✗ Fi.CI.SPARSE: warning for " Patchwork
2024-01-24  8:49 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-01-24  8:55 ` [RFC PATCH] " Tvrtko Ursulin
2024-01-24 19:55   ` John Harrison
2024-01-24 22:42   ` Kenneth Graunke
2024-02-01 18:25   ` Souza, Jose
2024-02-06 16:33     ` Tvrtko Ursulin
2024-02-06 20:42       ` John Harrison
2024-02-06 20:51         ` Souza, Jose
2024-02-07  8:44           ` Tvrtko Ursulin
2024-02-07 11:36             ` Joonas Lahtinen
2024-02-07 17:58               ` John Harrison
2024-02-07 18:02               ` Souza, Jose
2024-01-24 13:35 ` Souza, Jose

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.