diff mbox

[7/7] drm/i915/skl: Warn if the cached cdclk freq is not the requested one

Message ID 1433438495-16667-7-git-send-email-damien.lespiau@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lespiau, Damien June 4, 2015, 5:21 p.m. UTC
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Ville Syrjälä June 5, 2015, 12:24 p.m. UTC | #1
On Thu, Jun 04, 2015 at 06:21:35PM +0100, Damien Lespiau wrote:
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index a232dc9..a018465 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -5627,6 +5627,10 @@ static void skl_set_cdclk(struct drm_i915_private *dev_priv, unsigned int freq)
>  	mutex_unlock(&dev_priv->rps.hw_lock);
>  
>  	intel_update_cdclk(dev);
> +
> +	WARN(freq != dev_priv->cdclk_freq,
> +	     "cdclk requested %d kHz but got %d kHz\n",
> +	     freq, dev_priv->cdclk_freq);
>  }

Could you add this to all the set_cdclk() functions? Maybe
intel_check_cdclk() or something.

>  
>  void skl_uninit_cdclk(struct drm_i915_private *dev_priv)
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Lespiau, Damien June 5, 2015, 12:40 p.m. UTC | #2
On Fri, Jun 05, 2015 at 03:24:45PM +0300, Ville Syrjälä wrote:
> On Thu, Jun 04, 2015 at 06:21:35PM +0100, Damien Lespiau wrote:
> > Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index a232dc9..a018465 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -5627,6 +5627,10 @@ static void skl_set_cdclk(struct drm_i915_private *dev_priv, unsigned int freq)
> >  	mutex_unlock(&dev_priv->rps.hw_lock);
> >  
> >  	intel_update_cdclk(dev);
> > +
> > +	WARN(freq != dev_priv->cdclk_freq,
> > +	     "cdclk requested %d kHz but got %d kHz\n",
> > +	     freq, dev_priv->cdclk_freq);
> >  }
> 
> Could you add this to all the set_cdclk() functions? Maybe
> intel_check_cdclk() or something.

I was thinking that we should probably introduce a low level
set_core_display_clock() vfunc and a intel_set_core_display_clock()
wrapper were we'd put the common code (updating the cached value, that
WARN(), ...)

Thoughts?
Ville Syrjälä June 5, 2015, 12:42 p.m. UTC | #3
On Fri, Jun 05, 2015 at 01:40:29PM +0100, Damien Lespiau wrote:
> On Fri, Jun 05, 2015 at 03:24:45PM +0300, Ville Syrjälä wrote:
> > On Thu, Jun 04, 2015 at 06:21:35PM +0100, Damien Lespiau wrote:
> > > Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/intel_display.c | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > > index a232dc9..a018465 100644
> > > --- a/drivers/gpu/drm/i915/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/intel_display.c
> > > @@ -5627,6 +5627,10 @@ static void skl_set_cdclk(struct drm_i915_private *dev_priv, unsigned int freq)
> > >  	mutex_unlock(&dev_priv->rps.hw_lock);
> > >  
> > >  	intel_update_cdclk(dev);
> > > +
> > > +	WARN(freq != dev_priv->cdclk_freq,
> > > +	     "cdclk requested %d kHz but got %d kHz\n",
> > > +	     freq, dev_priv->cdclk_freq);
> > >  }
> > 
> > Could you add this to all the set_cdclk() functions? Maybe
> > intel_check_cdclk() or something.
> 
> I was thinking that we should probably introduce a low level
> set_core_display_clock() vfunc and a intel_set_core_display_clock()
> wrapper were we'd put the common code (updating the cached value, that
> WARN(), ...)
> 
> Thoughts?

Yeah wrapper around the vfunc sounds better than sprinkling the same
stuff into every vfunc.
Shuang He June 5, 2015, 4:40 p.m. UTC | #4
Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 6539
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV                                  270/270              270/270
ILK                                  303/303              303/303
SNB                                  312/312              312/312
IVB                                  343/343              343/343
BYT                                  287/287              287/287
BDW                                  318/318              318/318
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
Note: You need to pay more attention to line start with '*'
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a232dc9..a018465 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5627,6 +5627,10 @@  static void skl_set_cdclk(struct drm_i915_private *dev_priv, unsigned int freq)
 	mutex_unlock(&dev_priv->rps.hw_lock);
 
 	intel_update_cdclk(dev);
+
+	WARN(freq != dev_priv->cdclk_freq,
+	     "cdclk requested %d kHz but got %d kHz\n",
+	     freq, dev_priv->cdclk_freq);
 }
 
 void skl_uninit_cdclk(struct drm_i915_private *dev_priv)