enforce pstate's extremely-confusing no_turbo option in cpufreq
authorMike Blumenkrantz <zmike@osg.samsung.com>
Mon, 29 Jun 2015 20:38:17 +0000 (16:38 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Mon, 29 Jun 2015 20:38:17 +0000 (16:38 -0400)
fix T2411

src/modules/cpufreq/e_mod_config.c
src/modules/cpufreq/e_mod_main.c
src/modules/cpufreq/e_mod_main.h

index fe7df18..d9c3d09 100644 (file)
@@ -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;
 }
index 04a394d..5c42a09 100644 (file)
@@ -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);
index 695e478..b4b7717 100644 (file)
@@ -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;