All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 3/5] drm/i915/mtl: Modify CAGF functions for MTL
Date: Fri, 21 Oct 2022 12:12:48 -0400	[thread overview]
Message-ID: <Y1LFAAWIcxzlhkAP@intel.com> (raw)
In-Reply-To: <87zgdpp3lw.wl-ashutosh.dixit@intel.com>

On Fri, Oct 21, 2022 at 09:02:03AM -0700, Dixit, Ashutosh wrote:
> On Wed, 19 Oct 2022 16:37:19 -0700, Ashutosh Dixit wrote:
> >
> > From: Badal Nilawar <badal.nilawar@intel.com>
> >
> > Update CAGF functions for MTL to get actual resolved frequency of 3D and
> > SAMedia.
> >
> > v2: Update MTL_MIRROR_TARGET_WP1 position/formatting (MattR)
> >     Move MTL branches in cagf functions to top (MattR)
> >     Fix commit message (Andi)
> > v3: Added comment about registers not needing forcewake for Gen12+ and
> >     returning 0 freq in RC6
> > v4: Use REG_FIELD_GET and uncore (Rodrigo)
> >
> > Bspec: 66300
> 
> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> 
> >
> > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> > Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
> > ---
> >  drivers/gpu/drm/i915/gt/intel_gt_regs.h |  4 ++++
> >  drivers/gpu/drm/i915/gt/intel_rps.c     | 12 ++++++++++--
> >  2 files changed, 14 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_regs.h b/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> > index f8c4f758ac0b1..d8dbd0ac3b064 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> > +++ b/drivers/gpu/drm/i915/gt/intel_gt_regs.h
> > @@ -21,6 +21,10 @@
> >   */
> >  #define PERF_REG(offset)			_MMIO(offset)
> >
> > +/* MTL workpoint reg to get core C state and actual freq of 3D, SAMedia */
> > +#define MTL_MIRROR_TARGET_WP1			_MMIO(0xc60)
> > +#define   MTL_CAGF_MASK				REG_GENMASK(8, 0)
> > +
> >  /* RPM unit config (Gen8+) */
> >  #define RPM_CONFIG0				_MMIO(0xd00)
> >  #define   GEN9_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_SHIFT	3
> > diff --git a/drivers/gpu/drm/i915/gt/intel_rps.c b/drivers/gpu/drm/i915/gt/intel_rps.c
> > index da6b969f554b6..63cc7c538401e 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_rps.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_rps.c
> > @@ -2093,7 +2093,9 @@ u32 intel_rps_get_cagf(struct intel_rps *rps, u32 rpstat)
> >	struct drm_i915_private *i915 = rps_to_i915(rps);
> >	u32 cagf;
> >
> > -	if (GRAPHICS_VER(i915) >= 12)
> > +	if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 70))
> > +		cagf = REG_FIELD_GET(MTL_CAGF_MASK, rpstat);
> > +	else if (GRAPHICS_VER(i915) >= 12)
> >		cagf = REG_FIELD_GET(GEN12_CAGF_MASK, rpstat);
> >	else if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915))
> >		cagf = REG_FIELD_GET(RPE_MASK, rpstat);
> > @@ -2115,7 +2117,13 @@ static u32 read_cagf(struct intel_rps *rps)
> >	struct intel_uncore *uncore = rps_to_uncore(rps);
> >	u32 freq;
> >
> > -	if (GRAPHICS_VER(i915) >= 12) {
> > +	/*
> > +	 * For Gen12+ reading freq from HW does not need a forcewake and
> > +	 * registers will return 0 freq when GT is in RC6
> > +	 */
> > +	if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 70)) {
> > +		freq = intel_uncore_read(uncore, MTL_MIRROR_TARGET_WP1);
> > +	} else if (GRAPHICS_VER(i915) >= 12) {
> >		freq = intel_uncore_read(uncore, GEN12_RPSTAT1);
> >	} else if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) {
> >		vlv_punit_get(i915);
> > --
> > 2.38.0
> >

  reply	other threads:[~2022-10-21 16:13 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 23:37 [Intel-gfx] [PATCH 0/5] i915: CAGF and RC6 changes for MTL Ashutosh Dixit
2022-10-19 23:37 ` Ashutosh Dixit
2022-10-19 23:37 ` [Intel-gfx] [PATCH 1/5] drm/i915/rps: Prefer REG_FIELD_GET in intel_rps_get_cagf Ashutosh Dixit
2022-10-19 23:37   ` Ashutosh Dixit
2022-10-21 16:11   ` [Intel-gfx] " Rodrigo Vivi
2022-10-21 16:11     ` Rodrigo Vivi
2022-10-19 23:37 ` [Intel-gfx] [PATCH 2/5] drm/i915: Use GEN12_RPSTAT register for GT freq Ashutosh Dixit
2022-10-19 23:37   ` Ashutosh Dixit
2022-10-21 16:12   ` [Intel-gfx] " Rodrigo Vivi
2022-10-19 23:37 ` [Intel-gfx] [PATCH 3/5] drm/i915/mtl: Modify CAGF functions for MTL Ashutosh Dixit
2022-10-19 23:37   ` Ashutosh Dixit
2022-10-21 16:02   ` [Intel-gfx] " Dixit, Ashutosh
2022-10-21 16:12     ` Rodrigo Vivi [this message]
2022-10-19 23:37 ` [Intel-gfx] [PATCH 4/5] drm/i915/gt: Use RC6 residency types as arguments to residency functions Ashutosh Dixit
2022-10-19 23:37   ` Ashutosh Dixit
2022-10-21 16:15   ` [Intel-gfx] " Rodrigo Vivi
2022-10-21 16:15     ` Rodrigo Vivi
2022-10-19 23:37 ` [Intel-gfx] [PATCH 5/5] drm/i915/mtl: C6 residency and C state type for MTL SAMedia Ashutosh Dixit
2022-10-19 23:37   ` Ashutosh Dixit
2022-10-21 16:35   ` [Intel-gfx] " Rodrigo Vivi
2022-10-21 16:35     ` Rodrigo Vivi
2022-10-24 19:16     ` [Intel-gfx] " Dixit, Ashutosh
2022-10-24 19:16       ` Dixit, Ashutosh
2022-10-24 19:49       ` [Intel-gfx] " Rodrigo Vivi
2022-10-24 19:49         ` Rodrigo Vivi
2022-10-20  0:17 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for i915: CAGF and RC6 changes for MTL (rev8) Patchwork
2022-10-20  0:38 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2022-10-21 17:43 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for i915: CAGF and RC6 changes for MTL (rev9) Patchwork
2022-10-21 18:04 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-10-22  9:58 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2022-10-24 19:13 [Intel-gfx] [PATCH 0/5] i915: CAGF and RC6 changes for MTL Ashutosh Dixit
2022-10-24 19:13 ` [Intel-gfx] [PATCH 3/5] drm/i915/mtl: Modify CAGF functions " Ashutosh Dixit
2022-10-24 20:24 [Intel-gfx] [PATCH 0/5] i915: CAGF and RC6 changes " Ashutosh Dixit
2022-10-24 20:24 ` [Intel-gfx] [PATCH 3/5] drm/i915/mtl: Modify CAGF functions " Ashutosh Dixit
2022-11-14 12:33 [Intel-gfx] [PATCH 0/5] i915: CAGF and RC6 changes " Badal Nilawar
2022-11-14 12:33 ` [Intel-gfx] [PATCH 3/5] drm/i915/mtl: Modify CAGF functions " Badal Nilawar

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=Y1LFAAWIcxzlhkAP@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.