intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 06/20] drm/i915/cdclk: Extract dg2_power_well_count()
Date: Wed, 24 Sep 2025 12:56:38 +0300	[thread overview]
Message-ID: <aNPAVg9USFz9rf93@intel.com> (raw)
In-Reply-To: <30933726eb345cbf6ea9b1dcbfc0ad890d31e0d7@intel.com>

On Wed, Sep 24, 2025 at 12:05:56PM +0300, Jani Nikula wrote:
> On Wed, 24 Sep 2025, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Extract the code to determine the DG2 pipe power well count
> > into a small helper. I'll have other uses for this later.
> >
> > TODO: need to move this power well stuff out from the cdclk code...
> >
> > v2: Don't lose the early return from intel_cdclk_pcode_pre_notify()
> >     (kernel test robot)
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_cdclk.c | 33 +++++++++++++---------
> >  1 file changed, 19 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
> > index 05d9f488895e..f190cfb85a34 100644
> > --- a/drivers/gpu/drm/i915/display/intel_cdclk.c
> > +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
> > @@ -2591,6 +2591,12 @@ static void intel_set_cdclk(struct intel_display *display,
> >  	}
> >  }
> >  
> > +static bool dg2_power_well_count(struct intel_display *display,
> > +				 const struct intel_cdclk_state *cdclk_state)
> > +{
> > +	return display->platform.dg2 ? hweight8(cdclk_state->active_pipes) : 0;
> > +}
> > +
> >  static void intel_cdclk_pcode_pre_notify(struct intel_atomic_state *state)
> >  {
> >  	struct intel_display *display = to_intel_display(state);
> > @@ -2603,16 +2609,16 @@ static void intel_cdclk_pcode_pre_notify(struct intel_atomic_state *state)
> >  
> >  	if (!intel_cdclk_changed(&old_cdclk_state->actual,
> >  				 &new_cdclk_state->actual) &&
> > -				 new_cdclk_state->active_pipes ==
> > -				 old_cdclk_state->active_pipes)
> > +	    dg2_power_well_count(display, old_cdclk_state) ==
> > +	    dg2_power_well_count(display, old_cdclk_state))
> 
> Both have old_cdclk_state, making this always true.

doh

> 
> Side note, perhaps the whole function should be renamed
> dg2_cdclk_pcode_pre_notify(), because the additional dg2 check in
> dg2_power_well_count() felt weird until I realized this is all dg2 only.

Yeah, the whole thing should really be moved out from the cdclk
code completely. This is essentially a variant of pmdemand,
just through the pcode mailbox instead of using dedicated
pmdemand registers (which internally will get sent over
to pcode anyway). But the actual pmdemand code is also borked
in various ways, so that too will need a lot of work :/

