forked from enlightenment/enlightenment
partially revert "add new powersave features for supporting a live sleep mode"
ref 7caf5c8ff4
this makes the cpufreq gadget consume >100% cpu at all times when anything above
normal polling speed is selected
This commit is contained in:
parent
2f2075f588
commit
a0619c5481
|
@ -1154,9 +1154,7 @@ _cpufreq_event_cb_powersave(void *data EINA_UNUSED, int type, void *event)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fallthrough is intended
|
|
||||||
case E_POWERSAVE_MODE_EXTREME:
|
case E_POWERSAVE_MODE_EXTREME:
|
||||||
default:
|
|
||||||
if (has_powersave)
|
if (has_powersave)
|
||||||
_cpufreq_set_governor("powersave");
|
_cpufreq_set_governor("powersave");
|
||||||
break;
|
break;
|
||||||
|
@ -1283,7 +1281,6 @@ typedef struct _Thread_Config Thread_Config;
|
||||||
struct _Thread_Config
|
struct _Thread_Config
|
||||||
{
|
{
|
||||||
int interval;
|
int interval;
|
||||||
E_Powersave_Sleeper *sleeper;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1301,8 +1298,9 @@ _cpufreq_cb_frequency_check_main(void *data, Ecore_Thread *th)
|
||||||
else
|
else
|
||||||
_cpufreq_status_free(status);
|
_cpufreq_status_free(status);
|
||||||
if (ecore_thread_check(th)) break;
|
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
|
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
|
void
|
||||||
_cpufreq_poll_interval_update(void)
|
_cpufreq_poll_interval_update(void)
|
||||||
{
|
{
|
||||||
|
@ -1385,13 +1374,10 @@ _cpufreq_poll_interval_update(void)
|
||||||
if (thc)
|
if (thc)
|
||||||
{
|
{
|
||||||
thc->interval = cpufreq_config->poll_interval;
|
thc->interval = cpufreq_config->poll_interval;
|
||||||
thc->sleeper = e_powersave_sleeper_new();
|
|
||||||
cpufreq_config->frequency_check_thread =
|
cpufreq_config->frequency_check_thread =
|
||||||
ecore_thread_feedback_run(_cpufreq_cb_frequency_check_main,
|
ecore_thread_feedback_run(_cpufreq_cb_frequency_check_main,
|
||||||
_cpufreq_cb_frequency_check_notify,
|
_cpufreq_cb_frequency_check_notify,
|
||||||
_cpufreq_cb_frequency_check_done,
|
NULL, NULL, thc, EINA_TRUE);
|
||||||
_cpufreq_cb_frequency_check_done,
|
|
||||||
thc, EINA_TRUE);
|
|
||||||
}
|
}
|
||||||
e_config_save_queue();
|
e_config_save_queue();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue