[Intel-xe] [PATCH 18/21] drm/xe/uapi: More OA uapi fixes/additions

Ashutosh Dixit ashutosh.dixit at intel.com
Tue Sep 19 16:10:46 UTC 2023


- Add drm_xe_query_oa_info to query information about OA units
- Discontinue DRM_XE_OA_PROP_GLOBAL_SSEU since it is no longer needed
- Add DRM_XE_OA_PROP_OA_BUFFER_SIZE to configure OA buffer size
- Add output parameter 'config_syncobj' to signal userland when stream
  configuration is complete.
- Add extensions field to structs to make structs future extensible

The implementation of these uapi features will follow later. At present the
emphasis is to finalize the uapi header.

Signed-off-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
---
 include/uapi/drm/xe_drm.h | 72 +++++++++++++++++++++++++++++++++++----
 1 file changed, 66 insertions(+), 6 deletions(-)

diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
index 77949c5abcee1..3b106bed42ea6 100644
--- a/include/uapi/drm/xe_drm.h
+++ b/include/uapi/drm/xe_drm.h
@@ -395,6 +395,7 @@ struct drm_xe_device_query {
 #define DRM_XE_DEVICE_QUERY_GTS		3
 #define DRM_XE_DEVICE_QUERY_HWCONFIG	4
 #define DRM_XE_DEVICE_QUERY_GT_TOPOLOGY	5
+#define DRM_XE_DEVICE_QUERY_OA_INFO	6
 	/** @query: The type of data to query */
 	__u32 query;
 
@@ -1133,6 +1134,48 @@ enum drm_xe_oa_format_type {
 	XE_OA_FMT_TYPE_PEC,
 };
 
+/**
+ * struct drm_xe_query_oa_info - describe OA units
+ *
+ * If a query is made with a struct drm_xe_device_query where .query
+ * is equal to DRM_XE_DEVICE_QUERY_OA_INFO, then the reply uses struct
+ * drm_xe_query_oa_info in .data.
+ */
+struct drm_xe_query_oa_info {
+	/** @extensions: Pointer to the first extension struct, if any */
+	__u64 extensions;
+
+	/** @oa_unit_count: number of OA units returned in oau[] */
+	__u32 oa_unit_count;
+
+	/** @pad: MBZ */
+	__u32 pad;
+
+	/** @reserved: MBZ */
+	__u64 reserved[4];
+
+	/** @oau: OA units returned for this device */
+	struct drm_xe_query_oa_unit {
+		/** @oa_unit_id: OA unit ID */
+		__u16 oa_unit_id;
+
+		/** @gt_id: GT ID for this OA unit */
+		__u16 gt_id;
+
+		/** @pad: MBZ */
+		__u32 pad;
+
+		/** @oa_timestamp_freq: OA timestamp freq */
+		__u64 oa_timestamp_freq;
+
+		/** @reserved: MBZ */
+		__u64 reserved[4];
+
+		/** @eci: engines attached to this OA unit */
+		struct drm_xe_engine_class_instance eci[];
+	} oau[];
+};
+
 enum drm_xe_oa_property_id {
 	/**
 	 * Open the stream for a specific exec queue id (as used with
@@ -1185,13 +1228,11 @@ enum drm_xe_oa_property_id {
 	DRM_XE_OA_PROP_HOLD_PREEMPTION,
 
 	/**
-	 * Specifying this pins all contexts to the specified SSEU power
-	 * configuration for the duration of the recording.
-	 *
-	 * This parameter's value is a pointer to a struct
-	 * drm_xe_gem_context_param_sseu (TBD).
+	 * Specify a global OA buffer size to be allocated in bytes. The
+	 * size specified must be supported by HW (powers of 2 ranging from
+	 * 128 KB to 128Mb depending on the platform)
 	 */
-	DRM_XE_OA_PROP_GLOBAL_SSEU,
+	DRM_XE_OA_PROP_OA_BUFFER_SIZE,
 
 	/**
 	 * This optional parameter specifies the timer interval in nanoseconds
@@ -1223,6 +1264,22 @@ enum drm_xe_oa_property_id {
 };
 
 struct drm_xe_oa_open_param {
+	/** @extensions: Pointer to the first extension struct, if any */
+	__u64 extensions;
+
+	/**
+	 * @config_syncobj: (Output) handle to configuration syncobj
+	 *
+	 * Handle to a syncobj which the kernel will signal after stream
+	 * configuration or re-configuration is complete (after return from
+	 * the ioctl). This handle can be provided as a dependency to the
+	 * next XE exec ioctl.
+	 */
+	__u32 config_syncobj;
+
+	__u32 reserved;
+
+	/** @flags: Flags */
 	__u32 flags;
 #define XE_OA_FLAG_FD_CLOEXEC	(1 << 0)
 #define XE_OA_FLAG_FD_NONBLOCK	(1 << 1)
@@ -1283,6 +1340,9 @@ enum drm_xe_oa_record_type {
 };
 
 struct drm_xe_oa_config {
+	/** @extensions: Pointer to the first extension struct, if any */
+	__u64 extensions;
+
 	/**
 	 * @uuid:
 	 *
-- 
2.41.0



More information about the Intel-xe mailing list