Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Luca Coelho <luca@coelho.fi>
Cc: Luca Coelho <luciano.coelho@intel.com>,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	jani.nikula@linux.intel.com
Subject: Re: [PATCH 6/8] drm/i915/display: move HSW and BDW clock gating init to display
Date: Tue, 31 Mar 2026 13:19:34 +0300	[thread overview]
Message-ID: <acuftvIa8GY4i57d@intel.com> (raw)
In-Reply-To: <d916a82d01456ede8a080484998b74af19286df5.camel@coelho.fi>

On Tue, Mar 31, 2026 at 01:03:42PM +0300, Luca Coelho wrote:
> On Tue, 2026-03-24 at 18:36 +0200, Ville Syrjälä wrote:
> > On Tue, Mar 24, 2026 at 04:29:55PM +0200, Luca Coelho wrote:
> > > Move the HSW and BDW display clock gating programming into the display
> > > code.  In this case we need two different helpers, because the common
> > > code between these two is split in the middle.
> > > 
> > > Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> > > ---
> > >  .../i915/display/intel_display_clock_gating.c | 33 +++++++++++++++++++
> > >  .../i915/display/intel_display_clock_gating.h |  6 ++++
> > >  drivers/gpu/drm/i915/intel_clock_gating.c     | 31 +++--------------
> > >  3 files changed, 43 insertions(+), 27 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
> > > index e3b7522b4101..0b2edf6acb79 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
> > > @@ -123,3 +123,36 @@ void intel_display_glk_init_clock_gating(struct intel_display *display)
> > >  		       intel_de_read(display, GEN9_CLKGATE_DIS_0) |
> > >  		       PWM1_GATING_DIS | PWM2_GATING_DIS);
> > >  }
> > > +
> > > +static void
> > > +intel_display_hsw_init_clock_gating_common(struct intel_display *display,
> > > +					   u32 unmask_vbl)
> > 
> > Passing that as a parameter feels a bit obfuscated.
> > 
> > > +{
> > > +	enum pipe pipe;
> > > +
> > > +	/* WaPsrDPAMaskVBlankInSRD:hsw */
> > > +	intel_de_rmw(display, CHICKEN_PAR1_1, 0, HSW_MASK_VBL_TO_PIPE_IN_SRD);
> > > +
> > > +	for_each_pipe(display, pipe) {
> > > +		/* WaPsrDPRSUnmaskVBlankInSRD:hsw,bdw */
> > > +		intel_de_rmw(display, CHICKEN_PIPESL_1(pipe), 0, unmask_vbl);
> > 
> > If we want to share the function then I'd probably just do
> > a platform check here.
> 
> True, I'll skip passing it and just add the platform check in this
> function.
> 
> 
> > 
> > > +	}
> > > +}
> > > +
> > > +void intel_display_bdw_hsw_init_clock_gating(struct intel_display *display)
> > > +{
> > > +	/* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */
> > > +	intel_de_rmw(display, CHICKEN_PIPESL_1(PIPE_A), 0, HSW_FBCQ_DIS);
> > > +}
> > 
> > Why do we have two different functions that shared by
> > both platforms?
> 
> It's because for BDW there is this one in between the two common calls:
> 
> 	/* WaSwitchSolVfFArbitrationPriority:bdw */
> 	intel_uncore_rmw(&i915->uncore, GAM_ECOCHK, 0, HSW_ECOCHK_ARB_PRIO_SOL);
> 
> ...this is probably independent from the other two and it may be okay
> to move it before the common code, but I wanted to avoid that.
> 
> Do you think it's safe to change the order from:
> 
> 1. CHICKEN_PIPESL_1
> 2. GAM_ECOCHK
> 3. CHICKEN_PAR1_1
> 
> ...to this?
> 
> 1. GAM_ECOCHK
> 2. CHICKEN_PIPESL_1
> 3. CHICKEN_PAR1_1
> 
> If that's the case, then it can be simplified.

There shouldn't be any ordering requirements here. But if you're
a it paranoid then you could do the reordering as a separate
step, just in case someone has to bisect it.

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2026-03-31 10:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 14:29 [PATCH 0/8] drm/i915: move more display dependencies from i915 Luca Coelho
2026-03-24 14:29 ` [PATCH 1/8] drm/i915: move SKL clock gating init to display Luca Coelho
2026-03-24 17:40   ` Jani Nikula
2026-03-31 11:59     ` Luca Coelho
2026-03-24 14:29 ` [PATCH 2/8] drm/i915: move KBL " Luca Coelho
2026-03-24 14:29 ` [PATCH 3/8] drm/i915/display: move CFL " Luca Coelho
2026-03-24 14:29 ` [PATCH 4/8] drm/i915/display: move BXT " Luca Coelho
2026-03-24 14:29 ` [PATCH 5/8] drm/i915/display: move GLK " Luca Coelho
2026-03-24 14:29 ` [PATCH 6/8] drm/i915/display: move HSW and BDW " Luca Coelho
2026-03-24 16:36   ` Ville Syrjälä
2026-03-31 10:03     ` Luca Coelho
2026-03-31 10:19       ` Ville Syrjälä [this message]
2026-03-31 10:23         ` Luca Coelho
2026-03-24 14:29 ` [PATCH 7/8] drm/i915/display: move pre-HSW " Luca Coelho
2026-03-24 15:04   ` Ville Syrjälä
2026-03-24 15:26     ` Luca Coelho
2026-03-24 14:29 ` [PATCH 8/8] drm/i915: remove HAS_PCH_NOP() dependency from clock gating Luca Coelho
2026-03-24 17:06 ` ✗ Fi.CI.BUILD: failure for drm/i915: move more display dependencies from i915 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=acuftvIa8GY4i57d@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 \
    --cc=luca@coelho.fi \
    --cc=luciano.coelho@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