aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/xe/xe_query.c15
-rw-r--r--include/uapi/drm/xe_drm.h27
2 files changed, 33 insertions, 9 deletions
diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index 61a7d92b7e88..0cbfeaeb1330 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -53,7 +53,7 @@ static size_t calc_hw_engine_info_size(struct xe_device *xe)
i++;
}
- return i * sizeof(struct drm_xe_engine_class_instance);
+ return i * sizeof(struct drm_xe_query_engine_info);
}
typedef u64 (*__ktime_func_t)(void);
@@ -186,9 +186,9 @@ static int query_engines(struct xe_device *xe,
struct drm_xe_device_query *query)
{
size_t size = calc_hw_engine_info_size(xe);
- struct drm_xe_engine_class_instance __user *query_ptr =
+ struct drm_xe_query_engine_info __user *query_ptr =
u64_to_user_ptr(query->data);
- struct drm_xe_engine_class_instance *hw_engine_info;
+ struct drm_xe_query_engine_info *hw_engine_info;
struct xe_hw_engine *hwe;
enum xe_hw_engine_id id;
struct xe_gt *gt;
@@ -211,12 +211,13 @@ static int query_engines(struct xe_device *xe,
if (xe_hw_engine_is_reserved(hwe))
continue;
- hw_engine_info[i].engine_class =
+ hw_engine_info[i].instance.engine_class =
xe_to_user_engine_class[hwe->class];
- hw_engine_info[i].engine_instance =
+ hw_engine_info[i].instance.engine_instance =
hwe->logical_instance;
- hw_engine_info[i].gt_id = gt->info.id;
- hw_engine_info[i].pad = 0;
+ hw_engine_info[i].instance.gt_id = gt->info.id;
+ hw_engine_info[i].instance.pad = 0;
+ memset(hw_engine_info->reserved, 0, sizeof(hw_engine_info->reserved));
i++;
}
diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
index 6edbcd81c195..dc657ae9db18 100644
--- a/include/uapi/drm/xe_drm.h
+++ b/include/uapi/drm/xe_drm.h
@@ -124,7 +124,13 @@ struct xe_user_extension {
#define DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_EXEC_QUEUE_GET_PROPERTY, struct drm_xe_exec_queue_get_property)
#define DRM_IOCTL_XE_WAIT_USER_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_WAIT_USER_FENCE, struct drm_xe_wait_user_fence)
-/** struct drm_xe_engine_class_instance - instance of an engine class */
+/**
+ * struct drm_xe_engine_class_instance - instance of an engine class
+ *
+ * It is returned as part of the @drm_xe_query_engine_info, but it also is
+ * used as the input of engine selection for both @drm_xe_exec_queue_create
+ * and @drm_xe_query_engine_cycles
+ */
struct drm_xe_engine_class_instance {
#define DRM_XE_ENGINE_CLASS_RENDER 0
#define DRM_XE_ENGINE_CLASS_COPY 1
@@ -137,15 +143,32 @@ struct drm_xe_engine_class_instance {
*/
#define DRM_XE_ENGINE_CLASS_VM_BIND_ASYNC 5
#define DRM_XE_ENGINE_CLASS_VM_BIND_SYNC 6
+ /** @engine_class: engine class id */
__u16 engine_class;
-
+ /** @engine_instance: engine instance id */
__u16 engine_instance;
+ /** @gt_id: Unique ID of this GT within the PCI Device */
__u16 gt_id;
/** @pad: MBZ */
__u16 pad;
};
/**
+ * struct drm_xe_query_engine_info - describe hardware engine
+ *
+ * If a query is made with a struct @drm_xe_device_query where .query
+ * is equal to %DRM_XE_DEVICE_QUERY_ENGINES, then the reply uses an array of
+ * struct @drm_xe_query_engine_info in .data.
+ */
+struct drm_xe_query_engine_info {
+ /** @instance: The @drm_xe_engine_class_instance */
+ struct drm_xe_engine_class_instance instance;
+
+ /** @reserved: Reserved */
+ __u64 reserved[3];
+};
+
+/**
* enum drm_xe_memory_class - Supported memory classes.
*/
enum drm_xe_memory_class {