From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
To: Riana Tauro <riana.tauro@intel.com>
Cc: <intel-xe@lists.freedesktop.org>, <anshuman.gupta@intel.com>,
<rodrigo.vivi@intel.com>, <vinay.belgaumkar@intel.com>,
<aravind.iddamsetty@intel.com>, <john.c.harrison@intel.com>,
<ashutosh.dixit@intel.com>, <soham.purkait@intel.com>
Subject: Re: [PATCH 6/7] drm/xe/guc: Expose engine busyness only for supported GuC version
Date: Thu, 14 Nov 2024 13:12:18 -0800 [thread overview]
Message-ID: <ZzZnsubeuFrar5S6@orsosgc001> (raw)
In-Reply-To: <20241113045549.2390980-7-riana.tauro@intel.com>
On Wed, Nov 13, 2024 at 10:25:48AM +0530, 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 7a2ae09d23de..fc34dcf3057a 100644
>--- a/drivers/gpu/drm/xe/xe_engine_activity.c
>+++ b/drivers/gpu/drm/xe/xe_engine_activity.c
>@@ -236,6 +236,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;
>+
>+ 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
>@@ -246,6 +256,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);
> }
>
>@@ -259,6 +272,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))
Since total ticks is used in the denominator, UMDs would run into
divide-by-zero if they implemented this feature, but do not have an
updated GuC. We ran into that issue with some older version of this
feature and UMDs patched it up in their code. Do you think we can return
the cpu time here converted to gpu ticks? That way with unsupported GuC,
UMDs still get 0 busyness.
Thanks,
Umesh
>+ return 0;
>+
> return get_engine_total_ticks(guc, hwe);
> }
>
>@@ -272,6 +288,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);
>@@ -298,6 +317,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);
>--
>2.40.0
>
next prev parent reply other threads:[~2024-11-14 21:12 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 4:55 [PATCH 0/7] Add PMU support for single engine busyness Riana Tauro
2024-11-13 4:55 ` [PATCH 1/7] [DO NOT REVIEW] drm/xe/pmu: Enable PMU interface Riana Tauro
2024-11-13 4:55 ` [PATCH 2/7] [DO NOT REVIEW] drm/xe/pmu: Add GT C6 events Riana Tauro
2024-11-13 4:55 ` [PATCH 3/7] [DO NOT REVIEW] drm/xe/pmu: Add GT frequency events Riana Tauro
2024-11-13 4:55 ` [PATCH 4/7] drm/xe: add function to convert xe hw engine class to user class Riana Tauro
2024-11-14 16:14 ` Umesh Nerlige Ramappa
2024-11-15 7:18 ` Riana Tauro
2024-11-14 17:46 ` Rodrigo Vivi
2024-11-15 7:21 ` Riana Tauro
2024-11-13 4:55 ` [PATCH 5/7] drm/xe: Add single engine busyness support Riana Tauro
2024-11-15 0:08 ` Umesh Nerlige Ramappa
2024-11-18 7:33 ` Riana Tauro
2024-11-13 4:55 ` [PATCH 6/7] drm/xe/guc: Expose engine busyness only for supported GuC version Riana Tauro
2024-11-14 21:12 ` Umesh Nerlige Ramappa [this message]
2024-11-15 0:12 ` Umesh Nerlige Ramappa
2024-11-18 7:37 ` Riana Tauro
2024-11-18 23:32 ` Umesh Nerlige Ramappa
2024-11-13 4:55 ` [PATCH 7/7] drm/xe/pmu: Add PMU support for engine busyness Riana Tauro
2024-11-13 14:41 ` ✓ CI.Patch_applied: success for Add PMU support for single " Patchwork
2024-11-13 14:42 ` ✗ CI.checkpatch: warning " Patchwork
2024-11-13 14:43 ` ✓ CI.KUnit: success " Patchwork
2024-11-13 14:55 ` ✓ CI.Build: " Patchwork
2024-11-13 14:57 ` ✗ CI.Hooks: failure " Patchwork
2024-11-13 14:59 ` ✓ CI.checksparse: success " Patchwork
2024-11-13 15:19 ` ✗ CI.BAT: failure " Patchwork
2024-11-13 21:22 ` ✓ CI.FULL: success " 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=ZzZnsubeuFrar5S6@orsosgc001 \
--to=umesh.nerlige.ramappa@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=aravind.iddamsetty@intel.com \
--cc=ashutosh.dixit@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=john.c.harrison@intel.com \
--cc=riana.tauro@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=soham.purkait@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