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: matthew.d.roper@intel.com, joonas.lahtinen@linux.intel.com,
	Nirmoy Das <nirmoy.das@intel.com>
Subject: [RFC PATCH 2/2] drm/xe/uapi: Expose wmtp as engine capability
Date: Sat,  3 Feb 2024 07:05:34 +0100	[thread overview]
Message-ID: <20240203060534.6839-2-nirmoy.das@intel.com> (raw)
In-Reply-To: <20240203060534.6839-1-nirmoy.das@intel.com>

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

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

Take a field from the reserved for that purpose.

Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/xe/xe_query.c | 5 +++++
 include/uapi/drm/xe_drm.h     | 6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index 7e924faeeea0..10981b46c56f 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -215,6 +215,11 @@ static int query_engines(struct xe_device *xe,
 			engines->engines[i].instance.pad = 0;
 			memset(engines->engines[i].reserved, 0,
 			       sizeof(engines->engines[i].reserved));
+			if (gt->info.has_wmtp &&
+			    (hwe->class == XE_ENGINE_CLASS_COMPUTE ||
+			     hwe->class == XE_ENGINE_CLASS_RENDER))
+				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 50bbea0992d9..5dac079e64de 100644
--- a/include/uapi/drm/xe_drm.h
+++ b/include/uapi/drm/xe_drm.h
@@ -247,9 +247,11 @@ struct drm_xe_engine_class_instance {
 struct drm_xe_engine {
 	/** @instance: The @drm_xe_engine_class_instance */
 	struct drm_xe_engine_class_instance instance;
-
+#define DRM_XE_ENGINE_CAPABILITY_WMTP		BIT(0)
+	/** @capabilities: Capabilities of this engine. */
+	__u64 capabilities;
 	/** @reserved: Reserved */
-	__u64 reserved[3];
+	__u64 reserved[2];
 };
 
 /**
-- 
2.42.0


  reply	other threads:[~2024-02-03  6:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-03  6:05 [RFC PATCH 1/2] drm/xe: Add has_wmpt GT info Nirmoy Das
2024-02-03  6:05 ` Nirmoy Das [this message]
2024-02-16 19:52   ` [RFC PATCH 2/2] drm/xe/uapi: Expose wmtp as engine capability 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

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=20240203060534.6839-2-nirmoy.das@intel.com \
    --to=nirmoy.das@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.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