[PATCH 2/2] drm/xe/uapi: Expose wmtp as engine capability
Nirmoy Das
nirmoy.das at intel.com
Tue Jul 16 09:18:05 UTC 2024
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)
Reviewed-by: Matt Roper <matthew.d.roper at intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
---
drivers/gpu/drm/xe/xe_query.c | 5 +++++
include/uapi/drm/xe_drm.h | 12 ++++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index 4e01df6b1b7a..a5eef4017149 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -213,6 +213,11 @@ 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 ||
+ 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 19619d4952a8..d2b0936a50fc 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
More information about the Intel-gfx-trybot
mailing list