Finally submit GUI boost (FS#8668). With this change the CPU is boosted (with a 1 second timeout) on scrollwheel activity in the list, main menu, tree and std context. For now GUI boost is only enabled on scrollwheel targets. The code can easily be enhanced to work with other targets as well.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30967 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andree Buschmann 2011-11-11 19:40:32 +00:00
parent 312b2a2de7
commit f1ee740f2b
16 changed files with 83 additions and 0 deletions

View file

@ -149,6 +149,27 @@ static inline int get_next_context(const struct button_mapping *items, int i)
CONTEXT_STD : CONTEXT_STD :
items[i].action_code; items[i].action_code;
} }
#if defined(HAVE_GUI_BOOST) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
/* Helper function which is called to boost / unboost CPU. This function
* avoids to increase boost_count with each call of gui_boost(). */
static void gui_boost(bool want_to_boost)
{
static bool boosted = false;
if (want_to_boost && !boosted)
{
cpu_boost(true);
boosted = true;
}
else if (!want_to_boost && boosted)
{
cpu_boost(false);
boosted = false;
}
}
#endif
/* /*
* int get_action_worker(int context, struct button_mapping *user_mappings, * int get_action_worker(int context, struct button_mapping *user_mappings,
int timeout) int timeout)
@ -183,6 +204,23 @@ static int get_action_worker(int context, int timeout,
else else
button = button_get_w_tmo(timeout); button = button_get_w_tmo(timeout);
#if defined(HAVE_GUI_BOOST) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
/* Boost the CPU in case of wheel scrolling activity in the defined contexts.
* Unboost the CPU after timeout. */
static long last_boost_tick;
if ((button&(BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD)) &&
(context == CONTEXT_STD || context == CONTEXT_LIST ||
context == CONTEXT_MAINMENU || context == CONTEXT_TREE))
{
last_boost_tick = current_tick;
gui_boost(true);
}
else if (TIME_AFTER(current_tick, last_boost_tick + HZ))
{
gui_boost(false);
}
#endif
/* Data from sys events can be pulled with button_get_data /* Data from sys events can be pulled with button_get_data
* multimedia button presses don't go through the action system */ * multimedia button presses don't go through the action system */
if (button == BUTTON_NONE || button & (SYS_EVENT|BUTTON_MULTIMEDIA)) if (button == BUTTON_NONE || button & (SYS_EVENT|BUTTON_MULTIMEDIA))

View file

@ -78,6 +78,9 @@
#define CONFIG_KEYPAD IPOD_1G2G_PAD #define CONFIG_KEYPAD IPOD_1G2G_PAD
/* Define this to have CPU boosted while scrolling in the UI */
#define HAVE_GUI_BOOST
/* define this if the unit uses a scrollwheel for navigation */ /* define this if the unit uses a scrollwheel for navigation */
#define HAVE_SCROLLWHEEL #define HAVE_SCROLLWHEEL
/* define to activate advanced wheel acceleration code */ /* define to activate advanced wheel acceleration code */

View file

@ -79,6 +79,9 @@
#define CONFIG_KEYPAD IPOD_3G_PAD #define CONFIG_KEYPAD IPOD_3G_PAD
/* Define this to have CPU boosted while scrolling in the UI */
#define HAVE_GUI_BOOST
/* define this if the unit uses a scrollwheel for navigation */ /* define this if the unit uses a scrollwheel for navigation */
#define HAVE_SCROLLWHEEL #define HAVE_SCROLLWHEEL
/* define to activate advanced wheel acceleration code */ /* define to activate advanced wheel acceleration code */

View file

@ -79,6 +79,9 @@
#define CONFIG_KEYPAD IPOD_4G_PAD #define CONFIG_KEYPAD IPOD_4G_PAD
/* Define this to have CPU boosted while scrolling in the UI */
#define HAVE_GUI_BOOST
/* Define this to enable morse code input */ /* Define this to enable morse code input */
#define HAVE_MORSE_INPUT #define HAVE_MORSE_INPUT

View file

@ -100,6 +100,9 @@
#define CONFIG_KEYPAD IPOD_4G_PAD #define CONFIG_KEYPAD IPOD_4G_PAD
/* Define this to have CPU boosted while scrolling in the UI */
#define HAVE_GUI_BOOST
//#define AB_REPEAT_ENABLE //#define AB_REPEAT_ENABLE
//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE //#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE

View file

@ -66,6 +66,9 @@
#define CONFIG_KEYPAD IPOD_4G_PAD #define CONFIG_KEYPAD IPOD_4G_PAD
/* Define this to have CPU boosted while scrolling in the UI */
#define HAVE_GUI_BOOST
/* Define this to enable morse code input */ /* Define this to enable morse code input */
#define HAVE_MORSE_INPUT #define HAVE_MORSE_INPUT

