diff mbox

[2/2] drm/i915: Warn if rps max frequency is not set

Message ID 20180320151734.11761-2-mika.kuoppala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mika Kuoppala March 20, 2018, 3:17 p.m. UTC
Warn on enabling rps when our hw max is invalid.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Mika Kuoppala March 20, 2018, 4:28 p.m. UTC | #1
Mika Kuoppala <mika.kuoppala@linux.intel.com> writes:

> Warn on enabling rps when our hw max is invalid.
>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 19e82aaa9863..bc335c52a17a 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -8157,6 +8157,8 @@ static void intel_enable_rps(struct drm_i915_private *dev_priv)
>  		intel_init_emon(dev_priv);
>  	}
>  
> +	WARN_ON(rps->max_freq == 0);
> +
Ok, this wont fly with gen < 6
-Mika

>  	WARN_ON(rps->max_freq < rps->min_freq);
>  	WARN_ON(rps->idle_freq > rps->max_freq);
>  
> -- 
> 2.14.1
Chris Wilson March 20, 2018, 6:01 p.m. UTC | #2
Quoting Mika Kuoppala (2018-03-20 16:28:20)
> Mika Kuoppala <mika.kuoppala@linux.intel.com> writes:
> 
> > Warn on enabling rps when our hw max is invalid.
> >
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_pm.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index 19e82aaa9863..bc335c52a17a 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -8157,6 +8157,8 @@ static void intel_enable_rps(struct drm_i915_private *dev_priv)
> >               intel_init_emon(dev_priv);
> >       }
> >  
> > +     WARN_ON(rps->max_freq == 0);
> > +
> Ok, this wont fly with gen < 6

Close, we can just guard these by HAS_RPS. I think there's a series you
might want to review...
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 19e82aaa9863..bc335c52a17a 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -8157,6 +8157,8 @@  static void intel_enable_rps(struct drm_i915_private *dev_priv)
 		intel_init_emon(dev_priv);
 	}
 
+	WARN_ON(rps->max_freq == 0);
+
 	WARN_ON(rps->max_freq < rps->min_freq);
 	WARN_ON(rps->idle_freq > rps->max_freq);