From: Jani Nikula <jani.nikula@linux.intel.com>
To: Vinay Belgaumkar <vinay.belgaumkar@intel.com>,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 2/2] drm/i915/slpc: Update the frequency debugfs
Date: Wed, 05 Oct 2022 11:55:16 +0300 [thread overview]
Message-ID: <87bkqqsl8r.fsf@intel.com> (raw)
In-Reply-To: <20221004222903.23898-3-vinay.belgaumkar@intel.com>
On Tue, 04 Oct 2022, Vinay Belgaumkar <vinay.belgaumkar@intel.com> wrote:
> Read the values stored in the SLPC structures. Remove the
> fields that are no longer valid (like RPS interrupts) as
> well.
>
> v2: Move all functionality changes to this patch (Jani)
>
> Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
> ---
> drivers/gpu/drm/i915/gt/intel_rps.c | 46 ++++++++++++++++++++++++++++-
> 1 file changed, 45 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_rps.c b/drivers/gpu/drm/i915/gt/intel_rps.c
> index 737db780db00..8181d85e89f8 100644
> --- a/drivers/gpu/drm/i915/gt/intel_rps.c
> +++ b/drivers/gpu/drm/i915/gt/intel_rps.c
> @@ -2219,7 +2219,7 @@ u32 intel_rps_get_rpn_frequency(struct intel_rps *rps)
> return intel_gpu_freq(rps, rps->min_freq);
> }
>
> -void gen6_rps_frequency_dump(struct intel_rps *rps, struct drm_printer *p)
> +void rps_frequency_dump(struct intel_rps *rps, struct drm_printer *p)
> {
> struct intel_gt *gt = rps_to_gt(rps);
> struct drm_i915_private *i915 = gt->i915;
> @@ -2382,6 +2382,50 @@ void gen6_rps_frequency_dump(struct intel_rps *rps, struct drm_printer *p)
> intel_gpu_freq(rps, rps->efficient_freq));
> }
>
> +static void slpc_frequency_dump(struct intel_rps *rps, struct drm_printer *p)
> +{
> + struct intel_gt *gt = rps_to_gt(rps);
> + struct intel_uncore *uncore = gt->uncore;
> + struct intel_rps_freq_caps caps;
> + u32 pm_mask;
> +
> + gen6_rps_get_freq_caps(rps, &caps);
> + pm_mask = intel_uncore_read(uncore, GEN6_PMINTRMSK);
> +
> + drm_printf(p, "PM MASK=0x%08x\n", pm_mask);
> + drm_printf(p, "pm_intrmsk_mbz: 0x%08x\n",
> + rps->pm_intrmsk_mbz);
> + drm_printf(p, "RPSTAT1: 0x%08x\n", intel_uncore_read(uncore, GEN6_RPSTAT1));
> + drm_printf(p, "RPNSWREQ: %dMHz\n", intel_rps_get_requested_frequency(rps));
> + drm_printf(p, "Lowest (RPN) frequency: %dMHz\n",
> + intel_gpu_freq(rps, caps.min_freq));
> + drm_printf(p, "Nominal (RP1) frequency: %dMHz\n",
> + intel_gpu_freq(rps, caps.rp1_freq));
> + drm_printf(p, "Max non-overclocked (RP0) frequency: %dMHz\n",
> + intel_gpu_freq(rps, caps.rp0_freq));
> + drm_printf(p, "Current freq: %d MHz\n",
> + intel_rps_get_requested_frequency(rps));
> + drm_printf(p, "Actual freq: %d MHz\n",
> + intel_rps_read_actual_frequency(rps));
> + drm_printf(p, "Min freq: %d MHz\n",
> + intel_rps_get_min_frequency(rps));
> + drm_printf(p, "Boost freq: %d MHz\n",
> + intel_rps_get_boost_frequency(rps));
> + drm_printf(p, "Max freq: %d MHz\n",
> + intel_rps_get_max_frequency(rps));
> + drm_printf(p,
> + "efficient (RPe) frequency: %d MHz\n",
> + intel_gpu_freq(rps, caps.rp1_freq));
> +}
> +
> +void gen6_rps_frequency_dump(struct intel_rps *rps, struct drm_printer *p)
> +{
> + if (!rps_uses_slpc(rps))
Please don't use "if not" when you have two branches like this. Just
flip them around and use the positive.
BR,
Jani.
> + return rps_frequency_dump(rps, p);
> + else
> + return slpc_frequency_dump(rps, p);
> +}
> +
> static int set_max_freq(struct intel_rps *rps, u32 val)
> {
> struct drm_i915_private *i915 = rps_to_i915(rps);
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2022-10-05 8:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-04 22:29 [Intel-gfx] [PATCH v2 0/2] drm/i915/slpc: Update frequency debugfs for SLPC Vinay Belgaumkar
2022-10-04 22:29 ` Vinay Belgaumkar
2022-10-04 22:29 ` [Intel-gfx] [PATCH v2 1/2] drm/i915: Add a wrapper for frequency debugfs Vinay Belgaumkar
2022-10-04 22:29 ` Vinay Belgaumkar
2022-10-04 22:29 ` [Intel-gfx] [PATCH v2 2/2] drm/i915/slpc: Update the " Vinay Belgaumkar
2022-10-04 22:29 ` Vinay Belgaumkar
2022-10-05 1:23 ` [Intel-gfx] " kernel test robot
2022-10-05 1:23 ` kernel test robot
2022-10-05 3:24 ` [Intel-gfx] " kernel test robot
2022-10-05 3:24 ` kernel test robot
2022-10-05 8:55 ` Jani Nikula [this message]
2022-10-04 23:33 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915/slpc: Update frequency debugfs for SLPC (rev3) Patchwork
2022-10-04 23:57 ` Belgaumkar, Vinay
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=87bkqqsl8r.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--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.