Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy Das <nirmoy.das@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Nirmoy Das <nirmoy.das@intel.com>,
	Francois Dugast <francois.dugast@intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Lionel Landwerlin <lionel.g.landwerlin@intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Mateusz Jablonski <mateusz.jablonski@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>
Subject: [PATCH 2/2] drm/xe/uapi: Expose wmtp as engine capability
Date: Fri,  9 Aug 2024 12:47:36 +0200	[thread overview]
Message-ID: <20240809104736.10423-3-nirmoy.das@intel.com> (raw)
In-Reply-To: <20240809104736.10423-1-nirmoy.das@intel.com>

Add capabilities to engine struct which can be used to
expose various capabilities of each engine.

Add wmtp as engine capability which is retrieve from
GT info.

Take a field from the reserved for that purpose.

v2: Use 32 bit for capabilities(Lucas).
    Only Expose Compute engine till there is user-case
    for Render engine(Joonas).
    Don't use BIT() for uAPI (Francois)

Cc: Francois Dugast <francois.dugast@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Mateusz Jablonski <mateusz.jablonski@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/xe/xe_query.c |  4 ++++
 include/uapi/drm/xe_drm.h     | 12 ++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index 73ef6e4c2dc9..005f4f2da3d9 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -213,6 +213,10 @@ static int query_engines(struct xe_device *xe,
 			engines->engines[i].instance.engine_instance =
 				hwe->logical_instance;
 			engines->engines[i].instance.gt_id = gt->info.id;
+			if (gt->info.has_wmtp &&
+			    hwe->class == XE_ENGINE_CLASS_COMPUTE)
+				engines->engines[i].capabilities |=
+					DRM_XE_ENGINE_CAPABILITY_WMTP;
 
 			i++;
 		}
diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
index b6fbe4988f2e..975666b6fe28 100644
--- a/include/uapi/drm/xe_drm.h
+++ b/include/uapi/drm/xe_drm.h
@@ -247,13 +247,21 @@ struct drm_xe_engine_class_instance {
 
 /**
  * struct drm_xe_engine - describe hardware engine
+ *
+ * The @capabilities can be:
+ *  - DRM_XE_ENGINE_CAPABILITY_WMTP - represents a engine's mid-thread
+ *  preemption capability.
  */
 struct drm_xe_engine {
 	/** @instance: The @drm_xe_engine_class_instance */
 	struct drm_xe_engine_class_instance instance;
-
+#define DRM_XE_ENGINE_CAPABILITY_WMTP		1
+	/** @capabilities: Capabilities of this engine. */
+	__u32 capabilities;
+	/** @pad: MBZ */
+	__u32 pad;
 	/** @reserved: Reserved */
-	__u64 reserved[3];
+	__u64 reserved[2];
 };
 
 /**
-- 
2.42.0


  parent reply	other threads:[~2024-08-09 11:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-09 10:47 [PATCH 0/2] Expose wmtp status as engine capability Nirmoy Das
2024-08-09 10:47 ` [PATCH 1/2] drm/xe: Add has_wmtp GT info Nirmoy Das
2024-08-09 11:55   ` Nirmoy Das
2024-08-09 10:47 ` Nirmoy Das [this message]
2024-08-14 10:37   ` [PATCH 2/2] drm/xe/uapi: Expose wmtp as engine capability Jablonski, Mateusz
2024-08-09 11:08 ` ✓ CI.Patch_applied: success for Expose wmtp status " Patchwork
2024-08-09 11:09 ` ✓ CI.checkpatch: " Patchwork
2024-08-09 11:10 ` ✓ CI.KUnit: " Patchwork
2024-08-09 11:22 ` ✓ CI.Build: " Patchwork
2024-08-09 11:24 ` ✗ CI.Hooks: failure " Patchwork
2024-08-09 11:25 ` ✓ CI.checksparse: success " Patchwork
2024-08-09 11:52 ` ✗ CI.BAT: failure " Patchwork
2024-08-09 13:31 ` ✗ CI.FULL: " Patchwork

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=20240809104736.10423-3-nirmoy.das@intel.com \
    --to=nirmoy.das@intel.com \
    --cc=francois.dugast@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=lionel.g.landwerlin@intel.com \
    --cc=lucas.demarchi@intel.com \
    --cc=mateusz.jablonski@intel.com \
    --cc=matthew.d.roper@intel.com \
    /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