discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=a0619c548174c26a16364e329f78d38810225cd5

commit a0619c548174c26a16364e329f78d38810225cd5
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Jul 28 13:49:31 2017 -0400

    partially revert "add new powersave features for supporting a live sleep 
mode"
    
    ref 7caf5c8ff40ef0f2423f7f80a83686f56a331f80
    
    this makes the cpufreq gadget consume >100% cpu at all times when anything 
above
    normal polling speed is selected
---
 src/modules/cpufreq/e_mod_main.c | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/src/modules/cpufreq/e_mod_main.c b/src/modules/cpufreq/e_mod_main.c
index 058143079..65e168db6 100644
--- a/src/modules/cpufreq/e_mod_main.c
+++ b/src/modules/cpufreq/e_mod_main.c
@@ -1154,9 +1154,7 @@ _cpufreq_event_cb_powersave(void *data EINA_UNUSED, int 
type, void *event)
              break;
           }
 
-        // fallthrough is intended
       case E_POWERSAVE_MODE_EXTREME:
-      default:
         if (has_powersave)
           _cpufreq_set_governor("powersave");
         break;
@@ -1283,7 +1281,6 @@ typedef struct _Thread_Config Thread_Config;
 struct _Thread_Config
 {
    int interval;
-   E_Powersave_Sleeper *sleeper;
 };
 
 static void
@@ -1301,8 +1298,9 @@ _cpufreq_cb_frequency_check_main(void *data, Ecore_Thread 
*th)
         else
           _cpufreq_status_free(status);
         if (ecore_thread_check(th)) break;
-        e_powersave_sleeper_sleep(thc->sleeper, thc->interval);
+        usleep((1000000.0 / 8.0) * (double)thc->interval);
      }
+   free(thc);
 }
 
 static void
@@ -1362,15 +1360,6 @@ _cpufreq_cb_frequency_check_notify(void *data 
EINA_UNUSED,
      }
 }
 
-static void
-_cpufreq_cb_frequency_check_done(void *data,
-                                 Ecore_Thread *th EINA_UNUSED)
-{
-   Thread_Config *thc = data;
-   e_powersave_sleeper_free(thc->sleeper);
-   free(thc);
-}
-
 void
 _cpufreq_poll_interval_update(void)
 {
@@ -1385,13 +1374,10 @@ _cpufreq_poll_interval_update(void)
    if (thc)
      {
         thc->interval = cpufreq_config->poll_interval;
-        thc->sleeper = e_powersave_sleeper_new();
         cpufreq_config->frequency_check_thread =
           ecore_thread_feedback_run(_cpufreq_cb_frequency_check_main,
                                     _cpufreq_cb_frequency_check_notify,
-                                    _cpufreq_cb_frequency_check_done,
-                                    _cpufreq_cb_frequency_check_done,
-                                    thc, EINA_TRUE);
+                                    NULL, NULL, thc, EINA_TRUE);
      }
    e_config_save_queue();
 }

-- 


Reply via email to