[Intel-xe] [RFC PATCH 1/1] drm/xe/uapi: Add query engines uAPI
Matthew Brost
matthew.brost at intel.com
Wed Mar 22 02:29:35 UTC 2023
Not all hardware engines are created equally, certain instance have
unique capabilities or properties. Introduce a uAPI to query for both
capabilities and properties. The capabilities are represented by a bit
mask which is unique to each class. The properties are represented by a
name and value return in an array to the user.
Signed-off-by: Matthew Brost <matthew.brost at intel.com>
---
include/uapi/drm/xe_drm.h | 41 +++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
index 661d7929210c..b0f2823a3ddb 100644
--- a/include/uapi/drm/xe_drm.h
+++ b/include/uapi/drm/xe_drm.h
@@ -119,6 +119,7 @@ struct xe_user_extension {
#define DRM_XE_WAIT_USER_FENCE 0x0b
#define DRM_XE_VM_MADVISE 0x0c
#define DRM_XE_ENGINE_GET_PROPERTY 0x0d
+#define DRM_XE_ENGINE_QUERY 0x0f
/* Must be kept compact -- no holes */
#define DRM_IOCTL_XE_DEVICE_QUERY DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_DEVICE_QUERY, struct drm_xe_device_query)
@@ -135,6 +136,7 @@ struct xe_user_extension {
#define DRM_IOCTL_XE_ENGINE_SET_PROPERTY DRM_IOW( DRM_COMMAND_BASE + DRM_XE_ENGINE_SET_PROPERTY, struct drm_xe_engine_set_property)
#define DRM_IOCTL_XE_WAIT_USER_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_WAIT_USER_FENCE, struct drm_xe_wait_user_fence)
#define DRM_IOCTL_XE_VM_MADVISE DRM_IOW( DRM_COMMAND_BASE + DRM_XE_VM_MADVISE, struct drm_xe_vm_madvise)
+#define DRM_IOCTL_XE_ENGINE_QUERY DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_ENGINE_QUERY, struct drm_xe_engine_query)
struct drm_xe_engine_class_instance {
__u16 engine_class;
@@ -253,6 +255,45 @@ struct drm_xe_device_query {
__u64 reserved[2];
};
+struct drm_xe_engine_query_property {
+ /** @property: pointer to the first property struct, if any */
+ __u64 property;
+
+ /** @name: name of the property */
+ __u64 name;
+
+ /** @value: value property */
+ __u64 value;
+
+ /** @reserved: reserved */
+ __u64 reserved[2];
+};
+
+struct drm_xe_engine_query_result {
+ /** @property: pointer to the first property struct, if any */
+ __u64 property;
+
+ /** @capabilities: bit mask of capabilities, specific to each class */
+ __u64 capabilities;
+
+ /** @reserved: reserved */
+ __u64 reserved[2];
+};
+
+struct drm_xe_engine_query {
+ /** @extensions: pointer to the first extension struct, if any */
+ __u64 extensions;
+
+ /** @eci: engine class instance to query */
+ struct drm_xe_engine_class_instance eci;
+
+ /** @result: return data from query */
+ struct drm_xe_engine_query_result result;
+
+ /** @reserved: reserved */
+ __u64 reserved[2];
+};
+
struct drm_xe_gem_create {
/** @extensions: Pointer to the first extension struct, if any */
__u64 extensions;
--
2.34.1
More information about the Intel-xe
mailing list