summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-11 22:47:28 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-11 22:47:28 +0100
commita2c1e59cb5ecd15906e48a5665da0789e2148df0 (patch)
tree60b2d8eb6be55cf941d9615cb69f3c76b30c92d9 /src/modules
parent67da43ee363449b93676f8708ecfb1477bff0d8d (diff)
cpufreq - pstate - support incr of 5 percent to allow for better control
some intel cpu's only go down to 20%, some down to 10% min state.... so let's do this in lots of 5% to allow for some future cpu's. now it's not just 0, 25, 50, 75, 100 it's worth making it a real loop to save on code too. this allows me to actually control the cpu's i see at the detail level i see they can be controlled at.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/cpufreq/e_mod_main.c66
1 files changed, 34 insertions, 32 deletions
diff --git a/src/modules/cpufreq/e_mod_main.c b/src/modules/cpufreq/e_mod_main.c
index f4ba259..b66b365 100644
--- a/src/modules/cpufreq/e_mod_main.c
+++ b/src/modules/cpufreq/e_mod_main.c
@@ -338,45 +338,47 @@ _button_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNU
338 338
339 if (cpufreq_config->status->pstate) 339 if (cpufreq_config->status->pstate)
340 { 340 {
341 int set; 341 int set, pc;
342 342
343 mo = e_menu_new(); 343 mo = e_menu_new();
344 cpufreq_config->menu_pstate1 = mo; 344 cpufreq_config->menu_pstate1 = mo;
345
346 set = 0; 345 set = 0;
347#define VALMIN(_n) \ 346 for (pc = 0; pc <= 100; pc += 5)
348 mi = e_menu_item_new(mo); \ 347 {
349 e_menu_item_label_set(mi, #_n); \ 348 mi = e_menu_item_new(mo);
350 e_menu_item_radio_set(mi, 1); \ 349 snprintf(buf, sizeof(buf), "%i", pc);
351 e_menu_item_radio_group_set(mi, 1); \ 350 e_menu_item_label_set(mi, buf);
352 if ((!set) && (cpufreq_config->status->pstate_min <= _n)) \ 351 e_menu_item_radio_set(mi, 1);
353 { set = 1; e_menu_item_toggle_set(mi, 1); } \ 352 e_menu_item_radio_group_set(mi, 1);
354 e_menu_item_callback_set(mi, _cpufreq_menu_pstate_min, (void *)_n) 353 if ((!set) && (cpufreq_config->status->pstate_min <= pc))
355 VALMIN(0); 354 {
356 VALMIN(25); 355 set = 1;
357 VALMIN(50); 356 e_menu_item_toggle_set(mi, 1);
358 VALMIN(75); 357 }
359 VALMIN(100); 358 e_menu_item_callback_set(mi, _cpufreq_menu_pstate_min,
360 359 (void *)(intptr_t)pc);
360 }
361
361 mo = e_menu_new(); 362 mo = e_menu_new();
362 cpufreq_config->menu_pstate2 = mo; 363 cpufreq_config->menu_pstate2 = mo;
363
364 set = 0; 364 set = 0;
365#define VALMAX(_n) \ 365 for (pc = 0; pc <= 100; pc += 5)
366 mi = e_menu_item_new(mo); \ 366 {
367 e_menu_item_label_set(mi, #_n); \ 367 mi = e_menu_item_new(mo);
368 e_menu_item_radio_set(mi, 1); \ 368 snprintf(buf, sizeof(buf), "%i", pc);
369 e_menu_item_radio_group_set(mi, 1); \ 369 e_menu_item_label_set(mi, buf);
370 if ((!set) && (cpufreq_config->status->pstate_max <= _n)) \ 370 e_menu_item_radio_set(mi, 1);
371 { set = 1; e_menu_item_toggle_set(mi, 1); } \ 371 e_menu_item_radio_group_set(mi, 1);
372 e_menu_item_callback_set(mi, _cpufreq_menu_pstate_max, (void *)_n) 372 if ((!set) && (cpufreq_config->status->pstate_max <= pc))
373 VALMAX(5); 373 {
374 VALMAX(25); 374 set = 1;
375 VALMAX(50); 375 e_menu_item_toggle_set(mi, 1);
376 VALMAX(75); 376 }
377 VALMAX(100); 377 e_menu_item_callback_set(mi, _cpufreq_menu_pstate_max,
378 (void *)(intptr_t)pc);
379 }
378 } 380 }
379 381
380 mg = e_menu_new(); 382 mg = e_menu_new();
381 mi = e_menu_item_new(mg); 383 mi = e_menu_item_new(mg);
382 e_menu_item_label_set(mi, _("Time Between Updates")); 384 e_menu_item_label_set(mi, _("Time Between Updates"));