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>,
<lucas.demarchi@intel.com>, <vinay.belgaumkar@intel.com>,
<ashutosh.dixit@intel.com>, <john.c.harrison@intel.com>,
<rodrigo.vivi@intel.com>, <aravind.iddamsetty@intel.com>,
<soham.purkait@intel.com>
Subject: Re: [PATCH v3 08/10] drm/xe/guc: Expose engine activity only for supported GuC version
Date: Thu, 16 Jan 2025 15:10:03 -0800 [thread overview]
Message-ID: <Z4mRy9d7leeoPDLB@orsosgc001> (raw)
In-Reply-To: <20250106075600.852080-9-riana.tauro@intel.com>
On Mon, Jan 06, 2025 at 01:25:57PM +0530, 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 submission version (John)
>
>Signed-off-by: Riana Tauro <riana.tauro@intel.com>
>---
> drivers/gpu/drm/xe/xe_guc_engine_activity.c | 31 +++++++++++++++++++++
> drivers/gpu/drm/xe/xe_guc_engine_activity.h | 1 +
> 2 files changed, 32 insertions(+)
>
>diff --git a/drivers/gpu/drm/xe/xe_guc_engine_activity.c b/drivers/gpu/drm/xe/xe_guc_engine_activity.c
>index 14950b42d1b1..5aea42f0cded 100644
>--- a/drivers/gpu/drm/xe/xe_guc_engine_activity.c
>+++ b/drivers/gpu/drm/xe/xe_guc_engine_activity.c
>@@ -255,6 +255,9 @@ u64 xe_guc_engine_activity_active_ticks(struct xe_hw_engine *hwe)
> {
> struct xe_guc *guc = &hwe->gt->uc.guc;
>
>+ if (!xe_guc_engine_activity_supported(guc))
>+ return 0;
>+
> return get_engine_active_ticks(guc, hwe);
> }
>
>@@ -268,9 +271,31 @@ u64 xe_guc_engine_activity_total_ticks(struct xe_hw_engine *hwe)
> {
> struct xe_guc *guc = &hwe->gt->uc.guc;
>
>+ if (!xe_guc_engine_activity_supported(guc))
>+ return 0;
>+
> return get_engine_total_ticks(guc, hwe);
> }
>
>+/**
>+ * xe_guc_engine_activity_enable_stats - Enable engine activity stats
>+ * @guc: The GuC object
>+ *
>+ * Engine activity stats is supported from GuC submission version
>+ * (1.14.1)
>+ *
>+ * Return: true if engine activity stats supported, false otherwise
>+ */
>+bool xe_guc_engine_activity_supported(struct xe_guc *guc)
>+{
>+ if (GUC_SUBMIT_VER(guc) >= MAKE_GUC_VER(1, 14, 1))
>+ return true;
>+
>+ drm_WARN_ON_ONCE(&guc_to_xe(guc)->drm,
>+ "Engine busyness not supported in this GuC version\n");
A warn ON may be heavy. Can we live with just a debug print here?
>+ return false;
>+}
>+
> /**
> * xe_guc_engine_activity_enable_stats - Enable engine activity stats
> * @guc: The GuC object
>@@ -281,6 +306,9 @@ void xe_guc_engine_activity_enable_stats(struct xe_guc *guc)
> {
> int ret;
>
>+ if (!xe_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 +335,9 @@ int xe_guc_engine_activity_init(struct xe_guc *guc)
> struct xe_gt *gt = guc_to_gt(guc);
> int ret;
>
>+ if (!xe_guc_engine_activity_supported(guc))
>+ return 0;
>+
> ret = allocate_engine_activity_group(guc);
> if (ret) {
> xe_gt_err(gt, "failed to allocate activity group %d\n", ret);
>diff --git a/drivers/gpu/drm/xe/xe_guc_engine_activity.h b/drivers/gpu/drm/xe/xe_guc_engine_activity.h
>index 6cd435b81bbe..e2c2f1bb2b59 100644
>--- a/drivers/gpu/drm/xe/xe_guc_engine_activity.h
>+++ b/drivers/gpu/drm/xe/xe_guc_engine_activity.h
>@@ -12,6 +12,7 @@ struct xe_hw_engine;
> struct xe_guc;
>
> int xe_guc_engine_activity_init(struct xe_guc *guc);
>+bool xe_guc_engine_activity_supported(struct xe_guc *guc);
> void xe_guc_engine_activity_enable_stats(struct xe_guc *guc);
> u64 xe_guc_engine_activity_active_ticks(struct xe_hw_engine *hwe);
> u64 xe_guc_engine_activity_total_ticks(struct xe_hw_engine *hwe);
>--
>2.47.1
>
next prev parent reply other threads:[~2025-01-16 23:10 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-06 7:55 [PATCH v3 00/10] PMU Support for per-engine-class activity Riana Tauro
2025-01-06 7:55 ` [PATCH v3 01/10] [DO NOT REVIEW] drm/xe/pmu: Enable PMU interface Riana Tauro
2025-01-06 7:55 ` [PATCH v3 02/10] [DO NOT REVIEW] drm/xe: Add locks in gtidle code Riana Tauro
2025-01-06 7:55 ` [PATCH v3 03/10] [DO NOT REVIEW] drm/xe/pmu: Add GT C6 events Riana Tauro
2025-01-06 7:55 ` [PATCH v3 04/10] [DO NOT REVIEW] drm/xe/pmu: Add GT frequency events Riana Tauro
2025-01-06 7:55 ` [PATCH v3 05/10] [DO NOT REVIEW] drm/xe/xe_pmu: add fixes for base PMU Riana Tauro
2025-01-06 7:55 ` [PATCH v3 06/10] drm/xe: Add per-engine-class activity support Riana Tauro
2025-01-06 7:55 ` [PATCH v3 07/10] drm/xe/trace: Add trace for engine activity Riana Tauro
2025-01-16 23:08 ` Umesh Nerlige Ramappa
2025-01-06 7:55 ` [PATCH v3 08/10] drm/xe/guc: Expose engine activity only for supported GuC version Riana Tauro
2025-01-16 23:10 ` Umesh Nerlige Ramappa [this message]
2025-01-27 10:05 ` Riana Tauro
2025-01-06 7:55 ` [PATCH v3 09/10] drm/xe/pmu: Add PMU support for per-engine-class activity Riana Tauro
2025-01-14 0:57 ` Umesh Nerlige Ramappa
2025-01-17 1:18 ` Umesh Nerlige Ramappa
2025-01-17 13:26 ` Riana Tauro
2025-01-06 7:55 ` [PATCH v3 10/10] drm/xe/guc: Bump minimum required GuC version to v70.36.0 Riana Tauro
2025-01-06 8:28 ` ✓ CI.Patch_applied: success for PMU Support for per-engine-class activity Patchwork
2025-01-06 8:29 ` ✗ CI.checkpatch: warning " Patchwork
2025-01-06 8:30 ` ✓ CI.KUnit: success " Patchwork
2025-01-06 8:48 ` ✓ CI.Build: " Patchwork
2025-01-06 8:50 ` ✗ CI.Hooks: failure " Patchwork
2025-01-06 8:52 ` ✓ CI.checksparse: success " Patchwork
2025-01-06 9:18 ` ✓ Xe.CI.BAT: " Patchwork
2025-01-06 17:10 ` ✗ Xe.CI.Full: failure " 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=Z4mRy9d7leeoPDLB@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=lucas.demarchi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.