public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 5/7] drm/i915: Move load time clock gating callback init earlier
Date: Wed, 09 Mar 2016 18:01:32 +0200	[thread overview]
Message-ID: <1457539292.18917.7.camel@intel.com> (raw)
In-Reply-To: <20160309155702.GJ1405@nuc-i3427.alporthouse.com>

On ke, 2016-03-09 at 15:57 +0000, Chris Wilson wrote:
> On Wed, Mar 09, 2016 at 05:31:44PM +0200, Imre Deak wrote:
> > Split out the part initing the clock gating callbacks and move it
> > earlier.
> > 
> > The rest of the callbacks in intel_init_pm() should be inited in
> > the
> > same way, but atm some of the callbacks are set only conditionally,
> > so
> > before doing this we need to make the setup unconditional and use
> > instead some flags.
> > 
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_dma.c  |  1 +
> >  drivers/gpu/drm/i915/intel_drv.h |  1 +
> >  drivers/gpu/drm/i915/intel_pm.c  | 65 ++++++++++++++++++++------
> > --------------
> >  3 files changed, 34 insertions(+), 33 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_dma.c
> > b/drivers/gpu/drm/i915/i915_dma.c
> > index 55b0c62..8cbe9ef 100644
> > --- a/drivers/gpu/drm/i915/i915_dma.c
> > +++ b/drivers/gpu/drm/i915/i915_dma.c
> > @@ -1030,6 +1030,7 @@ int i915_driver_load(struct drm_device *dev,
> > unsigned long flags)
> >  	intel_power_domains_init(dev_priv);
> >  	intel_irq_init(dev_priv);
> >  	intel_init_display_callbacks(dev_priv);
> > +	intel_init_clock_gating_callbacks(dev_priv);
> >  	intel_init_audio_callbacks(dev_priv);
> >  
> >  	intel_runtime_pm_get(dev_priv);
> > diff --git a/drivers/gpu/drm/i915/intel_drv.h
> > b/drivers/gpu/drm/i915/intel_drv.h
> > index 5264901..d3d31cc 100644
> > --- a/drivers/gpu/drm/i915/intel_drv.h
> > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > @@ -1596,6 +1596,7 @@ void intel_suspend_hw(struct drm_device
> > *dev);
> >  int ilk_wm_max_level(const struct drm_device *dev);
> >  void intel_update_watermarks(struct drm_crtc *crtc);
> >  void intel_init_pm(struct drm_device *dev);
> > +void intel_init_clock_gating_callbacks(struct drm_i915_private
> > *dev_priv);
> >  void intel_pm_setup(struct drm_device *dev);
> >  void intel_gpu_ips_init(struct drm_i915_private *dev_priv);
> >  void intel_gpu_ips_teardown(void);
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c
> > b/drivers/gpu/drm/i915/intel_pm.c
> > index d7aef17..02d3598 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -7107,6 +7107,38 @@ void intel_suspend_hw(struct drm_device
> > *dev)
> >  		lpt_suspend_hw(dev);
> >  }
> >  
> > +void intel_init_clock_gating_callbacks(struct drm_i915_private
> > *dev_priv)
> > +{
> > +	if (IS_BROXTON(dev_priv))
> > +		dev_priv->display.init_clock_gating =
> > bxt_init_clock_gating;
> > +	else if (IS_BROADWELL(dev_priv))
> > +		dev_priv->display.init_clock_gating =
> > broadwell_init_clock_gating;
> > +	else if (IS_CHERRYVIEW(dev_priv))
> > +		dev_priv->display.init_clock_gating =
> > cherryview_init_clock_gating;
> > +	else if (IS_HASWELL(dev_priv))
> > +		dev_priv->display.init_clock_gating =
> > haswell_init_clock_gating;
> > +	else if (IS_IVYBRIDGE(dev_priv))
> > +		dev_priv->display.init_clock_gating =
> > ivybridge_init_clock_gating;
> > +	else if (IS_VALLEYVIEW(dev_priv))
> > +		dev_priv->display.init_clock_gating =
> > valleyview_init_clock_gating;
> > +	else if (IS_GEN6(dev_priv))
> > +		dev_priv->display.init_clock_gating =
> > gen6_init_clock_gating;
> > +	else if (IS_GEN5(dev_priv))
> > +		dev_priv->display.init_clock_gating =
> > ironlake_init_clock_gating;
> > +	else if (IS_G4X(dev_priv))
> > +		dev_priv->display.init_clock_gating =
> > g4x_init_clock_gating;
> > +	else if (IS_CRESTLINE(dev_priv))
> > +		dev_priv->display.init_clock_gating =
> > crestline_init_clock_gating;
> > +	else if (IS_BROADWATER(dev_priv))
> > +		dev_priv->display.init_clock_gating =
> > broadwater_init_clock_gating;
> > +	else if (IS_GEN3(dev_priv))
> > +		dev_priv->display.init_clock_gating =
> > gen3_init_clock_gating;
> > +	else if (IS_I85X(dev_priv) || IS_I865G(dev_priv))
> > +		dev_priv->display.init_clock_gating =
> > i85x_init_clock_gating;
> > +	else if (IS_GEN2(dev_priv))
> > +		dev_priv->display.init_clock_gating =
> > i830_init_clock_gating;
> 
> else
> MISSING_CASE()
> 
> We definitely need a warning here in case we fall through and leave a
> most unexpected NULL pointer.

Ok, can add that. At least SKL doesn't have a callback, but I can check
for such platforms explicitly.

--Imre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-03-09 16:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 15:31 [PATCH 0/7] drm/i915: Move some load time init steps earlier Imre Deak
2016-03-09 15:31 ` [PATCH 1/7] drm/i915: Add comments marking the start of load time init phases Imre Deak
2016-03-09 15:31 ` [PATCH 2/7] drm/i915: Move laod time PCH detect, DPIO, power domain SW init earlier Imre Deak
2016-03-09 15:31 ` [PATCH 3/7] drm/i915: Move load time IRQ " Imre Deak
2016-03-09 15:31 ` [PATCH 4/7] drm/i915: Move load time display/audio callback " Imre Deak
2016-03-09 17:14   ` kbuild test robot
2016-03-10  8:58   ` Ander Conselvan De Oliveira
2016-03-10 11:24     ` Imre Deak
2016-03-11 14:00   ` Jani Nikula
2016-03-11 14:17     ` Imre Deak
2016-03-09 15:31 ` [PATCH 5/7] drm/i915: Move load time clock gating " Imre Deak
2016-03-09 15:57   ` Chris Wilson
2016-03-09 16:01     ` Imre Deak [this message]
2016-03-09 16:09       ` Chris Wilson
2016-03-09 15:31 ` [PATCH 6/7] drm/i915: Move load time runtime device info " Imre Deak
2016-03-09 15:31 ` [PATCH 7/7] drm/i915: Move load time runtime PM get later Imre Deak
2016-03-09 16:02 ` ✗ Fi.CI.BAT: warning for drm/i915: Move some load time init steps earlier Patchwork
2016-03-09 16:03 ` [PATCH 0/7] " Chris Wilson
2016-03-10 18:37   ` Imre Deak
2016-03-11 13:59   ` Jani Nikula

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=1457539292.18917.7.camel@intel.com \
    --to=imre.deak@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox