History

drm/xe: Make DRM_XE_DEVICE_QUERY_ENGINES future proof

We have at least 2 future features(OA and future media engines capabilities) that will require Xe to provide more information about engines to UMDs. But this information should not just be added to drm_xe_engine_class_instance for a couple of reasons: - drm_xe_engine_class_instance is used as input to other structs/uAPIs and those uAPIs don't care about any of these future new engine fields - those new fields are useless information after initialization for some UMDs, so it should not need to carry that around So here my proposal is to make DRM_XE_DEVICE_QUERY_ENGINES return an array of drm_xe_query_engine_info that contain drm_xe_engine_class_instance and 3 u64s to be used for future features. Reference OA: https://patchwork.freedesktop.org/patch/558362/?series=121084&rev=6 v2: Reduce reserved[] to 3 u64 (Matthew Brost)

José Roberto de Souza committed 2 years ago

Commit 2bec3071 parent 6b8c1ed2 files · +33 −9Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/drm/xe_drm.h+25−2
@@ -124,7 +124,13 @@ struct xe_user_extension { · 123 unmodified lines
124124 #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)
125125 #define DRM_IOCTL_XE_WAIT_USER_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_WAIT_USER_FENCE, struct drm_xe_wait_user_fence)
126126
127−/** struct drm_xe_engine_class_instance - instance of an engine class */
127+/**
128+ * struct drm_xe_engine_class_instance - instance of an engine class
129+ *
130+ * It is returned as part of the @drm_xe_query_engine_info, but it also is
131+ * used as the input of engine selection for both @drm_xe_exec_queue_create
132+ * and @drm_xe_query_engine_cycles
133+ */
128134 struct drm_xe_engine_class_instance {
129135 #define DRM_XE_ENGINE_CLASS_RENDER 0
130136 #define DRM_XE_ENGINE_CLASS_COPY 1
@@ -137,14 +143,31 @@ struct drm_xe_engine_class_instance { · 6 unmodified lines
137143 */
138144 #define DRM_XE_ENGINE_CLASS_VM_BIND_ASYNC 5
139145 #define DRM_XE_ENGINE_CLASS_VM_BIND_SYNC 6
146+ /** @engine_class: engine class id */
140147 __u16 engine_class;
141−
148+ /** @engine_instance: engine instance id */
142149 __u16 engine_instance;
150+ /** @gt_id: Unique ID of this GT within the PCI Device */
143151 __u16 gt_id;
144152 /** @pad: MBZ */
145153 __u16 pad;
146154 };
147155
156+/**
157+ * struct drm_xe_query_engine_info - describe hardware engine
158+ *
159+ * If a query is made with a struct @drm_xe_device_query where .query
160+ * is equal to %DRM_XE_DEVICE_QUERY_ENGINES, then the reply uses an array of
161+ * struct @drm_xe_query_engine_info in .data.
162+ */
163+struct drm_xe_query_engine_info {
164+ /** @instance: The @drm_xe_engine_class_instance */
165+ struct drm_xe_engine_class_instance instance;
166+
167+ /** @reserved: Reserved */
168+ __u64 reserved[3];
169+};
170+
148171 /**
149172 * enum drm_xe_memory_class - Supported memory classes.
150173 */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t