Skip to content
Browse files

Back off overlay frame rate when all timing tests have fired (saves CPU)

Closes #225 github issue (Jay Freeman).
  • Loading branch information...
1 parent 9cf87d2 commit b127a92617b7c84859eae4b511d99852db13ae1e @keithw keithw committed Apr 19, 2012
Showing with 9 additions and 2 deletions.
  1. +4 −2 src/frontend/terminaloverlay.cc
  2. +5 −0 src/frontend/terminaloverlay.h
View
6 src/frontend/terminaloverlay.cc
@@ -285,8 +285,10 @@ int OverlayManager::wait_time( void )
next_expiry = 1000;
}
- if ( predictions.active() && ( next_expiry > 20 ) ) {
- next_expiry = 20;
+ if ( predictions.timing_tests_necessary()
+ && predictions.active()
+ && ( next_expiry > 50 ) ) {
+ next_expiry = 50;
}
return next_expiry;
View
5 src/frontend/terminaloverlay.h
@@ -214,6 +214,11 @@ namespace Overlay {
bool active( void ) const;
+ bool timing_tests_necessary( void ) const {
+ /* Are there any timing-based triggers that haven't fired yet? */
+ return !( glitch_trigger && flagging );
+ }
+
void set_local_frame_sent( uint64_t x ) { local_frame_sent = x; }
void set_local_frame_acked( uint64_t x ) { local_frame_acked = x; }
void set_local_frame_late_acked( uint64_t x ) { local_frame_late_acked = x; }

0 comments on commit b127a92

Please sign in to comment.
Something went wrong with that request. Please try again.