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)
Showing the changes to include/uapi (1 of 6 files). Show all
Unified · Split
| @@ -1378,6 +1378,7 @@ struct drm_xe_wait_user_fence { · 1377 unmodified lines | |||
| 1378 | * enum drm_xe_perf_type - Perf stream types | 1378 | * enum drm_xe_perf_type - Perf stream types |
| 1379 | */ | 1379 | */ |
| 1380 | enum drm_xe_perf_type { | 1380 | enum drm_xe_perf_type { |
| 1381 | DRM_XE_PERF_TYPE_OA, | ||
| 1381 | __DRM_XE_PERF_TYPE_MAX, /* non-ABI */ | 1382 | __DRM_XE_PERF_TYPE_MAX, /* non-ABI */ |
| 1382 | }; | 1383 | }; |
| 1383 | 1384 | ||
| @@ -1469,6 +1470,30 @@ enum drm_xe_oa_format_type { · 85 unmodified lines | |||
| 1469 | DRM_XE_OA_FMT_TYPE_PEC, | 1470 | DRM_XE_OA_FMT_TYPE_PEC, |
| 1470 | }; | 1471 | }; |
| 1471 | 1472 | ||
| 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 | |||
| 1472 | #if defined(__cplusplus) | 1497 | #if defined(__cplusplus) |
| 1473 | } | 1498 | } |
| 1474 | #endif | 1499 | #endif |