View file

@ -78,6 +78,9 @@
#define CONFIG_KEYPAD IPOD_4G_PAD #define CONFIG_KEYPAD IPOD_4G_PAD
/* Define this to have CPU boosted while scrolling in the UI */
#define HAVE_GUI_BOOST
#define HAVE_SCROLLWHEEL #define HAVE_SCROLLWHEEL
/* define to activate advanced wheel acceleration code */ /* define to activate advanced wheel acceleration code */
#define HAVE_WHEEL_ACCELERATION #define HAVE_WHEEL_ACCELERATION

View file

@ -78,6 +78,9 @@
#define CONFIG_KEYPAD IPOD_4G_PAD #define CONFIG_KEYPAD IPOD_4G_PAD
/* Define this to have CPU boosted while scrolling in the UI */
#define HAVE_GUI_BOOST
/* Define this to enable morse code input */ /* Define this to enable morse code input */
#define HAVE_MORSE_INPUT #define HAVE_MORSE_INPUT

View file

@ -69,6 +69,9 @@
#define CONFIG_KEYPAD IPOD_4G_PAD #define CONFIG_KEYPAD IPOD_4G_PAD
/* Define this to have CPU boosted while scrolling in the UI */
#define HAVE_GUI_BOOST
/* Define this to enable morse code input */ /* Define this to enable morse code input */
#define HAVE_MORSE_INPUT #define HAVE_MORSE_INPUT

View file

@ -104,6 +104,9 @@
#define CONFIG_KEYPAD IPOD_4G_PAD #define CONFIG_KEYPAD IPOD_4G_PAD
/* Define this to have CPU boosted while scrolling in the UI */
#define HAVE_GUI_BOOST
#define AB_REPEAT_ENABLE #define AB_REPEAT_ENABLE
#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE #define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE

View file

@ -65,6 +65,9 @@
#define CONFIG_KEYPAD IPOD_4G_PAD #define CONFIG_KEYPAD IPOD_4G_PAD
/* Define this to have CPU boosted while scrolling in the UI */
#define HAVE_GUI_BOOST
/* Define this to enable morse code input */ /* Define this to enable morse code input */
#define HAVE_MORSE_INPUT #define HAVE_MORSE_INPUT

View file

@ -78,6 +78,9 @@
#define CONFIG_KEYPAD SANSA_E200_PAD #define CONFIG_KEYPAD SANSA_E200_PAD
/* Define this to have CPU boosted while scrolling in the UI */
#define HAVE_GUI_BOOST
/* Define this to enable morse code input */ /* Define this to enable morse code input */
#define HAVE_MORSE_INPUT #define HAVE_MORSE_INPUT

View file

@ -76,6 +76,9 @@
/* Define this to enable morse code input */ /* Define this to enable morse code input */
#define HAVE_MORSE_INPUT #define HAVE_MORSE_INPUT
/* Define this to have CPU boosted while scrolling in the UI */
#define HAVE_GUI_BOOST
/* Define this if you do software codec */ /* Define this if you do software codec */
#define CONFIG_CODEC SWCODEC #define CONFIG_CODEC SWCODEC

View file

@ -77,6 +77,9 @@
#define CONFIG_KEYPAD SANSA_FUZE_PAD #define CONFIG_KEYPAD SANSA_FUZE_PAD
/* Define this to have CPU boosted while scrolling in the UI */
#define HAVE_GUI_BOOST
/* Define this to enable morse code input */ /* Define this to enable morse code input */
#define HAVE_MORSE_INPUT #define HAVE_MORSE_INPUT

View file

@ -88,6 +88,9 @@
#define CONFIG_KEYPAD SANSA_FUZE_PAD #define CONFIG_KEYPAD SANSA_FUZE_PAD
/* Define this to have CPU boosted while scrolling in the UI */
#define HAVE_GUI_BOOST
/* Define this to enable morse code input */ /* Define this to enable morse code input */
#define HAVE_MORSE_INPUT #define HAVE_MORSE_INPUT

View file

@ -74,6 +74,9 @@
/* The only difference is that the power/hold is on the left instead of right on Fuze */ /* The only difference is that the power/hold is on the left instead of right on Fuze */
#define CONFIG_KEYPAD SANSA_FUZE_PAD #define CONFIG_KEYPAD SANSA_FUZE_PAD
/* Define this to have CPU boosted while scrolling in the UI */
#define HAVE_GUI_BOOST
/* Define this to enable morse code input */ /* Define this to enable morse code input */
#define HAVE_MORSE_INPUT #define HAVE_MORSE_INPUT