discomfitor pushed a commit to branch master.

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

commit 82a320404c16a12f28948276b5728353e6b6ad02
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Mon Jun 29 16:38:17 2015 -0400

    enforce pstate's extremely-confusing no_turbo option in cpufreq
    
    fix T2411
---
 src/modules/cpufreq/e_mod_config.c |  2 +-
 src/modules/cpufreq/e_mod_main.c   | 18 +++++++++++-------
 src/modules/cpufreq/e_mod_main.h   |  2 +-
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/modules/cpufreq/e_mod_config.c 
b/src/modules/cpufreq/e_mod_config.c
index fe7df18..d9c3d09 100644
--- a/src/modules/cpufreq/e_mod_config.c
+++ b/src/modules/cpufreq/e_mod_config.c
@@ -142,7 +142,7 @@ _basic_apply_data(E_Config_Dialog *cfd EINA_UNUSED, 
E_Config_Dialog_Data *cfdata
    if (cpufreq_config->pstate_min > cpufreq_config->pstate_max)
      cpufreq_config->pstate_min = cpufreq_config->pstate_max;
    _cpufreq_set_pstate(cpufreq_config->pstate_min - 1,
-                       cpufreq_config->pstate_max - 1, 1);
+                       cpufreq_config->pstate_max - 1);
    e_config_save_queue();
    return 1;
 }
diff --git a/src/modules/cpufreq/e_mod_main.c b/src/modules/cpufreq/e_mod_main.c
index 04a394d..5c42a09 100644
--- a/src/modules/cpufreq/e_mod_main.c
+++ b/src/modules/cpufreq/e_mod_main.c
@@ -566,13 +566,13 @@ _cpufreq_set_frequency(int frequency)
 }
 
 void
-_cpufreq_set_pstate(int min, int max, int turbo)
+_cpufreq_set_pstate(int min, int max)
 {
    char buf[4096];
    int ret;
 
    snprintf(buf, sizeof(buf),
-            "%s %s %i %i %i", cpufreq_config->set_exe_path, "pstate", min, 
max, turbo);
+            "%s %s %i %i %i", cpufreq_config->set_exe_path, "pstate", min, 
max, cpufreq_config->status->pstate_turbo);
    ret = system(buf);
    if (ret != 0)
      {
@@ -597,6 +597,7 @@ _cpufreq_cb_check(void *data EINA_UNUSED)
    Instance *inst;
    Eina_List *l;
    int active;
+   static Eina_Bool init_set = EINA_FALSE;
 
    if (cpufreq_config->menu_poll) return ECORE_CALLBACK_RENEW;
    active = cpufreq_config->status->active;
@@ -619,6 +620,12 @@ _cpufreq_cb_check(void *data EINA_UNUSED)
                edje_object_signal_emit(inst->o_cpu, "e,state,enabled", "e");
           }
      }
+   if (!init_set)
+     {
+        _cpufreq_set_pstate(cpufreq_config->pstate_min - 1,
+                            cpufreq_config->pstate_max - 1);
+        init_set = 1;
+     }
 
    return ECORE_CALLBACK_RENEW;
 }
@@ -1277,7 +1284,7 @@ _cpufreq_menu_pstate_min(void *data, E_Menu *m 
EINA_UNUSED, E_Menu_Item *mi EINA
    if (cpufreq_config->pstate_max < cpufreq_config->pstate_min)
      cpufreq_config->pstate_max = cpufreq_config->pstate_min;
    _cpufreq_set_pstate(cpufreq_config->pstate_min - 1,
-                       cpufreq_config->pstate_max - 1, 1);
+                       cpufreq_config->pstate_max - 1);
    e_config_save_queue();
 }
 
@@ -1289,7 +1296,7 @@ _cpufreq_menu_pstate_max(void *data, E_Menu *m 
EINA_UNUSED, E_Menu_Item *mi EINA
    if (cpufreq_config->pstate_min > cpufreq_config->pstate_max)
      cpufreq_config->pstate_min = cpufreq_config->pstate_max;
    _cpufreq_set_pstate(cpufreq_config->pstate_min - 1, 
-                       cpufreq_config->pstate_max - 1, 1);
+                       cpufreq_config->pstate_max - 1);
    e_config_save_queue();
 }
 
@@ -1399,9 +1406,6 @@ e_modapi_init(E_Module *m)
           }
      }
 
-   _cpufreq_set_pstate(cpufreq_config->pstate_min - 1, 
-                       cpufreq_config->pstate_max - 1, 1);
-
    cpufreq_config->module = m;
 
    e_gadcon_provider_register(&_gadcon_class);
diff --git a/src/modules/cpufreq/e_mod_main.h b/src/modules/cpufreq/e_mod_main.h
index 695e478..b4b7717 100644
--- a/src/modules/cpufreq/e_mod_main.h
+++ b/src/modules/cpufreq/e_mod_main.h
@@ -63,7 +63,7 @@ E_API int   e_modapi_save     (E_Module *m);
 E_Config_Dialog *e_int_config_cpufreq_module(Evas_Object *parent, const char 
*params);
 void _cpufreq_poll_interval_update(void);
 void _cpufreq_set_governor(const char *governor);
-void _cpufreq_set_pstate(int min, int max, int turbo);
+void _cpufreq_set_pstate(int min, int max);
 
 extern Config *cpufreq_config;
 

-- 


Reply via email to