From: "Belgaumkar, Vinay" <vinay.belgaumkar@intel.com>
To: Riana Tauro <riana.tauro@intel.com>, <intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915/selftests: Add helper function measure_power
Date: Mon, 26 Sep 2022 08:57:52 -0700 [thread overview]
Message-ID: <e6a8896e-1b48-a5be-4b3a-f21ec883fcef@intel.com> (raw)
In-Reply-To: <20220923110043.789178-3-riana.tauro@intel.com>
On 9/23/2022 4:00 AM, Riana Tauro wrote:
> move the power measurement and the triangle filter
> to a different function. No functional changes.
>
> Signed-off-by: Riana Tauro <riana.tauro@intel.com>
LGTM,
Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
> ---
> drivers/gpu/drm/i915/gt/selftest_rps.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/selftest_rps.c b/drivers/gpu/drm/i915/gt/selftest_rps.c
> index cfb4708dd62e..99a372486fb7 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_rps.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_rps.c
> @@ -1107,21 +1107,27 @@ static u64 __measure_power(int duration_ms)
> return div64_u64(1000 * 1000 * dE, dt);
> }
>
> -static u64 measure_power_at(struct intel_rps *rps, int *freq)
> +static u64 measure_power(struct intel_rps *rps, int *freq)
> {
> u64 x[5];
> int i;
>
> - *freq = rps_set_check(rps, *freq);
> for (i = 0; i < 5; i++)
> x[i] = __measure_power(5);
> - *freq = (*freq + read_cagf(rps)) / 2;
> +
> + *freq = (*freq + intel_rps_read_actual_frequency(rps)) / 2;
>
> /* A simple triangle filter for better result stability */
> sort(x, 5, sizeof(*x), cmp_u64, NULL);
> return div_u64(x[1] + 2 * x[2] + x[3], 4);
> }
>
> +static u64 measure_power_at(struct intel_rps *rps, int *freq)
> +{
> + *freq = rps_set_check(rps, *freq);
> + return measure_power(rps, freq);
> +}
> +
> int live_rps_power(void *arg)
> {
> struct intel_gt *gt = arg;
next prev parent reply other threads:[~2022-09-26 15:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-23 11:00 [Intel-gfx] [PATCH 0/3] Add SLPC selftest live_slpc_power Riana Tauro
2022-09-23 11:00 ` [Intel-gfx] [PATCH 1/3] drm/i915/guc/slpc: Run SLPC selftests on all tiles Riana Tauro
2022-09-26 16:02 ` Belgaumkar, Vinay
2022-09-23 11:00 ` [Intel-gfx] [PATCH 2/3] drm/i915/selftests: Add helper function measure_power Riana Tauro
2022-09-26 15:57 ` Belgaumkar, Vinay [this message]
2022-09-23 11:00 ` [Intel-gfx] [PATCH 3/3] drm/i915/guc/slpc: Add SLPC selftest live_slpc_power Riana Tauro
2022-09-26 16:04 ` Belgaumkar, Vinay
2022-09-27 11:12 ` Gupta, Anshuman
2022-09-28 5:57 ` Tauro, Riana
2022-09-29 5:46 ` Gupta, Anshuman
2022-09-23 13:44 ` [Intel-gfx] ✓ Fi.CI.BAT: success for Add SLPC selftest live_slpc_power (rev2) Patchwork
2022-09-24 2:01 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-09-29 7:16 ` Gupta, Anshuman
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=e6a8896e-1b48-a5be-4b3a-f21ec883fcef@intel.com \
--to=vinay.belgaumkar@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=riana.tauro@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