diff options
Diffstat (limited to 'apps/action.c')
-rw-r--r-- | apps/action.c | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/apps/action.c b/apps/action.c index 286d4f39b3..30277dc3a6 100644 --- a/apps/action.c +++ b/apps/action.c | |||
@@ -181,38 +181,6 @@ static inline int get_next_context(const struct button_mapping *items, int i) | |||
181 | items[i].action_code; | 181 | items[i].action_code; |
182 | } | 182 | } |
183 | 183 | ||
184 | #if defined(HAVE_GUI_BOOST) && defined(HAVE_ADJUSTABLE_CPU_FREQ) | ||
185 | |||
186 | /* Timeout for gui boost in seconds. */ | ||
187 | #define GUI_BOOST_TIMEOUT (HZ) | ||
188 | |||
189 | /* Helper function which is called to boost / unboost CPU. This function | ||
190 | * avoids to increase boost_count with each call of gui_boost(). */ | ||
191 | static void gui_boost(bool want_to_boost) | ||
192 | { | ||
193 | static bool boosted = false; | ||
194 | |||
195 | if (want_to_boost && !boosted) | ||
196 | { | ||
197 | cpu_boost(true); | ||
198 | boosted = true; | ||
199 | } | ||
200 | else if (!want_to_boost && boosted) | ||
201 | { | ||
202 | cpu_boost(false); | ||
203 | boosted = false; | ||
204 | } | ||
205 | } | ||
206 | |||
207 | /* gui_unboost_callback() is called GUI_BOOST_TIMEOUT seconds after the | ||
208 | * last wheel scrolling event. */ | ||
209 | static int gui_unboost_callback(struct timeout *tmo) | ||
210 | { | ||
211 | (void)tmo; | ||
212 | gui_boost(false); | ||
213 | return 0; | ||
214 | } | ||
215 | #endif | ||
216 | 184 | ||
217 | /* | 185 | /* |
218 | * int get_action_worker(int context, int timeout, bool *is_pre_button, | 186 | * int get_action_worker(int context, int timeout, bool *is_pre_button, |
@@ -242,23 +210,7 @@ static int get_action_worker(int context, int timeout, bool *is_pre_button, | |||
242 | 210 | ||
243 | send_event(GUI_EVENT_ACTIONUPDATE, NULL); | 211 | send_event(GUI_EVENT_ACTIONUPDATE, NULL); |
244 | 212 | ||
245 | if (timeout == TIMEOUT_NOBLOCK) | 213 | button = button_get_w_tmo(timeout); |
246 | button = button_get(false); | ||
247 | else if (timeout == TIMEOUT_BLOCK) | ||
248 | button = button_get(true); | ||
249 | else | ||
250 | button = button_get_w_tmo(timeout); | ||
251 | |||
252 | #if defined(HAVE_GUI_BOOST) && defined(HAVE_ADJUSTABLE_CPU_FREQ) | ||
253 | static struct timeout gui_unboost; | ||
254 | /* Boost the CPU in case of wheel scrolling activity in the defined contexts. | ||
255 | * Call unboost with a timeout of GUI_BOOST_TIMEOUT. */ | ||
256 | if (button != BUTTON_NONE) | ||
257 | { | ||
258 | gui_boost(true); | ||
259 | timeout_register(&gui_unboost, gui_unboost_callback, GUI_BOOST_TIMEOUT, 0); | ||
260 | } | ||
261 | #endif | ||
262 | 214 | ||
263 | /* Data from sys events can be pulled with button_get_data | 215 | /* Data from sys events can be pulled with button_get_data |
264 | * multimedia button presses don't go through the action system */ | 216 | * multimedia button presses don't go through the action system */ |