From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: "Iddamsetty, Aravind" <aravind.iddamsetty@intel.com>
Cc: Bommu Krishnaiah <krishnaiah.bommu@intel.com>,
intel-xe@lists.freedesktop.org,
Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [Intel-xe] [PATCH v2 2/2] drm/xe/pmu: Enable PMU interface
Date: Mon, 17 Jul 2023 22:07:41 -0700 [thread overview]
Message-ID: <87ilahiz8i.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <04ae6811-9bc1-c66d-6cb8-640bfd8a9c7b@intel.com>
On Thu, 06 Jul 2023 20:53:47 -0700, Iddamsetty, Aravind wrote:
>
Hi Aravind,
Back to this review.
> >> On 06-07-2023 08:09, Dixit, Ashutosh wrote:
> >>> On Tue, 27 Jun 2023 05:21:13 -0700, Aravind Iddamsetty wrote:
> >>
> >>>> +static u64 __engine_group_busyness_read(struct xe_gt *gt, u64 config)
> >>>> +{
> >>>> + u64 val = 0;
> >>>> +
> >>>> + switch (config) {
> >>>> + case XE_PMU_RENDER_GROUP_BUSY(0):
> >>>> + val = xe_mmio_read32(gt, XE_OAG_RENDER_BUSY_FREE);
> >>>> + break;
> >>>> + case XE_PMU_COPY_GROUP_BUSY(0):
> >>>> + val = xe_mmio_read32(gt, XE_OAG_BLT_BUSY_FREE);
> >>>> + break;
> >>>> + case XE_PMU_MEDIA_GROUP_BUSY(0):
> >>>> + val = xe_mmio_read32(gt, XE_OAG_ANY_MEDIA_FF_BUSY_FREE);
> >>>> + break;
> >>>> + case XE_PMU_ANY_ENGINE_GROUP_BUSY(0):
> >>>> + val = xe_mmio_read32(gt, XE_OAG_RC0_ANY_ENGINE_BUSY_FREE);
> >>>> + break;
> >>>> + default:
> >>>> + drm_warn(>->tile->xe->drm, "unknown pmu event\n");
> >>>> + }
> >>>> +
> >>>> + return xe_gt_clock_interval_to_ns(gt, val * 16);
> >>>> +}
> >>>
> >>> A few questions on just the above function first:
> >>>
> >>> 1. OK so these registers won't be available to VF's, but any idea what
> >>> these counts are when VF's are active?
> >>
> >> VF's cannot access the registers but the counters will be incrementing
> >> if respective engines are busy and can be monitored from PF and that
> >> will be across all VFs.
> >
> > Ok, good.
> >
> >>
> >>>
> >>> 2. When would these 32 bit registers overflow? Let us say a group is
> >>> continuously busy and we are running at 1 GHz, the registers would
> >>> overflow in 4 seconds (max value 4G)?
> >>
> >> Based on BSPEC:52071 they use MHZ clock assuming the default 24MHz, it
> >> would take around 5726 secs to overflow.
> >
> > OK, overflow should not be an issue then. Though I have seen 19.2 and 38.4
> > MHz in OA. Also, if these are OAG registers, OA timestamp freq can be
> > different from CS timestamp freq, so not sure if that needs to be
> > handled. See i915_perf_oa_timestamp_frequency() in i915.
>
> so that is handled by below calculation
> >>
> >>>
> >>> 3. What is the multiplication by 16 (not factored above in 2.)? I don't see
> >>> that in Bspec.
> >>
> >> These counters are incremented based on crystal clock frequency and we
> >> need to convert to CS time base hence a 16x mul. BSPEC:52071
> >
> > Hmm still don't see the 16x mul in BSPEC:52071. Anyway.
>
> lets say the frequency is 24MHz so the counter increments every
> 1333.333ns(granularity) and corresponding cs timestamp base for this
> frequency is 83.333ns, 1333.333/83.333 = 16 and this true for rest of
> the frequency selections as well. hence we multiply the counter x 16.
OK, I finally see in Bspec:71028: "Unit in GPMusec. Refer to Timestamp
Bases for details" which is a pointer to Bspec: 52071. So the 16x multiply
looks correct (and these registers are not running at OA freq otherwise
we'd have to use i915_perf_oa_timestamp_frequency()). Hopefully it's
correct. Thanks.
next prev parent reply other threads:[~2023-07-18 5:07 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-27 12:21 [Intel-xe] [PATCH v2 0/2] drm/xe/pmu: Enable PMU interface Aravind Iddamsetty
2023-06-27 12:21 ` [Intel-xe] [PATCH v2 1/2] drm/xe: Get GT clock to nanosecs Aravind Iddamsetty
2023-07-04 9:29 ` Upadhyay, Tejas
2023-07-04 10:14 ` Upadhyay, Tejas
2023-07-05 4:46 ` Iddamsetty, Aravind
2023-07-06 0:55 ` Dixit, Ashutosh
2023-06-27 12:21 ` [Intel-xe] [PATCH v2 2/2] drm/xe/pmu: Enable PMU interface Aravind Iddamsetty
2023-06-30 13:53 ` Upadhyay, Tejas
2023-07-03 5:11 ` Iddamsetty, Aravind
2023-07-04 3:34 ` Ghimiray, Himal Prasad
2023-07-05 4:52 ` Iddamsetty, Aravind
2023-07-04 9:10 ` Upadhyay, Tejas
2023-07-05 4:42 ` Iddamsetty, Aravind
2023-07-06 2:39 ` Dixit, Ashutosh
2023-07-06 13:42 ` Iddamsetty, Aravind
2023-07-07 2:18 ` Dixit, Ashutosh
2023-07-07 3:53 ` Iddamsetty, Aravind
2023-07-07 6:08 ` Dixit, Ashutosh
2023-07-07 10:42 ` Iddamsetty, Aravind
2023-07-07 21:25 ` Dixit, Ashutosh
2023-07-10 6:05 ` Iddamsetty, Aravind
2023-07-10 8:12 ` Ursulin, Tvrtko
2023-07-11 16:19 ` Iddamsetty, Aravind
2023-07-11 23:10 ` Dixit, Ashutosh
2023-07-12 3:11 ` Iddamsetty, Aravind
2023-07-12 5:24 ` Dixit, Ashutosh
2023-07-11 22:58 ` Dixit, Ashutosh
2023-07-09 0:32 ` Dixit, Ashutosh
2023-07-10 4:13 ` Iddamsetty, Aravind
2023-07-10 5:57 ` Dixit, Ashutosh
2023-07-18 5:07 ` Dixit, Ashutosh [this message]
2023-07-19 6:59 ` Iddamsetty, Aravind
2023-07-06 2:40 ` Belgaumkar, Vinay
2023-07-06 13:06 ` Iddamsetty, Aravind
2023-07-21 1:02 ` Dixit, Ashutosh
2023-07-21 11:51 ` Iddamsetty, Aravind
2023-07-21 23:36 ` Dixit, Ashutosh
2023-07-22 6:04 ` Dixit, Ashutosh
2023-07-24 8:03 ` Iddamsetty, Aravind
2023-07-24 9:00 ` Ursulin, Tvrtko
2023-07-24 15:52 ` Dixit, Ashutosh
2023-07-24 15:52 ` Dixit, Ashutosh
2023-07-24 16:05 ` Iddamsetty, Aravind
2023-07-24 16:31 ` Dixit, Ashutosh
2023-07-25 11:38 ` Iddamsetty, Aravind
2023-08-07 21:16 ` Dixit, Ashutosh
2023-08-07 22:22 ` Dixit, Ashutosh
2023-08-08 13:45 ` Iddamsetty, Aravind
2023-08-08 15:18 ` Dixit, Ashutosh
2023-08-09 4:26 ` Iddamsetty, Aravind
2023-08-09 5:02 ` Dixit, Ashutosh
2023-07-24 9:38 ` Iddamsetty, Aravind
2023-07-22 14:39 ` Dixit, Ashutosh
2023-07-24 8:02 ` Iddamsetty, Aravind
2023-06-27 13:04 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/xe/pmu: Enable PMU interface (rev2) Patchwork
2023-06-27 13:05 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-06-27 13:06 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-06-27 13:10 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-06-27 13:10 ` [Intel-xe] ✗ CI.Hooks: 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=87ilahiz8i.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=aravind.iddamsetty@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=krishnaiah.bommu@intel.com \
--cc=tvrtko.ursulin@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