Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: John Harrison <john.c.harrison@intel.com>
To: Riana Tauro <riana.tauro@intel.com>, <intel-xe@lists.freedesktop.org>
Cc: <anshuman.gupta@intel.com>, <umesh.nerlige.ramappa@intel.com>,
	<rodrigo.vivi@intel.com>, <vinay.belgaumkar@intel.com>,
	<aravind.iddamsetty@intel.com>, <ashutosh.dixit@intel.com>,
	<soham.purkait@intel.com>
Subject: Re: [PATCH v2 7/8] drm/xe/guc: Expose engine busyness only for supported GuC version
Date: Wed, 18 Dec 2024 16:19:43 -0800	[thread overview]
Message-ID: <cfc8ba8d-bed3-412d-92c6-28d2fc1392d7@intel.com> (raw)
In-Reply-To: <20241121063904.3033754-8-riana.tauro@intel.com>

On 11/20/2024 22:39, Riana Tauro wrote:
> Engine busyness is supported only on GuC versions >= 70.32.0
> Allow enabling/reading engine busyness only on supported
> GuC versions. Warn once if not supported.
>
> Signed-off-by: Riana Tauro <riana.tauro@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_engine_activity.c | 22 ++++++++++++++++++++++
>   1 file changed, 22 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_engine_activity.c b/drivers/gpu/drm/xe/xe_engine_activity.c
> index cbafd42f7f2f..9d569fea8fda 100644
> --- a/drivers/gpu/drm/xe/xe_engine_activity.c
> +++ b/drivers/gpu/drm/xe/xe_engine_activity.c
> @@ -245,6 +245,16 @@ static u32 gpm_timestamp_shift(struct xe_gt *gt)
>   	return 3 - REG_FIELD_GET(RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK, reg);
>   }
>   
> +static bool guc_engine_activity_supported(struct xe_guc *guc)
> +{
> +	if (GUC_FIRMWARE_VER(guc) >= MAKE_GUC_VER(70, 32, 0))
> +		return true;
Doesn't this need to be checking the API version rather than the file 
version? As in "GUC_SUBMIT_VER() >= MAKE_GUC_VER(1, 14, 1)" instead of 
"GUC_FIRMWARE_VER() >= 70.32.0"? One of the major reasons for the v3 
redesign was to support SRIOV VFs. And VFs do not get to see the file 
version, only the API version.

John.

> +
> +	drm_WARN_ON_ONCE(&guc_to_xe(guc)->drm,
> +			 "Engine busyness not supported in this GuC version\n");
> +	return false;
> +}
> +
>   /**
>    * xe_engine_activity_get_active_ticks - Get engine active ticks
>    * @hwe: The hw_engine object
> @@ -255,6 +265,9 @@ u64 xe_engine_activity_get_active_ticks(struct xe_hw_engine *hwe)
>   {
>   	struct xe_guc *guc =  &hwe->gt->uc.guc;
>   
> +	if (!guc_engine_activity_supported(guc))
> +		return 0;
> +
>   	return get_engine_active_ticks(guc, hwe);
>   }
>   
> @@ -268,6 +281,9 @@ u64 xe_engine_activity_get_total_ticks(struct xe_hw_engine *hwe)
>   {
>   	struct xe_guc *guc =  &hwe->gt->uc.guc;
>   
> +	if (!guc_engine_activity_supported(guc))
> +		return 0;
> +
>   	return get_engine_total_ticks(guc, hwe);
>   }
>   
> @@ -281,6 +297,9 @@ void xe_engine_activity_enable_stats(struct xe_guc *guc)
>   {
>   	int ret;
>   
> +	if (!guc_engine_activity_supported(guc))
> +		return;
> +
>   	ret = enable_engine_activity_stats(guc);
>   	if (ret)
>   		xe_gt_err(guc_to_gt(guc), "failed to enable activity stats%d\n", ret);
> @@ -307,6 +326,9 @@ int xe_engine_activity_init(struct xe_guc *guc)
>   	struct xe_gt *gt = guc_to_gt(guc);
>   	int ret;
>   
> +	if (!guc_engine_activity_supported(guc))
> +		return 0;
> +
>   	ret = allocate_activity_group(engine_busy);
>   	if (ret) {
>   		xe_gt_err(gt, "failed to allocate activity group %d\n", ret);


  parent reply	other threads:[~2024-12-19  0:19 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-21  6:38 [PATCH v2 0/8] Add PMU support for single engine busyness Riana Tauro
2024-11-21  6:33 ` ✓ CI.Patch_applied: success for Add PMU support for single engine busyness (rev2) Patchwork
2024-11-21  6:34 ` ✗ CI.checkpatch: warning " Patchwork
2024-11-21  6:35 ` ✓ CI.KUnit: success " Patchwork
2024-11-21  6:38 ` [PATCH v2 1/8] [DO NOT REVIEW] drm/xe/pmu: Enable PMU interface Riana Tauro
2024-11-21  6:38 ` [PATCH v2 2/8] [DO NOT REVIEW] drm/xe/pmu: Add GT C6 events Riana Tauro
2024-11-21  6:38 ` [PATCH v2 3/8] [DO NOT REVIEW] drm/xe/pmu: Add GT frequency events Riana Tauro
2024-11-21  6:39 ` [PATCH v2 4/8] drm/xe: add function to convert xe hw engine class to user class Riana Tauro
2024-12-10 23:48   ` Umesh Nerlige Ramappa
2024-12-18  7:33     ` Riana Tauro
2024-12-19  0:13       ` Umesh Nerlige Ramappa
2024-11-21  6:39 ` [PATCH v2 5/8] drm/xe: Add single engine busyness support Riana Tauro
2024-12-12 23:56   ` Umesh Nerlige Ramappa
2024-12-13  0:52     ` Lucas De Marchi
2024-12-13  7:06       ` Riana Tauro
2024-12-13 14:15         ` Lucas De Marchi
2024-12-13  6:22     ` Riana Tauro
2024-11-21  6:39 ` [PATCH v2 6/8] drm/xe/trace: Add trace for xe_engine_activity Riana Tauro
2024-11-21  6:39 ` [PATCH v2 7/8] drm/xe/guc: Expose engine busyness only for supported GuC version Riana Tauro
2024-12-13  5:44   ` Lucas De Marchi
2024-12-13  6:00     ` Riana Tauro
2024-12-13  6:04       ` Lucas De Marchi
2024-12-13  6:10         ` Riana Tauro
2024-12-13 17:26           ` Lucas De Marchi
2024-12-19  0:19   ` John Harrison [this message]
2024-11-21  6:39 ` [PATCH v2 8/8] drm/xe/pmu: Add PMU support for engine busyness Riana Tauro
2024-12-13  5:58   ` Lucas De Marchi
2024-12-18  5:12     ` Riana Tauro
2024-12-18 14:13       ` Lucas De Marchi
2024-12-18 14:51         ` Riana Tauro
2024-12-19  5:47           ` Riana Tauro
2024-12-19 18:46             ` Umesh Nerlige Ramappa
2025-01-06 14:06               ` Riana Tauro
2024-11-21  6:53 ` ✓ CI.Build: success for Add PMU support for single engine busyness (rev2) Patchwork
2024-11-21  6:55 ` ✗ CI.Hooks: failure " Patchwork
2024-11-21  6:57 ` ✓ CI.checksparse: success " Patchwork
2024-11-21  7:17 ` ✗ Xe.CI.BAT: failure " Patchwork
2024-11-21 13:52 ` ✗ Xe.CI.Full: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cfc8ba8d-bed3-412d-92c6-28d2fc1392d7@intel.com \
    --to=john.c.harrison@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=aravind.iddamsetty@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=soham.purkait@intel.com \
    --cc=umesh.nerlige.ramappa@intel.com \
    --cc=vinay.belgaumkar@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox