Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
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: Mon, 18 Nov 2024 15:32:31 -0800	[thread overview]
Message-ID: <ZzvOj3lFfaGnL0/K@orsosgc001> (raw)
In-Reply-To: <8ceea4a6-96d2-432d-8375-73d968d068c4@intel.com>

On Mon, Nov 18, 2024 at 01:07:32PM +0530, Riana Tauro wrote:
>Hi Umesh
>
>On 11/15/2024 5:42 AM, Umesh Nerlige Ramappa wrote:
>>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))
>>
>>Hmm, not sure my response to this landed on the ML. Sending again..
>>
>>If GuC is an older version and UMDs have implemented the new 
>>interface, we could return CPU time in ticks here so that UMDs will 
>>still be able to use something in the denominator instead of a 
>>divide by zero. Busy value will still be 0. Thoughts?
>We could do this. But shouldn't UMD only read total ticks if they see 
>an actual busyness? Busyness % will anyway be 0 even if we return the 
>cpu time in ticks

Well, I think we shouldn't have to impose that condition on the UMDs - 
read total ticks only if engine busy ticks is non-zero. At the same time 
they should not use a zero delta in the denominator anyways, so you can 
ignore this for now. We can add it if there's an issue later.

Thanks,
Umesh

>
>Thanks
>Riana Tauro
>>
>>Umesh
>>
>>>+        return 0;
>>>+
>>>    return get_engine_total_ticks(guc, hwe);
>>>}
>

  reply	other threads:[~2024-11-18 23:32 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
2024-11-15  0:12   ` Umesh Nerlige Ramappa
2024-11-18  7:37     ` Riana Tauro
2024-11-18 23:32       ` Umesh Nerlige Ramappa [this message]
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=ZzvOj3lFfaGnL0/K@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