diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/debug_menu.c | 16 | ||||
-rw-r--r-- | apps/main.c | 4 | ||||
-rw-r--r-- | apps/pcmbuf.c | 2 | ||||
-rw-r--r-- | apps/playback.c | 10 | ||||
-rw-r--r-- | apps/playlist.c | 12 | ||||
-rw-r--r-- | apps/tagcache.c | 14 | ||||
-rw-r--r-- | apps/tagtree.c | 16 | ||||
-rw-r--r-- | apps/talk.c | 4 | ||||
-rw-r--r-- | apps/tree.c | 8 |
9 files changed, 43 insertions, 43 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 70fc3ac46e..fa650739f5 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -1258,7 +1258,6 @@ bool dbg_ports(void) | |||
1258 | #endif /* !SIMULATOR */ | 1258 | #endif /* !SIMULATOR */ |
1259 | 1259 | ||
1260 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 1260 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
1261 | extern int boost_counter; | ||
1262 | bool dbg_cpufreq(void) | 1261 | bool dbg_cpufreq(void) |
1263 | { | 1262 | { |
1264 | char buf[128]; | 1263 | char buf[128]; |
@@ -1278,7 +1277,11 @@ bool dbg_cpufreq(void) | |||
1278 | snprintf(buf, sizeof(buf), "Frequency: %ld", FREQ); | 1277 | snprintf(buf, sizeof(buf), "Frequency: %ld", FREQ); |
1279 | lcd_puts(0, line++, buf); | 1278 | lcd_puts(0, line++, buf); |
1280 | 1279 | ||
1281 | snprintf(buf, sizeof(buf), "boost_counter: %d", boost_counter); | 1280 | #ifdef CPU_BOOST_TRACKING |
1281 | snprintf(buf, sizeof(buf), "boost_counter: %d %s", get_cpu_boost_counter(), get_cpu_boost_tracker()); | ||
1282 | #else | ||
1283 | snprintf(buf, sizeof(buf), "boost_counter: %d", get_cpu_boost_counter()); | ||
1284 | #endif | ||
1282 | lcd_puts(0, line++, buf); | 1285 | lcd_puts(0, line++, buf); |
1283 | 1286 | ||
1284 | lcd_update(); | 1287 | lcd_update(); |
@@ -1287,15 +1290,16 @@ bool dbg_cpufreq(void) | |||
1287 | switch(button) | 1290 | switch(button) |
1288 | { | 1291 | { |
1289 | case ACTION_STD_PREV: | 1292 | case ACTION_STD_PREV: |
1290 | cpu_boost(true); | 1293 | cpu_boost_id(true, CPUBOOSTID_DEBUGMENU_MANUAL); |
1291 | break; | 1294 | break; |
1295 | |||
1292 | case ACTION_STD_NEXT: | 1296 | case ACTION_STD_NEXT: |
1293 | cpu_boost(false); | 1297 | cpu_boost_id(false, CPUBOOSTID_DEBUGMENU_MANUAL); |
1294 | break; | 1298 | break; |
1295 | 1299 | ||
1296 | case ACTION_STD_OK: | 1300 | case ACTION_STD_OK: |
1297 | set_cpu_frequency(CPUFREQ_DEFAULT); | 1301 | while (get_cpu_boost_counter() > 0) |
1298 | boost_counter = 0; | 1302 | cpu_boost_id(false, CPUBOOSTID_DEBUGMENU_MANUAL); |
1299 | break; | 1303 | break; |
1300 | 1304 | ||
1301 | case ACTION_STD_CANCEL: | 1305 | case ACTION_STD_CANCEL: |
diff --git a/apps/main.c b/apps/main.c index a2bbe73e65..bd1dd7b03c 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -276,7 +276,7 @@ void init(void) | |||
276 | 276 | ||
277 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 277 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
278 | set_cpu_frequency(CPUFREQ_NORMAL); | 278 | set_cpu_frequency(CPUFREQ_NORMAL); |
279 | cpu_boost(true); | 279 | cpu_boost_id(true, CPUBOOSTID_MAININIT); |
280 | #endif | 280 | #endif |
281 | 281 | ||
282 | buffer_init(); | 282 | buffer_init(); |
@@ -482,7 +482,7 @@ void init(void) | |||
482 | #endif | 482 | #endif |
483 | 483 | ||
484 | /* runtime database has to be initialized after audio_init() */ | 484 | /* runtime database has to be initialized after audio_init() */ |
485 | cpu_boost(false); | 485 | cpu_boost_id(false, CPUBOOSTID_MAININIT); |
486 | 486 | ||
487 | #ifdef AUTOROCK | 487 | #ifdef AUTOROCK |
488 | { | 488 | { |
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index b4d9bcec4e..6d2f68a238 100644 --- a/apps/pcmbuf.c +++ b/apps/pcmbuf.c | |||
@@ -121,7 +121,7 @@ void pcmbuf_boost(bool state) | |||
121 | 121 | ||
122 | if (state != boost_state) | 122 | if (state != boost_state) |
123 | { | 123 | { |
124 | cpu_boost(state); | 124 | cpu_boost_id(state, CPUBOOSTID_PCMBUF); |
125 | boost_state = state; | 125 | boost_state = state; |
126 | } | 126 | } |
127 | 127 | ||
diff --git a/apps/playback.c b/apps/playback.c index 76f0788583..cb4900e1ae 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -822,7 +822,7 @@ static void voice_boost_cpu(bool state) | |||
822 | if (state != voice_cpu_boosted) | 822 | if (state != voice_cpu_boosted) |
823 | { | 823 | { |
824 | voice_cpu_boosted = state; | 824 | voice_cpu_boosted = state; |
825 | cpu_boost(state); | 825 | cpu_boost_id(state, CPUBOOSTID_PLAYBACK_VOICE); |
826 | } | 826 | } |
827 | } | 827 | } |
828 | #endif | 828 | #endif |
@@ -1676,7 +1676,7 @@ static bool codec_load_next_track(void) | |||
1676 | automatic_skip = true; | 1676 | automatic_skip = true; |
1677 | } | 1677 | } |
1678 | 1678 | ||
1679 | cpu_boost(true); | 1679 | cpu_boost_id(true, CPUBOOSTID_PLAYBACK_CODEC); |
1680 | LOGFQUEUE("codec > audio Q_AUDIO_CHECK_NEW_TRACK"); | 1680 | LOGFQUEUE("codec > audio Q_AUDIO_CHECK_NEW_TRACK"); |
1681 | queue_post(&audio_queue, Q_AUDIO_CHECK_NEW_TRACK, 0); | 1681 | queue_post(&audio_queue, Q_AUDIO_CHECK_NEW_TRACK, 0); |
1682 | while (1) | 1682 | while (1) |
@@ -1690,7 +1690,7 @@ static bool codec_load_next_track(void) | |||
1690 | else | 1690 | else |
1691 | break; | 1691 | break; |
1692 | } | 1692 | } |
1693 | cpu_boost(false); | 1693 | cpu_boost_id(false, CPUBOOSTID_PLAYBACK_CODEC); |
1694 | switch (ev.id) | 1694 | switch (ev.id) |
1695 | { | 1695 | { |
1696 | case Q_CODEC_REQUEST_COMPLETE: | 1696 | case Q_CODEC_REQUEST_COMPLETE: |
@@ -2177,7 +2177,7 @@ static void audio_read_file(bool quick) | |||
2177 | return ; | 2177 | return ; |
2178 | } | 2178 | } |
2179 | 2179 | ||
2180 | cpu_boost(true); | 2180 | cpu_boost_id(true, CPUBOOSTID_PLAYBACK_AUDIO); |
2181 | while (tracks[track_widx].filerem > 0) | 2181 | while (tracks[track_widx].filerem > 0) |
2182 | { | 2182 | { |
2183 | int overlap; | 2183 | int overlap; |
@@ -2245,7 +2245,7 @@ static void audio_read_file(bool quick) | |||
2245 | logf("Partially buf:%dB", | 2245 | logf("Partially buf:%dB", |
2246 | tracks[track_widx].filesize - tracks[track_widx].filerem); | 2246 | tracks[track_widx].filesize - tracks[track_widx].filerem); |
2247 | } | 2247 | } |
2248 | cpu_boost(false); | 2248 | cpu_boost_id(false, CPUBOOSTID_PLAYBACK_AUDIO); |
2249 | } | 2249 | } |
2250 | 2250 | ||
2251 | static bool audio_loadcodec(bool start_play) | 2251 | static bool audio_loadcodec(bool start_play) |
diff --git a/apps/playlist.c b/apps/playlist.c index 6648d4462e..9d844e3b84 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -2812,14 +2812,14 @@ int playlist_insert_directory(struct playlist_info* playlist, | |||
2812 | context.queue = queue; | 2812 | context.queue = queue; |
2813 | context.count = 0; | 2813 | context.count = 0; |
2814 | 2814 | ||
2815 | cpu_boost(true); | 2815 | cpu_boost_id(true, CPUBOOSTID_PLAYLIST); |
2816 | 2816 | ||
2817 | result = playlist_directory_tracksearch(dirname, recurse, | 2817 | result = playlist_directory_tracksearch(dirname, recurse, |
2818 | directory_search_callback, &context); | 2818 | directory_search_callback, &context); |
2819 | 2819 | ||
2820 | sync_control(playlist, false); | 2820 | sync_control(playlist, false); |
2821 | 2821 | ||
2822 | cpu_boost(false); | 2822 | cpu_boost_id(false, CPUBOOSTID_PLAYLIST); |
2823 | 2823 | ||
2824 | display_playlist_count(context.count, count_str); | 2824 | display_playlist_count(context.count, count_str); |
2825 | 2825 | ||
@@ -2881,7 +2881,7 @@ int playlist_insert_playlist(struct playlist_info* playlist, char *filename, | |||
2881 | 2881 | ||
2882 | display_playlist_count(count, count_str); | 2882 | display_playlist_count(count, count_str); |
2883 | 2883 | ||
2884 | cpu_boost(true); | 2884 | cpu_boost_id(true, CPUBOOSTID_PLAYLIST); |
2885 | 2885 | ||
2886 | while ((max = read_line(fd, temp_buf, sizeof(temp_buf))) > 0) | 2886 | while ((max = read_line(fd, temp_buf, sizeof(temp_buf))) > 0) |
2887 | { | 2887 | { |
@@ -2940,7 +2940,7 @@ int playlist_insert_playlist(struct playlist_info* playlist, char *filename, | |||
2940 | 2940 | ||
2941 | sync_control(playlist, false); | 2941 | sync_control(playlist, false); |
2942 | 2942 | ||
2943 | cpu_boost(false); | 2943 | cpu_boost_id(false, CPUBOOSTID_PLAYLIST); |
2944 | 2944 | ||
2945 | display_playlist_count(count, count_str); | 2945 | display_playlist_count(count, count_str); |
2946 | 2946 | ||
@@ -3287,7 +3287,7 @@ int playlist_save(struct playlist_info* playlist, char *filename) | |||
3287 | 3287 | ||
3288 | display_playlist_count(count, str(LANG_PLAYLIST_SAVE_COUNT)); | 3288 | display_playlist_count(count, str(LANG_PLAYLIST_SAVE_COUNT)); |
3289 | 3289 | ||
3290 | cpu_boost(true); | 3290 | cpu_boost_id(true, CPUBOOSTID_PLAYLIST); |
3291 | 3291 | ||
3292 | index = playlist->first_index; | 3292 | index = playlist->first_index; |
3293 | for (i=0; i<playlist->amount; i++) | 3293 | for (i=0; i<playlist->amount; i++) |
@@ -3380,7 +3380,7 @@ int playlist_save(struct playlist_info* playlist, char *filename) | |||
3380 | 3380 | ||
3381 | } | 3381 | } |
3382 | 3382 | ||
3383 | cpu_boost(false); | 3383 | cpu_boost_id(false, CPUBOOSTID_PLAYLIST); |
3384 | 3384 | ||
3385 | return result; | 3385 | return result; |
3386 | } | 3386 | } |
diff --git a/apps/tagcache.c b/apps/tagcache.c index 70934b4f36..1c180b7f43 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c | |||
@@ -3459,7 +3459,7 @@ static void build_tagcache(void) | |||
3459 | 3459 | ||
3460 | filenametag_fd = open_tag_fd(&header, tag_filename, false); | 3460 | filenametag_fd = open_tag_fd(&header, tag_filename, false); |
3461 | 3461 | ||
3462 | cpu_boost(true); | 3462 | cpu_boost_id(true, CPUBOOSTID_TAGCACHE); |
3463 | 3463 | ||
3464 | /* Scan for new files. */ | 3464 | /* Scan for new files. */ |
3465 | memset(&header, 0, sizeof(struct tagcache_header)); | 3465 | memset(&header, 0, sizeof(struct tagcache_header)); |
@@ -3485,7 +3485,7 @@ static void build_tagcache(void) | |||
3485 | if (!ret) | 3485 | if (!ret) |
3486 | { | 3486 | { |
3487 | logf("Aborted."); | 3487 | logf("Aborted."); |
3488 | cpu_boost(false); | 3488 | cpu_boost_id(false, CPUBOOSTID_TAGCACHE); |
3489 | return ; | 3489 | return ; |
3490 | } | 3490 | } |
3491 | 3491 | ||
@@ -3505,7 +3505,7 @@ static void build_tagcache(void) | |||
3505 | } | 3505 | } |
3506 | #endif | 3506 | #endif |
3507 | 3507 | ||
3508 | cpu_boost(false); | 3508 | cpu_boost_id(false, CPUBOOSTID_TAGCACHE); |
3509 | } | 3509 | } |
3510 | 3510 | ||
3511 | #ifdef HAVE_TC_RAMCACHE | 3511 | #ifdef HAVE_TC_RAMCACHE |
@@ -3514,7 +3514,7 @@ static void load_ramcache(void) | |||
3514 | if (!hdr) | 3514 | if (!hdr) |
3515 | return ; | 3515 | return ; |
3516 | 3516 | ||
3517 | cpu_boost(true); | 3517 | cpu_boost_id(true, CPUBOOSTID_TAGCACHE); |
3518 | 3518 | ||
3519 | /* At first we should load the cache (if exists). */ | 3519 | /* At first we should load the cache (if exists). */ |
3520 | stat.ramcache = load_tagcache(); | 3520 | stat.ramcache = load_tagcache(); |
@@ -3527,7 +3527,7 @@ static void load_ramcache(void) | |||
3527 | hdr = NULL; | 3527 | hdr = NULL; |
3528 | } | 3528 | } |
3529 | 3529 | ||
3530 | cpu_boost(false); | 3530 | cpu_boost_id(false, CPUBOOSTID_TAGCACHE); |
3531 | } | 3531 | } |
3532 | 3532 | ||
3533 | void tagcache_unload_ramcache(void) | 3533 | void tagcache_unload_ramcache(void) |
@@ -3572,7 +3572,7 @@ static void tagcache_thread(void) | |||
3572 | 3572 | ||
3573 | /* If the previous cache build/update was interrupted, commit | 3573 | /* If the previous cache build/update was interrupted, commit |
3574 | * the changes first in foreground. */ | 3574 | * the changes first in foreground. */ |
3575 | cpu_boost(true); | 3575 | cpu_boost_id(true, CPUBOOSTID_TAGCACHE); |
3576 | allocate_tempbuf(); | 3576 | allocate_tempbuf(); |
3577 | commit(); | 3577 | commit(); |
3578 | free_tempbuf(); | 3578 | free_tempbuf(); |
@@ -3590,7 +3590,7 @@ static void tagcache_thread(void) | |||
3590 | allocate_tagcache(); | 3590 | allocate_tagcache(); |
3591 | #endif | 3591 | #endif |
3592 | 3592 | ||
3593 | cpu_boost(false); | 3593 | cpu_boost_id(false, CPUBOOSTID_TAGCACHE); |
3594 | stat.initialized = true; | 3594 | stat.initialized = true; |
3595 | 3595 | ||
3596 | /* Don't delay bootup with the header check but do it on background. */ | 3596 | /* Don't delay bootup with the header check but do it on background. */ |
diff --git a/apps/tagtree.c b/apps/tagtree.c index 377cc27ec0..f9542821d8 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c | |||
@@ -1121,9 +1121,9 @@ int tagtree_load(struct tree_context* c) | |||
1121 | case allsubentries: | 1121 | case allsubentries: |
1122 | case navibrowse: | 1122 | case navibrowse: |
1123 | logf("navibrowse..."); | 1123 | logf("navibrowse..."); |
1124 | cpu_boost(true); | 1124 | cpu_boost_id(true, CPUBOOSTID_TAGTREE); |
1125 | count = retrieve_entries(c, &tcs, 0, true); | 1125 | count = retrieve_entries(c, &tcs, 0, true); |
1126 | cpu_boost(false); | 1126 | cpu_boost_id(false, CPUBOOSTID_TAGTREE); |
1127 | break; | 1127 | break; |
1128 | 1128 | ||
1129 | default: | 1129 | default: |
@@ -1297,11 +1297,11 @@ bool insert_all_playlist(struct tree_context *c, int position, bool queue) | |||
1297 | char buf[MAX_PATH]; | 1297 | char buf[MAX_PATH]; |
1298 | int from, to, direction; | 1298 | int from, to, direction; |
1299 | 1299 | ||
1300 | cpu_boost(true); | 1300 | cpu_boost_id(true, CPUBOOSTID_TAGTREE); |
1301 | if (!tagcache_search(&tcs, tag_filename)) | 1301 | if (!tagcache_search(&tcs, tag_filename)) |
1302 | { | 1302 | { |
1303 | gui_syncsplash(HZ, true, str(LANG_TAGCACHE_BUSY)); | 1303 | gui_syncsplash(HZ, true, str(LANG_TAGCACHE_BUSY)); |
1304 | cpu_boost(false); | 1304 | cpu_boost_id(false, CPUBOOSTID_TAGTREE); |
1305 | return false; | 1305 | return false; |
1306 | } | 1306 | } |
1307 | 1307 | ||
@@ -1338,7 +1338,7 @@ bool insert_all_playlist(struct tree_context *c, int position, bool queue) | |||
1338 | } | 1338 | } |
1339 | playlist_sync(NULL); | 1339 | playlist_sync(NULL); |
1340 | tagcache_search_finish(&tcs); | 1340 | tagcache_search_finish(&tcs); |
1341 | cpu_boost(false); | 1341 | cpu_boost_id(false, CPUBOOSTID_TAGTREE); |
1342 | 1342 | ||
1343 | return true; | 1343 | return true; |
1344 | } | 1344 | } |
@@ -1442,16 +1442,16 @@ struct tagentry* tagtree_get_entry(struct tree_context *c, int id) | |||
1442 | /* Load the next chunk if necessary. */ | 1442 | /* Load the next chunk if necessary. */ |
1443 | if (realid >= current_entry_count || realid < 0) | 1443 | if (realid >= current_entry_count || realid < 0) |
1444 | { | 1444 | { |
1445 | cpu_boost(true); | 1445 | cpu_boost_id(true, CPUBOOSTID_TAGTREE); |
1446 | if (retrieve_entries(c, &tcs2, MAX(0, id - (current_entry_count / 2)), | 1446 | if (retrieve_entries(c, &tcs2, MAX(0, id - (current_entry_count / 2)), |
1447 | false) < 0) | 1447 | false) < 0) |
1448 | { | 1448 | { |
1449 | logf("retrieve failed"); | 1449 | logf("retrieve failed"); |
1450 | cpu_boost(false); | 1450 | cpu_boost_id(false, CPUBOOSTID_TAGTREE); |
1451 | return NULL; | 1451 | return NULL; |
1452 | } | 1452 | } |
1453 | realid = id - current_offset; | 1453 | realid = id - current_offset; |
1454 | cpu_boost(false); | 1454 | cpu_boost_id(false, CPUBOOSTID_TAGTREE); |
1455 | } | 1455 | } |
1456 | 1456 | ||
1457 | return &entry[realid]; | 1457 | return &entry[realid]; |
diff --git a/apps/talk.c b/apps/talk.c index a92425d439..d03fead233 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -215,7 +215,7 @@ static void load_voicefile(void) | |||
215 | /* Do a bitswap as necessary. */ | 215 | /* Do a bitswap as necessary. */ |
216 | #if CONFIG_CODEC == SWCODEC | 216 | #if CONFIG_CODEC == SWCODEC |
217 | logf("Bitswapping voice file."); | 217 | logf("Bitswapping voice file."); |
218 | cpu_boost(true); | 218 | cpu_boost_id(true, CPUBOOSTID_TALK); |
219 | buf = (unsigned char *)(&p_voicefile->index) + | 219 | buf = (unsigned char *)(&p_voicefile->index) + |
220 | (p_voicefile->id1_max + p_voicefile->id2_max) * sizeof(struct clip_entry); | 220 | (p_voicefile->id1_max + p_voicefile->id2_max) * sizeof(struct clip_entry); |
221 | length = file_size - (buf - (unsigned char *) p_voicefile); | 221 | length = file_size - (buf - (unsigned char *) p_voicefile); |
@@ -227,7 +227,7 @@ static void load_voicefile(void) | |||
227 | temp = ((temp >> 2) & 0x33) | ((temp & 0x33) << 2); | 227 | temp = ((temp >> 2) & 0x33) | ((temp & 0x33) << 2); |
228 | buf[i] = ((temp >> 1) & 0x55) | ((temp & 0x55) << 1); | 228 | buf[i] = ((temp >> 1) & 0x55) | ((temp & 0x55) << 1); |
229 | } | 229 | } |
230 | cpu_boost(false); | 230 | cpu_boost_id(false, CPUBOOSTID_TALK); |
231 | 231 | ||
232 | #endif | 232 | #endif |
233 | 233 | ||
diff --git a/apps/tree.c b/apps/tree.c index b5673e681c..70b83f8934 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -1177,9 +1177,7 @@ bool create_playlist(void) | |||
1177 | if (fd < 0) | 1177 | if (fd < 0) |
1178 | return false; | 1178 | return false; |
1179 | 1179 | ||
1180 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 1180 | cpu_boost_id(true, CPUBOOSTID_TREE); |
1181 | cpu_boost(true); | ||
1182 | #endif | ||
1183 | 1181 | ||
1184 | snprintf(filename, sizeof(filename), "%s", | 1182 | snprintf(filename, sizeof(filename), "%s", |
1185 | tc.currdir[1] ? tc.currdir : "/"); | 1183 | tc.currdir[1] ? tc.currdir : "/"); |
@@ -1187,9 +1185,7 @@ bool create_playlist(void) | |||
1187 | add_dir(filename, sizeof(filename), fd); | 1185 | add_dir(filename, sizeof(filename), fd); |
1188 | close(fd); | 1186 | close(fd); |
1189 | 1187 | ||
1190 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 1188 | cpu_boost_id(false, CPUBOOSTID_TREE); |
1191 | cpu_boost(false); | ||
1192 | #endif | ||
1193 | 1189 | ||
1194 | sleep(HZ); | 1190 | sleep(HZ); |
1195 | 1191 | ||