History

drm/xe/oa/uapi: Add/remove OA config perf ops

Introduce add/remove config perf ops for OA. OA configurations consist of a set of event/counter select register address/value pairs. The add_config perf op validates and stores such configurations and also exposes them in the metrics sysfs. These configurations will be programmed to OA unit HW when an OA stream using a configuration is opened. The OA stream can also switch to other stored configurations. v2: Start config id's from 1 and other minor review comments (Umesh) v3: Add 32 bit build v4: Add kernel doc for non-static functions (Michal)

Ashutosh Dixit committed 2 years ago

Commit cdf02fe1 parent a9f905a6 files · +495 −0Browse files

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

Unified · Split

include/uapi/drm/xe_drm.h+25−0
@@ -1378,6 +1378,7 @@ struct drm_xe_wait_user_fence { · 1377 unmodified lines
13781378 * enum drm_xe_perf_type - Perf stream types
13791379 */
13801380 enum drm_xe_perf_type {
1381+ DRM_XE_PERF_TYPE_OA,
13811382 __DRM_XE_PERF_TYPE_MAX, /* non-ABI */
13821383 };
13831384
@@ -1469,6 +1470,30 @@ enum drm_xe_oa_format_type { · 85 unmodified lines
14691470 DRM_XE_OA_FMT_TYPE_PEC,
14701471 };
14711472
1473+/**
1474+ * struct drm_xe_oa_config - OA metric configuration
1475+ *
1476+ * Multiple OA configs can be added using @DRM_XE_PERF_OP_ADD_CONFIG. A
1477+ * particular config can be specified when opening an OA stream using
1478+ * @DRM_XE_OA_PROPERTY_OA_METRIC_SET property.
1479+ */
1480+struct drm_xe_oa_config {
1481+ /** @extensions: Pointer to the first extension struct, if any */
1482+ __u64 extensions;
1483+
1484+ /** @uuid: String formatted like "%\08x-%\04x-%\04x-%\04x-%\012x" */
1485+ char uuid[36];
1486+
1487+ /** @n_regs: Number of regs in @regs_ptr */
1488+ __u32 n_regs;
1489+
1490+ /**
1491+ * @regs_ptr: Pointer to (register address, value) pairs for OA config
1492+ * registers. Expected length of buffer is: (2 * sizeof(u32) * @n_regs).
1493+ */
1494+ __u64 regs_ptr;
1495+};
1496+
14721497 #if defined(__cplusplus)
14731498 }
14741499 #endif