[PATCH v7 3/5] drm/xe/guc: Expose engine activity only for supported GuC version
Michal Wajdeczko
michal.wajdeczko at intel.com
Fri Feb 14 11:32:27 UTC 2025
On 14.02.2025 11:08, Riana Tauro wrote:
> Engine activity is supported only on GuC submission version >= 1.14.1
> Allow enabling/reading engine activity only on supported
> GuC versions. Warn once if not supported.
>
> v2: use guc interface version (John)
> v3: use debug log (Umesh)
> v4: use variable for supported and use gt logs
> use a friendlier log message (Michal)
> v5: fix kernel-doc
> do not continue in init if not supported (Michal)
> v6: remove hardcoding values (Michal)
>
> Cc: John Harrison <John.C.Harrison at Intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Signed-off-by: Riana Tauro <riana.tauro at intel.com>
> Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa at intel.com>
> ---
> drivers/gpu/drm/xe/xe_guc_engine_activity.c | 51 ++++++++++++++++++-
> drivers/gpu/drm/xe/xe_guc_engine_activity.h | 1 +
> .../gpu/drm/xe/xe_guc_engine_activity_types.h | 3 ++
> 3 files changed, 53 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_guc_engine_activity.c b/drivers/gpu/drm/xe/xe_guc_engine_activity.c
> index a424527eddb6..2a457dcf31d5 100644
> --- a/drivers/gpu/drm/xe/xe_guc_engine_activity.c
> +++ b/drivers/gpu/drm/xe/xe_guc_engine_activity.c
> @@ -95,6 +95,29 @@ static void free_engine_activity_buffers(struct engine_activity_buffer *buffer)
> xe_bo_unpin_map_no_vm(buffer->activity_bo);
> }
>
> +static bool is_engine_activity_supported(struct xe_guc *guc)
> +{
> + struct xe_uc_fw_version *version = &guc->fw.versions.found[XE_UC_FW_VER_COMPATIBILITY];
> + struct xe_uc_fw_version required = { 1, 14, 1 };
nit: could use designated initializers to always be on the safe side
> + struct xe_gt *gt = guc_to_gt(guc);
> +
> + if (IS_SRIOV_VF(gt_to_xe(gt))) {
> + xe_gt_info(gt, "engine activity stats not supported on VFs\n");
> + return false;
> + }
> +
> + /* engine activity stats is supported from GuC interface version (1.14.1) */
> + if (GUC_SUBMIT_VER(guc) < MAKE_GUC_VER_STRUCT(required)) {
> + xe_gt_info(gt,
> + "engine activity stats unsupported in GuC interface v%u.%u.%u, need v%u.%u.%u or higher\n",
> + version->major, version->minor, version->patch, required.major,
> + required.minor, required.patch);
> + return false;
> + }
Reviewed-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
More information about the Intel-xe
mailing list