diff mbox series

[i-g-t] i915_pm_rps: Be wary if RP0 == RPn

Message ID 20200124213903.611152-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [i-g-t] i915_pm_rps: Be wary if RP0 == RPn | expand

Commit Message

Chris Wilson Jan. 24, 2020, 9:39 p.m. UTC
If the HW min/max frequencies are the same, there is not much range to
deal with and a couple of our invalid tests become confused as they are
actually no-ops.

Error reporting in i915_pm_rps is rudimentary and we deserve better.

Closes: https://gitlab.freedesktop.org/drm/intel/issues/1008
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/i915_pm_rps.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

Comments

Mika Kuoppala Jan. 27, 2020, 9:54 a.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> If the HW min/max frequencies are the same, there is not much range to
> deal with and a couple of our invalid tests become confused as they are
> actually no-ops.
>
> Error reporting in i915_pm_rps is rudimentary and we deserve better.
>
> Closes: https://gitlab.freedesktop.org/drm/intel/issues/1008
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  tests/i915/i915_pm_rps.c | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c
> index b65eefb03..56c745a5b 100644
> --- a/tests/i915/i915_pm_rps.c
> +++ b/tests/i915/i915_pm_rps.c
> @@ -397,9 +397,11 @@ static void min_max_config(void (*check)(void), bool load_gpu)
>  	writeval_inval(sysfs_files[MIN].filp, origfreqs[RP0] + 1000);
>  	check();
>  
> -	igt_debug("\nDecrease max to RPn (invalid)...\n");
> -	writeval_inval(sysfs_files[MAX].filp, origfreqs[RPn]);
> -	check();
> +	if (origfreqs[RPn] < origfreqs[RP0]) {
> +		igt_debug("\nDecrease max to RPn (invalid)...\n");
> +		writeval_inval(sysfs_files[MAX].filp, origfreqs[RPn]);
> +		check();
> +	}
>  
>  	igt_debug("\nDecrease min to midpoint...\n");
>  	writeval(sysfs_files[MIN].filp, fmid);
> @@ -429,9 +431,11 @@ static void min_max_config(void (*check)(void), bool load_gpu)
>  	writeval_inval(sysfs_files[MAX].filp, 0);
>  	check();
>  
> -	igt_debug("\nIncrease min to RP0 (invalid)...\n");
> -	writeval_inval(sysfs_files[MIN].filp, origfreqs[RP0]);
> -	check();
> +	if (origfreqs[RP0] > origfreqs[RP0]) {

RPn?
-Mika

> +		igt_debug("\nIncrease min to RP0 (invalid)...\n");
> +		writeval_inval(sysfs_files[MIN].filp, origfreqs[RP0]);
> +		check();
> +	}
>  
>  	igt_debug("\nIncrease max to midpoint...\n");
>  	writeval(sysfs_files[MAX].filp, fmid);
> -- 
> 2.25.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Chris Wilson Jan. 27, 2020, 10:01 a.m. UTC | #2
Quoting Mika Kuoppala (2020-01-27 09:54:25)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > If the HW min/max frequencies are the same, there is not much range to
> > deal with and a couple of our invalid tests become confused as they are
> > actually no-ops.
> >
> > Error reporting in i915_pm_rps is rudimentary and we deserve better.
> >
> > Closes: https://gitlab.freedesktop.org/drm/intel/issues/1008
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >  tests/i915/i915_pm_rps.c | 16 ++++++++++------
> >  1 file changed, 10 insertions(+), 6 deletions(-)
> >
> > diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c
> > index b65eefb03..56c745a5b 100644
> > --- a/tests/i915/i915_pm_rps.c
> > +++ b/tests/i915/i915_pm_rps.c
> > @@ -397,9 +397,11 @@ static void min_max_config(void (*check)(void), bool load_gpu)
> >       writeval_inval(sysfs_files[MIN].filp, origfreqs[RP0] + 1000);
> >       check();
> >  
> > -     igt_debug("\nDecrease max to RPn (invalid)...\n");
> > -     writeval_inval(sysfs_files[MAX].filp, origfreqs[RPn]);
> > -     check();
> > +     if (origfreqs[RPn] < origfreqs[RP0]) {
> > +             igt_debug("\nDecrease max to RPn (invalid)...\n");
> > +             writeval_inval(sysfs_files[MAX].filp, origfreqs[RPn]);
> > +             check();
> > +     }
> >  
> >       igt_debug("\nDecrease min to midpoint...\n");
> >       writeval(sysfs_files[MIN].filp, fmid);
> > @@ -429,9 +431,11 @@ static void min_max_config(void (*check)(void), bool load_gpu)
> >       writeval_inval(sysfs_files[MAX].filp, 0);
> >       check();
> >  
> > -     igt_debug("\nIncrease min to RP0 (invalid)...\n");
> > -     writeval_inval(sysfs_files[MIN].filp, origfreqs[RP0]);
> > -     check();
> > +     if (origfreqs[RP0] > origfreqs[RP0]) {
> 
> RPn?

if (RP0 > RPn)
-Chris
diff mbox series

Patch

diff --git a/tests/i915/i915_pm_rps.c b/tests/i915/i915_pm_rps.c
index b65eefb03..56c745a5b 100644
--- a/tests/i915/i915_pm_rps.c
+++ b/tests/i915/i915_pm_rps.c
@@ -397,9 +397,11 @@  static void min_max_config(void (*check)(void), bool load_gpu)
 	writeval_inval(sysfs_files[MIN].filp, origfreqs[RP0] + 1000);
 	check();
 
-	igt_debug("\nDecrease max to RPn (invalid)...\n");
-	writeval_inval(sysfs_files[MAX].filp, origfreqs[RPn]);
-	check();
+	if (origfreqs[RPn] < origfreqs[RP0]) {
+		igt_debug("\nDecrease max to RPn (invalid)...\n");
+		writeval_inval(sysfs_files[MAX].filp, origfreqs[RPn]);
+		check();
+	}
 
 	igt_debug("\nDecrease min to midpoint...\n");
 	writeval(sysfs_files[MIN].filp, fmid);
@@ -429,9 +431,11 @@  static void min_max_config(void (*check)(void), bool load_gpu)
 	writeval_inval(sysfs_files[MAX].filp, 0);
 	check();
 
-	igt_debug("\nIncrease min to RP0 (invalid)...\n");
-	writeval_inval(sysfs_files[MIN].filp, origfreqs[RP0]);
-	check();
+	if (origfreqs[RP0] > origfreqs[RP0]) {
+		igt_debug("\nIncrease min to RP0 (invalid)...\n");
+		writeval_inval(sysfs_files[MIN].filp, origfreqs[RP0]);
+		check();
+	}
 
 	igt_debug("\nIncrease max to midpoint...\n");
 	writeval(sysfs_files[MAX].filp, fmid);