diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2011-01-22 18:30:24 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2011-01-22 18:30:24 +0000 |
commit | 6d2e7769e2bafead0e6c8826c465ce0bbbb065ee (patch) | |
tree | b301f41c4e8ff15d3de70fdcd0750a7ee03701a6 /apps | |
parent | 921ffe7111813804feee69047a2461328b930901 (diff) | |
download | rockbox-6d2e7769e2bafead0e6c8826c465ce0bbbb065ee.tar.gz rockbox-6d2e7769e2bafead0e6c8826c465ce0bbbb065ee.zip |
Better boost calculation for multifrequency CPUs. Frequencies between minimum and maximum count as fractional boost.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29115 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/debug_menu.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index d0b919fea3..2d356ab573 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -272,13 +272,18 @@ static bool dbg_audio_thread(void) | |||
272 | } | 272 | } |
273 | #endif /* !SIMULATOR */ | 273 | #endif /* !SIMULATOR */ |
274 | #else /* CONFIG_CODEC == SWCODEC */ | 274 | #else /* CONFIG_CODEC == SWCODEC */ |
275 | static unsigned int ticks, boost_ticks, freq_sum; | 275 | static unsigned int ticks, freq_sum; |
276 | #ifndef CPU_MULTI_FREQUENCY | ||
277 | static unsigned int boost_ticks; | ||
278 | #endif | ||
276 | 279 | ||
277 | static void dbg_audio_task(void) | 280 | static void dbg_audio_task(void) |
278 | { | 281 | { |
279 | #ifdef CPUFREQ_NORMAL | 282 | #ifdef CPUFREQ_NORMAL |
283 | #ifndef CPU_MULTI_FREQUENCY | ||
280 | if(FREQ > CPUFREQ_NORMAL) | 284 | if(FREQ > CPUFREQ_NORMAL) |
281 | boost_ticks++; | 285 | boost_ticks++; |
286 | #endif | ||
282 | freq_sum += FREQ/1000000; /* in MHz */ | 287 | freq_sum += FREQ/1000000; /* in MHz */ |
283 | #endif | 288 | #endif |
284 | ticks++; | 289 | ticks++; |
@@ -296,7 +301,10 @@ static bool dbg_buffering_thread(void) | |||
296 | size_t filebuflen = audio_get_filebuflen(); | 301 | size_t filebuflen = audio_get_filebuflen(); |
297 | /* This is a size_t, but call it a long so it puts a - when it's bad. */ | 302 | /* This is a size_t, but call it a long so it puts a - when it's bad. */ |
298 | 303 | ||
299 | ticks = boost_ticks = freq_sum = 0; | 304 | #ifndef CPU_MULTI_FREQUENCY |
305 | boost_ticks = 0; | ||
306 | #endif | ||
307 | ticks = freq_sum = 0; | ||
300 | 308 | ||
301 | tick_add_task(dbg_audio_task); | 309 | tick_add_task(dbg_audio_task); |
302 | 310 | ||
@@ -378,8 +386,13 @@ static bool dbg_buffering_thread(void) | |||
378 | 386 | ||
379 | if (ticks > 0) | 387 | if (ticks > 0) |
380 | { | 388 | { |
381 | int boostquota = boost_ticks * 1000 / ticks; /* in 0.1 % */ | ||
382 | int avgclock = freq_sum * 10 / ticks; /* in 100 kHz */ | 389 | int avgclock = freq_sum * 10 / ticks; /* in 100 kHz */ |
390 | #ifdef CPU_MULTI_FREQUENCY | ||
391 | int boostquota = (avgclock * 100 - CPUFREQ_NORMAL/1000) / | ||
392 | ((CPUFREQ_MAX - CPUFREQ_NORMAL) / 1000000); /* in 0.1 % */ | ||
393 | #else | ||
394 | int boostquota = boost_ticks * 1000 / ticks; /* in 0.1 % */ | ||
395 | #endif | ||
383 | screens[i].putsf(0, line++, "boost:%3d.%d%% (%d.%dMHz)", | 396 | screens[i].putsf(0, line++, "boost:%3d.%d%% (%d.%dMHz)", |
384 | boostquota/10, boostquota%10, avgclock/10, avgclock%10); | 397 | boostquota/10, boostquota%10, avgclock/10, avgclock%10); |
385 | } | 398 | } |