-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCtrlConfig.h.in
637 lines (587 loc) · 12.9 KB
/
CtrlConfig.h.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
#ifndef CTRLCONFIG_H
#define CTRLCONFIG_H
#include <stdint.h>
/*DEFINE*/
${DEF_UNDEF_BUILD_SERVICE}
#define SHARED_MEMORY_RANDOM_BYTE "${RANDOM_BYTE}"
#define PRESET_NAME_LENGTH_TERMINATOR 17
#define LOG_FILE_SIZE_TRESHOLD_BYTES 10000000
#define PRESET_NAME {'P', 'r', 'e', 's', 'e', 't', ' ', 'N', 'a', 'm', 'e', '\0'}
#define UNKNOWN_PRESET_NAME {'U','n','k','n','o','w','n','\0'}
#define NEW_PRESET_NAME {'N', 'e', 'w', ' ', 'p', 'r', 'e', 's', 'e', 't', '\0'}
#define SAVER_PRESET_NAME {'B', 'a', 't', 't', 'e', 'r', 'y', ' ', 'S', 'a', 'v', 'e', 'r', '\0'}
#define BETTER_PRESET_NAME {'B', 'e', 't', 't', 'e', 'r', ' ', 'B', 'a', 't', 't', 'e', 'r', 'y', '\0'}
#define BALANCED_PRESET_NAME {'B', 'a', 'l', 'a', 'n', 'c', 'e', 'd', '\0'}
#define PERFOMANCE_PRESET_NAME {'P', 'e', 'r', 'f', 'o', 'm', 'a', 'n', 'c', 'e', '\0'}
#define GAMING_PRESET_NAME {'G', 'a', 'm', 'i', 'n', 'g', '\0'}
#ifdef WIN32
#define LOGFILE "Logs/RyzenCtrl.log"
#define LOGFILESERVICE "Logs/RyzenCtrl - Service.log"
#define LOGFILEGUI "Logs/RyzenCtrl - Gui.log"
#define CONFIGDIR "Config"
#define LOGDIR "Logs"
#define BUFFER_REFRESH_TIME_MS 10
#define AC_STATE_REFRESH_TIME 333
#define THERMAL_PATH L"\\\\.\\ATKACPI"
#define ATK_ACPI_WMIFUNCTION 0x22240c
#define CONFIG_FILE "Config/Config.xml"
#define PRESETS_FILE "Config/Presets.xml"
#endif // WIN32
#ifndef WIN32
#define LOGFILE "/var/tmp/RyzenCtrl.log"
#define LOGFILESERVICE "/var/tmp/RyzenCtrl - Service.log"
#define LOGFILEGUI "/tmp/RyzenCtrl - Gui.log"
#define CONFIGDIR "/etc/RyzenCtrl/"
#define LOGDIR "/var/tmp/"
#define AC_STATE_REFRESH_TIME 1332
#define THERMAL_PATH "/sys/devices/platform/faustus/throttle_thermal_policy"
#define CONFIG_FILE "/etc/RyzenCtrl/Config.xml"
#define PRESETS_FILE "/etc/RyzenCtrl/Presets.xml"
#endif // !WIN32
#if defined(BUILD_SERVICE) && !defined(WIN32)
#define INTERFACE_NAME "ru.ryzenctrl.service.ctrl"
#define SERVICE_NAME "ru.ryzenctrl.service"
#define GUI_NAME "ru.ryzenctrl.gui"
#define OBJECT_NAME "/control"
#define DBUS_CONFIG_FILE_NAME "ru.ryzenctrl.service.conf"
#define DBUS_CONFIG_FILE_PATH "/etc/dbus-1/system.d/ru.ryzenctrl.service.conf"
#endif //defined(BUILD_SERVICE) && !defined(WIN32)
/*ENUM*/
enum ACState {
Battery = 0,
ACPower,
ACNone
};
#ifdef WIN32
enum epmMode{
BatterySaver = 0,
BetterBattery,
Balanced,
MaxPerformance,
GameMode,
MixedReality,
epmNone
};
#endif // WIN32
/*STRUCT*/
struct presetStr {
int presetId = 0;
char presetName[PRESET_NAME_LENGTH_TERMINATOR] = PRESET_NAME;
int fanPresetId = 0;
int tempLimitValue = 85;
bool tempLimitChecked = false;
int apuSkinValue = 85;
bool apuSkinChecked = false;
int stampLimitValue = 25;
bool stampLimitChecked = false;
int fastLimitValue = 25;
bool fastLimitChecked = false;
int fastTimeValue = 900;
bool fastTimeChecked = false;
int slowLimitValue = 10;
bool slowLimitChecked = false;
int slowTimeValue = 60;
bool slowTimeChecked = false;
int vrmCurrentValue = 25;
bool vrmCurrentChecked = false;
int vrmMaxValue = 45;
bool vrmMaxChecked = false;
int minFclkValue = 800;
bool minFclkChecked = false;
int maxFclkValue = 1200;
bool maxFclkChecked = false;
int minGfxclkValue = 400;
bool minGfxclkChecked = false;
int maxGfxclkValue = 2200;
bool maxGfxclkChecked = false;
int minSocclkValue = 800;
bool minSocclkChecked = false;
int maxSocclkValue = 1200;
bool maxSocclkChecked = false;
int minVcnValue = 400;
bool minVcnChecked = false;
int maxVcnValue = 1200;
bool maxVcnChecked = false;
bool smuMaxPerfomance = false;
bool smuPowerSaving = false;
int vrmSocCurrent = 10;
bool vrmSocCurrentChecked = false;
int vrmSocMax = 13;
bool vrmSocMaxChecked = false;
int psi0Current = 13;
bool psi0CurrentChecked = false;
int psi0SocCurrent = 5;
bool psi0SocCurrentChecked = false;
int maxLclk = 1200;
bool maxLclkChecked = false;
int minLclk = 400;
bool minLclkChecked = false;
int prochotDeassertionRamp = 2;
bool prochotDeassertionRampChecked = false;
int dgpuSkinTempLimit = 85;
bool dgpuSkinTempLimitChecked = false;
int apuSlowLimit = 25;
bool apuSlowLimitChecked = false;
int skinTempPowerLimit = 25;
bool skinTempPowerLimitChecked = false;
/*new 0.8.3*/
int gfx_clk = 0;
bool gfx_clkChecked = false;
/*new 0.8.4*/
int vrmgfx_current = 0;
bool vrmgfx_currentChecked = false;
int vrmcvip_current = 0;
bool vrmcvip_currentChecked = false;
int vrmgfxmax_current = 0;
bool vrmgfxmax_currentChecked = false;
int psi3cpu_current = 0;
bool psi3cpu_currentChecked = false;
int psi3gfx_current = 0;
bool psi3gfx_currentChecked = false;
/*new 0.10.0*/
int oc_clk = 0;
bool oc_clkChecked = false;
int per_core_oc_clk = 0;
bool per_core_oc_clkChecked = false;
int oc_volt = 0;
bool oc_voltChecked = false;
bool disable_oc = false;
bool enable_oc = false;
/*new 0.11.0*/
int coall = 0;
bool coallChecked = false;
int coper = 0;
bool coperChecked = false;
int cogfx = 0;
bool cogfxChecked = false;
};
struct settingsStr {
bool useAgent = true;
bool showNotifications = true;
int lastUsedPMTableUpdateInterval = 100;
bool showNotificationToDisableAutoSwitcher = false;
bool autoPresetApplyDurationChecked = false;
int autoPresetApplyDuration = 180;
bool autoPresetSwitchAC = false;
int dcStatePresetId = 1;
int acStatePresetId = 2;
bool epmAutoPresetSwitch = false;
int epmBatterySaverPresetId = 0;
int epmBetterBatteryPresetId = 1;
int epmBalancedPresetId = 2;
int epmMaximumPerfomancePresetId = 3;
int epmGamingPresetId = 4;
bool hideNotSupportedVariables = false;
int apuFamilyIdx = 0;
bool showArmourPlugin = false;
};
struct hideShow {
bool shwStapmLimit = true;
bool shwFastLimit = true;
bool shwSlowLimit = true;
bool shwSlowTime = true;
bool shwStapmTime = true;
bool shwTctlTemp = true;
bool shwVrmCurrent = true;
bool shwVrmSocCurrent = true;
bool shwVrmMaxCurrent = true;
bool shwVrmSocMaxCurrent = true;
bool shwPsi0Current = true;
bool shwPsi0SocCurrent = true;
bool shwMaxSocclkFrequency = true;
bool shwMinSocclkFrequency = true;
bool shwMaxFclkFrequency = true;
bool shwMinFclkFrequency = true;
bool shwMaxVcn = true;
bool shwMinVcn = true;
bool shwMaxLclk = true;
bool shwMinLclk = true;
bool shwMaxGfxclk = true;
bool shwMinGfxclk = true;
bool shwProchotDeassertionRamp = true;
bool shwApuSkinTemp = true;
bool shwDgpuSkinTemp = true;
bool shwApuSlowLimit = true;
bool shwSkinTempLimit = true;
bool shwPowerSaving = true;
bool shwMaxPerformance = true;
/*new 0.8.3*/
bool show_gfx_clk = true;
/*new 0.8.4*/
bool show_vrmgfx_current = true;
bool show_vrmcvip_current = true;
bool show_vrmgfxmax_current = true;
bool show_psi3cpu_current = true;
bool show_psi3gfx_current = true;
/*new 0.10.0*/
bool show_oc_clk = true;
bool show_per_core_oc_clk = true;
bool show_oc_volt = true;
bool show_enable_oc = true;
/*new 0.11.0*/
bool show_coall= true;
bool show_coper = true;
bool show_cogfx = true;
};
struct messageToServiceStr{
bool exit = false;
bool getSettings = false;
bool saveSettings = false;
settingsStr settings;
bool savePreset = false;
bool applyPreset = false;
bool deletePreset = false;
presetStr preset;
bool ryzenAdjInfo = false;
int ryzenAdjInfoTimeout = 0;
};
struct PMTable{
char ryzenFamily[16] = UNKNOWN_PRESET_NAME;
int biosVersion = 0;
uint32_t pmTableVersion = 0;
int ryzenAdjVersion = 0;
int ryzenAdjMajorVersion = 0;
int ryzenAdjMinorVersion = 0;
float stapm_limit = 0.f;
float stapm_value = 0.f;
float fast_limit = 0.f;
float fast_value = 0.f;
float slow_limit = 0.f;
float slow_value = 0.f;
float apu_slow_limit = 0.f;
float apu_slow_value = 0.f;
float vrm_current = 0.f;
float vrm_current_value = 0.f;
float vrmsoc_current = 0.f;
float vrmsoc_current_value = 0.f;
float vrmmax_current = 0.f;
float vrmmax_current_value = 0.f;
float vrmsocmax_current = 0.f;
float vrmsocmax_current_value = 0.f;
float tctl_temp = 0.f;
float tctl_temp_value = 0.f;
float apu_skin_temp_limit = 0.f;
float apu_skin_temp_value = 0.f;
float dgpu_skin_temp_limit = 0.f;
float dgpu_skin_temp_value = 0.f;
float stapm_time = 0.f;
float slow_time = 0.f;
float psi0_current = 0.f;
float psi0soc_current = 0.f;
//new v0.8.2
float cclk_setpoint = 0.f;
float cclk_busy_value = 0.f;
//new vars by core
float core_clk_0 = 0.f;
float core_volt_0 = 0.f;
float core_power_0 = 0.f;
float core_temp_0 = 0.f;
//new v0.10.0
float l3_clk = 0.f;
float l3_logic = 0.f;
float l3_vddm = 0.f;
float l3_temp = 0.f;
float gfx_clk = 0.f;
float gfx_temp = 0.f;
float gfx_volt = 0.f;
float mem_clk = 0.f;
float fclk = 0.f;
float soc_power = 0.f;
float soc_volt = 0.f;
float socket_power = 0.f;
};
struct messageToGuiStr{
int currentPresetId = -1;
bool presetSaved = false;
bool pmUpdated = false;
PMTable pmTable;
};
struct settingsToGuiStr{
settingsStr settings;
presetStr preset;
bool lastPreset = false;
};
/*SHOW_ONLY_DEFS*/\
#define SHOW_ONLY_RAVEN \
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
false,\
false,\
false,\
false,\
true,\
true,\
/*new 0.8.3*/ \
false,\
/*new 0.8.4*/ \
false,\
false,\
false,\
false,\
false,\
/*new 0.10.0*/ \
false,\
false,\
false,\
false,\
/*new 0.11.0*/ \
false,\
false,\
false
#define SHOW_ONLY_PICASSO \
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
false,\
false,\
false,\
false,\
true,\
true,\
/*new 0.8.3*/ \
false,\
/*new 0.8.4*/ \
false,\
false,\
false,\
false,\
false,\
/*new 0.10.0*/ \
false,\
false,\
false,\
false,\
/*new 0.11.0*/ \
false,\
false,\
false
#define SHOW_ONLY_RENOIR \
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
false,\
false,\
false,\
false,\
false,\
false,\
false,\
false,\
false,\
false,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
/*new 0.8.3*/ \
false,\
/*new 0.8.4*/ \
false,\
false,\
false,\
false,\
false,\
/*new 0.10.0*/ \
false,\
false,\
false,\
false,\
/*new 0.11.0*/ \
false,\
false,\
false
#define SHOW_ONLY_CEZANNE \
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
false,\
false,\
false,\
false,\
false,\
false,\
false,\
false,\
false,\
false,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
/*new 0.8.3*/ \
false,\
/*new 0.8.4*/ \
false,\
false,\
false,\
false,\
false,\
/*new 0.10.0*/ \
false,\
false,\
false,\
false,\
/*new 0.11.0*/ \
false,\
false,\
false
#define SHOW_ONLY_DALI \
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
false,\
false,\
false,\
false,\
true,\
true,\
/*new 0.8.3*/ \
false,\
/*new 0.8.4*/ \
false,\
false,\
false,\
false,\
false,\
/*new 0.10.0*/ \
false,\
false,\
false,\
false,\
/*new 0.11.0*/ \
false,\
false,\
false
#define SHOW_ONLY_LUCIENNE \
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
false,\
false,\
false,\
false,\
false,\
false,\
false,\
false,\
false,\
false,\
true,\
true,\
true,\
true,\
true,\
true,\
true,\
/*new 0.8.3*/ \
false,\
/*new 0.8.4*/ \
false,\
false,\
false,\
false,\
false,\
/*new 0.10.0*/ \
false,\
false,\
false,\
false,\
/*new 0.11.0*/ \
false,\
false,\
false
#endif // CTRLCONFIG_H