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)
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -124,7 +124,13 @@ struct xe_user_extension { · 123 unmodified lines | |||
| 124 | #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) | 124 | #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) |
| 125 | #define DRM_IOCTL_XE_WAIT_USER_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_WAIT_USER_FENCE, struct drm_xe_wait_user_fence) | 125 | #define DRM_IOCTL_XE_WAIT_USER_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_WAIT_USER_FENCE, struct drm_xe_wait_user_fence) |
| 126 | 126 | ||
| 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 | */ | ||
| 128 | struct drm_xe_engine_class_instance { | 134 | struct drm_xe_engine_class_instance { |
| 129 | #define DRM_XE_ENGINE_CLASS_RENDER 0 | 135 | #define DRM_XE_ENGINE_CLASS_RENDER 0 |
| 130 | #define DRM_XE_ENGINE_CLASS_COPY 1 | 136 | #define DRM_XE_ENGINE_CLASS_COPY 1 |
| @@ -137,14 +143,31 @@ struct drm_xe_engine_class_instance { · 6 unmodified lines | |||
| 137 | */ | 143 | */ |
| 138 | #define DRM_XE_ENGINE_CLASS_VM_BIND_ASYNC 5 | 144 | #define DRM_XE_ENGINE_CLASS_VM_BIND_ASYNC 5 |
| 139 | #define DRM_XE_ENGINE_CLASS_VM_BIND_SYNC 6 | 145 | #define DRM_XE_ENGINE_CLASS_VM_BIND_SYNC 6 |
| 146 | /** @engine_class: engine class id */ | ||
| 140 | __u16 engine_class; | 147 | __u16 engine_class; |
| 141 | 148 | /** @engine_instance: engine instance id */ | |
| 142 | __u16 engine_instance; | 149 | __u16 engine_instance; |
| 150 | /** @gt_id: Unique ID of this GT within the PCI Device */ | ||
| 143 | __u16 gt_id; | 151 | __u16 gt_id; |
| 144 | /** @pad: MBZ */ | 152 | /** @pad: MBZ */ |
| 145 | __u16 pad; | 153 | __u16 pad; |
| 146 | }; | 154 | }; |
| 147 | 155 | ||
| 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 | |||
| 148 | /** | 171 | /** |
| 149 | * enum drm_xe_memory_class - Supported memory classes. | 172 | * enum drm_xe_memory_class - Supported memory classes. |
| 150 | */ | 173 | */ |