forked from enlightenment/enlightenment
enforce pstate's extremely-confusing no_turbo option in cpufreq
fix T2411
This commit is contained in:
parent
79ea175992
commit
82a320404c
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue