Skip to content

Commit d253207

Browse files
committed
[UI] Now display when a Thermal Point value is missing.
1 parent 69fcb37 commit d253207

File tree

1 file changed

+40
-15
lines changed

1 file changed

+40
-15
lines changed

corefreq-cli.c

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3926,6 +3926,7 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
39263926
].PowerThermal.HWP.Request.Energy_Pref );
39273927
}
39283928
}
3929+
/* Row Mark */
39293930
GridCall( PUT( SCANKEY_NULL, attrib[6], width, 2,
39303931
"%s%.*s%s [%3u:%3u %c]",
39313932
RSC(POWER_THERMAL_TJMAX).CODE(),
@@ -3939,29 +3940,29 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
39393940
) : SFlop->Thermal.Param.Offset[0],
39403941
Setting.fahrCels ? 'F' : 'C' ),
39413942
TjMax_Update );
3942-
3943+
/* Row Mark */
39433944
bix = (Shm->Proc.Features.Power.EAX.DTS == 1)
39443945
|| (Shm->Proc.Features.AdvPower.EDX.TS == 1);
39453946

39463947
PUT( SCANKEY_NULL, attrib[bix], width, 2,
39473948
"%s%.*s%s [%7s]", RSC(POWER_THERMAL_DTS).CODE(),
39483949
width - 18 - RSZ(POWER_THERMAL_DTS), hSpace,
39493950
RSC(POWER_LABEL_DTS).CODE(), POWERED(bix) );
3950-
3951+
/* Row Mark */
39513952
bix = Shm->Proc.Features.Power.EAX.PLN == 1;
39523953

39533954
PUT( SCANKEY_NULL, attrib[bix], width, 2,
39543955
"%s%.*s%s [%7s]", RSC(POWER_THERMAL_PLN).CODE(),
39553956
width - 18 - RSZ(POWER_THERMAL_PLN), hSpace,
39563957
RSC(POWER_LABEL_PLN).CODE(), POWERED(bix) );
3957-
3958+
/* Row Mark */
39583959
bix = Shm->Proc.Features.Power.EAX.PTM == 1;
39593960

