[Intel-gfx] [PATCH v3] drm/i915/selftests: add basic selftests for rc6
Andi Shyti
andi.shyti at intel.com
Tue Dec 3 12:32:24 UTC 2019
> > > }
> > > +
> > > +static bool test_rc6(struct intel_rc6 *rc6, bool enabled)
> >
> > I keep getting confused as to the meaning of the result, forgetting it
> > changes based on bool enabled.
> >
> > Maybe u32 measure_rc6() and leave the pass/fail to the caller?
thinking a bit better... what exactly would I return? what would
measure_rc6 measure? The "sleeping" function is not precise by
definition (as you pointed out as well) and it would be out from
the scope of this function to provide an exact measure of the
interval count.
The way I would rather do it would be:
u32 measure_rc6(u32 time_in_ms)
{
...
}
bool test_rc6(bool enable)
{
...
return enable ^ does_rc6_work(2 * interval);
}
where measure_rc6 provides the counter in a more precise time
range and can be also used for other tests, like hysteresis or
duty cycle tests where I guess time measurement is more critical.
But as for now such function wouldn't be of any use. I could
eventually call 'test_rc6' in a more intuitive way, like
'is_rc6_enabled()'.
Andi
> yes, I was thinking the same, it makes, indeed more sense.
>
> The original idea was just to know whether rc6 works or not.
>
> Thanks,
> Andi
More information about the Intel-gfx
mailing list