[Intel-gfx] [PATCH 1/2] tests/pm_rps: Round requested freq correctly
Daniel Vetter
daniel.vetter at ffwll.ch
Fri Feb 7 11:15:15 CET 2014
On Fri, Feb 7, 2014 at 10:33 AM, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> On Fri, Feb 07, 2014 at 10:03:33AM +0100, Daniel Vetter wrote:
>> The kernel will round it, so if we don't we'll have a spurious
>> mismatch. Happens on my machine here with 650-1300MHz range, where the
>> midpoint is 975.
>>
>> Cc: Jeff McGee <jeff.mcgee at intel.com>
>> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
>> ---
>> tests/pm_rps.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/tests/pm_rps.c b/tests/pm_rps.c
>> index 467038104ec6..27e758755e3f 100644
>> --- a/tests/pm_rps.c
>> +++ b/tests/pm_rps.c
>> @@ -350,6 +350,9 @@ static void min_max_config(void (*check)(void))
>> {
>> int fmid = (origfreqs[RPn] + origfreqs[RP0]) / 2;
>>
>> + /* hw (and so kernel) currently rounds to 50 MHz ... */
>
> s/rounds/truncates/ or if it really does round, you need to adjust the
> calculation.
We just need to use something divisible by 50 so that the value we
write and the one we get match up. Whether it's truncating or rounding
doesn't matter really.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
More information about the Intel-gfx
mailing list