39603961
PUT( SCANKEY_NULL, attrib[bix], width, 2,
39613962
"%s%.*s%s [%7s]", RSC(POWER_THERMAL_PTM).CODE(),
39623963
width - 18 - RSZ(POWER_THERMAL_PTM), hSpace,
39633964
RSC(POWER_LABEL_PTM).CODE(), POWERED(bix) );
3964-
3965+
/* Section Mark */
39653966
if (Shm->Proc.Features.Info.Vendor.CRC == CRC_INTEL)
39663967
{
39673968
bix = Shm->Proc.Technology.TM1;
@@ -3995,6 +3996,7 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
39953996
width - 18 - RSZ(POWER_THERMAL_TM2), hSpace,
39963997
RSC(POWER_LABEL_HTC).CODE(), TM[bix] );
39973998
}
3999+
/* Section Mark */
39984000
if (Shm->Proc.Power.TDP > 0) {
39994001
GridCall( PUT( SCANKEY_NULL, attrib[5], width, 2,
40004002
"%s%.*s%s [%5u W]", RSC(POWER_THERMAL_TDP).CODE(),
@@ -4007,6 +4009,7 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
40074009
width - 18 - RSZ(POWER_THERMAL_TDP), hSpace,
40084010
RSC(POWER_LABEL_TDP).CODE(), POWERED(0) );
40094011
}
4012+
/* Section Mark */
40104013
if (Shm->Proc.Power.Min > 0) {
40114014
PUT( SCANKEY_NULL, attrib[5], width, 3,
40124015
"%s%.*s%s [%5u W]", RSC(POWER_THERMAL_MIN).CODE(),
@@ -4020,6 +4023,7 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
40204023
- RSZ(POWER_THERMAL_MIN), hSpace,
40214024
RSC(POWER_LABEL_MIN).CODE(), POWERED(0) );
40224025
}
4026+
/* Section Mark */
40234027
if (Shm->Proc.Power.Max > 0) {
40244028
PUT( SCANKEY_NULL, attrib[5], width, 3,
40254029
"%s%.*s%s [%5u W]", RSC(POWER_THERMAL_MAX).CODE(),
@@ -4033,6 +4037,7 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
40334037
- RSZ(POWER_THERMAL_MAX), hSpace,
40344038
RSC(POWER_LABEL_MAX).CODE(), POWERED(0) );
40354039
}
4040+
/* Section Mark */
40364041
struct {
40374042
const ASCII *code;
40384043
const int size;
@@ -4125,6 +4130,7 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
41254130
PL2_Update, pw );
41264131
}
41274132
}
4133+
/* Section Mark */
41284134
if((Shm->Proc.Features.Info.Vendor.CRC == CRC_AMD)
41294135
|| (Shm->Proc.Features.Info.Vendor.CRC == CRC_HYGON))
41304136
{
@@ -4140,6 +4146,7 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
41404146
RSC(POWER_LABEL_PPT).CODE(), POWERED(0) );
41414147
}
41424148
}
4149+
/* Row Mark */
41434150
if (Shm->Proc.Power.EDC > 0) {
41444151
PUT( SCANKEY_NULL, attrib[5], width, 2,
41454152
"%s%.*s%s [%5u A]", RSC(POWER_THERMAL_EDC).CODE(),
@@ -4151,6 +4158,7 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
41514158
width - 18 - RSZ(POWER_THERMAL_EDC), hSpace,
41524159
RSC(POWER_LABEL_EDC).CODE(), POWERED(0) );
41534160
}
4161+
/* Row Mark */
41544162
if (Shm->Proc.Power.TDC > 0) {
41554163
GridCall( PUT( Shm->Proc.Features.TDP_Unlock ?
41564164
BOXKEY_TDC : SCANKEY_NULL,
@@ -4169,7 +4177,7 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
41694177
width - 18 - RSZ(POWER_THERMAL_TDC), hSpace,
41704178
RSC(POWER_LABEL_TDC).CODE(), POWERED(0) );
41714179
}
4172-
4180+
/* Section Mark */
41734181
struct {
41744182
const ASCII *code;
41754183
const int size;
@@ -4202,9 +4210,8 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
42024210
enum THM_POINTS tp;
42034211
for (tp = THM_THRESHOLD_1; tp < THM_POINTS_DIM; tp++)
42044212
{
4205-
if (BITVAL(Shm->Cpu[Shm->Proc.Service.Core].ThermalPoint.Mask, tp)
4206-
& BITVAL(Shm->Cpu[Shm->Proc.Service.Core].ThermalPoint.State, tp))
4207-
{
4213+
if (BITVAL(Shm->Cpu[Shm->Proc.Service.Core].ThermalPoint.Mask, tp))
4214+
{
42084215
ASCII *code;
42094216
int size;
42104217
if (BITVAL(Shm->Cpu[Shm->Proc.Service.Core].ThermalPoint.Kind, tp)) {
@@ -4214,6 +4221,7 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
42144221
code = RSC(THERMAL_POINT_THRESHOLD).CODE();
42154222
size = RSZ(THERMAL_POINT_THRESHOLD);
42164223
}
4224+
if (BITVAL(Shm->Cpu[Shm->Proc.Service.Core].ThermalPoint.State, tp)) {
42174225
PUT( SCANKEY_NULL, attrib[5], width, 3,
42184226
"%s%.*s%s [%5u %c]",
42194227
thmPt[tp].code,
@@ -4223,17 +4231,23 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
42234231
Shm->Cpu[Shm->Proc.Service.Core].ThermalPoint.Value[tp]
42244232
) : Shm->Cpu[Shm->Proc.Service.Core].ThermalPoint.Value[tp],
42254233
Setting.fahrCels ? 'F' : 'C');
4226-
}
4234+
} else {
4235+
PUT( SCANKEY_NULL, attrib[0], width, 3,
4236+
"%s%.*s%s [%7s]",
4237+
thmPt[tp].code,
4238+
width - (OutFunc == NULL ? 18 : 16) - thmPt[tp].size - size,
4239+
hSpace, code, POWERED(0) );
4240+
}
4241+
}
42274242
}
4228-
4243+
/* Section Mark */
42294244
PUT( SCANKEY_NULL, attrib[0], width, 2, "%s %s",
42304245
RSC(POWER_LABEL_PKG).CODE(), RSC(POWER_THERMAL_POINT).CODE() );
42314246

42324247
for (tp = THM_THRESHOLD_1; tp < THM_POINTS_DIM; tp++)
42334248
{
4234-
if (BITVAL(Shm->Proc.ThermalPoint.Mask, tp)
4235-
& BITVAL(Shm->Proc.ThermalPoint.State, tp))
4236-
{
4249+
if (BITVAL(Shm->Proc.ThermalPoint.Mask, tp))
4250+
{
42374251
ASCII *code;
42384252
int size;
42394253
if (BITVAL(Shm->Proc.ThermalPoint.Kind, tp)) {
@@ -4243,6 +4257,8 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
42434257
code = RSC(THERMAL_POINT_THRESHOLD).CODE();
42444258
size = RSZ(THERMAL_POINT_THRESHOLD);
42454259
}
4260+
if (BITVAL(Shm->Proc.ThermalPoint.State, tp))
4261+
{
42464262
PUT( SCANKEY_NULL, attrib[5], width, 3,
42474263
"%s%.*s%s [%5u %c]",
42484264
thmPt[tp].code,
@@ -4251,9 +4267,16 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
42514267
Setting.fahrCels ? Cels2Fahr(Shm->Proc.ThermalPoint.Value[tp])
42524268
: Shm->Proc.ThermalPoint.Value[tp],
42534269
Setting.fahrCels ? 'F' : 'C');
4254-
}
4270+
} else {
4271+
PUT( SCANKEY_NULL, attrib[0], width, 3,
4272+
"%s%.*s%s [%7s]",
4273+
thmPt[tp].code,
4274+
width - (OutFunc == NULL ? 18 : 16) - thmPt[tp].size - size,
4275+
hSpace, code, POWERED(0) );
4276+
}
4277+
}
42554278
}
4256-
4279+
/* Section Mark */
42574280
PUT( SCANKEY_NULL, attrib[0], width, 2,
42584281
(char*) RSC(POWER_THERMAL_UNITS).CODE(), NULL );
42594282

@@ -4272,6 +4295,7 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
42724295
- RSZ(POWER_THERMAL_POWER) - RSZ(POWER_THERMAL_WATT), hSpace,
42734296
RSC(POWER_THERMAL_WATT).CODE(), POWERED(0) );
42744297
}
4298+
/* Row Mark */
42754299
if (Shm->Proc.Power.Unit.Joules > 0.0) {
42764300
PUT( SCANKEY_NULL, attrib[0], width, 3,
42774301
"%s%.*s%s [%13.9f]", RSC(POWER_THERMAL_ENERGY).CODE(),
@@ -4285,6 +4309,7 @@ REASON_CODE SysInfoPwrThermal(Window *win, CUINT width, CELL_FUNC OutFunc)
42854309
- RSZ(POWER_THERMAL_ENERGY) - RSZ(POWER_THERMAL_JOULE), hSpace,
42864310
RSC(POWER_THERMAL_JOULE).CODE(), POWERED(0) );
42874311
}
4312+
/* Row Mark */
42884313
if (Shm->Proc.Power.Unit.Times > 0.0) {
42894314
PUT( SCANKEY_NULL, attrib[0], width, 3,
42904315
"%s%.*s%s [%13.9f]", RSC(POWER_THERMAL_WINDOW).CODE(),

0 commit comments

Comments
 (0)