I can cook up a patch to rename these in the meantime.

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-09-24  9:56 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-23 17:19 [PATCH 00/20] drm/i915/cdclk: Decouple CDCLK from state->modeset Ville Syrjala
2025-09-23 17:19 ` [PATCH 01/20] drm/i915: Introduce intel_crtc_enable_changed() and intel_any_crtc_enable_changed() Ville Syrjala
2025-09-23 17:19 ` [PATCH 02/20] drm/i915: Introduce intel_crtc_active_changed() and intel_any_crtc_active_changed() Ville Syrjala
2025-09-23 17:19 ` [PATCH 03/20] drm/i915/bw: Skip the bw_state->active_pipes update if no pipe is changing its active state Ville Syrjala
2025-09-23 17:19 ` [PATCH 04/20] drm/1915/bw: Drop redundant display version checks Ville Syrjala
2025-09-23 17:19 ` [PATCH 05/20] drm/i915/cdclk: Extract glk_cdclk_audio_wa_needed() Ville Syrjala
2025-09-23 17:19 ` [PATCH 06/20] drm/i915/cdclk: Extract dg2_power_well_count() Ville Syrjala
2025-09-23 23:05   ` kernel test robot
2025-09-24  6:16   ` [PATCH v2 " Ville Syrjala
2025-09-24  9:05     ` Jani Nikula
2025-09-24  9:56       ` Ville Syrjälä [this message]
2025-09-26  8:39   ` [PATCH v3 " Ville Syrjala
2025-10-09 16:59   ` [PATCH " kernel test robot
2025-09-23 17:19 ` [PATCH 07/20] drm/i915/cdclk: Introduce intel_cdclk_modeset_checks() Ville Syrjala
2025-09-23 17:19 ` [PATCH 08/20] drm/i915/cdclk: Handle the force_min_cdclk state locking in intel_cdclk_atomic_check() Ville Syrjala
2025-09-23 17:19 ` [PATCH 09/20] drm/i915/cdclk: Extract intel_cdclk_update_bw_min_cdclk() Ville Syrjala
2025-09-23 17:19 ` [PATCH 10/20] drm/i915/cdclk: Extract intel_cdclk_update_crtc_min_cdclk() Ville Syrjala
2025-09-23 17:19 ` [PATCH 11/20] drm/i915/cdclk: Rework bw_min_cdclk handling Ville Syrjala
2025-09-23 17:19 ` [PATCH 12/20] drm/i915/cdclk: Do intel_cdclk_update_crtc_min_cdclk() per-pipe Ville Syrjala
2025-09-23 17:19 ` [PATCH 13/20] drm/i915/cdclk: Relocate intel_plane_calc_min_cdclk() calls Ville Syrjala
2025-09-23 17:19 ` [PATCH 14/20] drm/i915/cdclk: Rework crtc min_cdclk handling Ville Syrjala
2025-09-23 17:19 ` [PATCH 15/20] drm/i915/cdclk: Move intel_bw_crtc_min_cdclk() handling into intel_crtc_compute_min_cdclk() Ville Syrjala
2025-09-23 17:19 ` [PATCH 16/20] drm/i915/cdclk: Decuple cdclk from state->modeset Ville Syrjala
2025-09-23 17:19 ` [PATCH 17/20] drm/i915: Introduce intel_calc_enabled_pipes() Ville Syrjala
2025-09-23 17:19 ` [PATCH 18/20] drm/i915/cdclk: Use enabled_pipes instead of active_pipes for the glk audio w/a Ville Syrjala
2025-09-23 17:19 ` [PATCH 19/20] drm/i915/cdclk: Hide intel_modeset_calc_cdclk() Ville Syrjala
2025-09-23 17:19 ` [PATCH 20/20] drm/i915/cdclk: Move intel_cdclk_atomic_check() Ville Syrjala
2025-09-23 17:46 ` ✗ CI.checkpatch: warning for drm/i915/cdclk: Decouple CDCLK from state->modeset Patchwork
2025-09-23 17:48 ` ✓ CI.KUnit: success " Patchwork
2025-09-23 18:09 ` ✗ CI.checksparse: warning " Patchwork
2025-09-23 21:34 ` ✗ Xe.CI.Full: failure " Patchwork
2025-09-24  3:47 ` ✓ Xe.CI.BAT: success " Patchwork
2025-09-24  6:22 ` ✗ CI.checkpatch: warning for drm/i915/cdclk: Decouple CDCLK from state->modeset (rev2) Patchwork
2025-09-24  6:23 ` ✓ CI.KUnit: success " Patchwork
2025-09-24  6:38 ` ✗ CI.checksparse: warning " Patchwork
2025-09-24  6:58 ` ✓ Xe.CI.BAT: success " Patchwork
2025-09-24  9:34 ` ✗ Xe.CI.Full: failure " Patchwork
2025-09-26  8:46 ` ✗ CI.checkpatch: warning for drm/i915/cdclk: Decouple CDCLK from state->modeset (rev3) Patchwork
2025-09-26  8:47 ` ✓ CI.KUnit: success " Patchwork
2025-09-26  9:03 ` ✗ CI.checksparse: warning " Patchwork
2025-09-26  9:28 ` ✓ Xe.CI.BAT: success " Patchwork
2025-09-26 13:36 ` ✓ Xe.CI.Full: " Patchwork
2025-10-08  7:15 ` [PATCH 00/20] drm/i915/cdclk: Decouple CDCLK from state->modeset Kahola, Mika

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=aNPAVg9USFz9rf93@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.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;
as well as URLs for NNTP newsgroup(s).