Skip to content

Commit

Permalink
Merge pull request #458 from intel/v2.5.8_rc2_br
Browse files Browse the repository at this point in the history
V2.5.8 rc2 br
  • Loading branch information
spandruvada authored Aug 14, 2024
2 parents 13c310e + fcb220d commit df3b9ab
Show file tree
Hide file tree
Showing 46 changed files with 384 additions and 933 deletions.
6 changes: 0 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ thermald_SOURCES = \
src/thd_cdev_rapl_dram.cpp \
src/thd_cdev_backlight.cpp \
src/thd_int3400.cpp \
src/thd_cdev_kbl_amdgpu.cpp \
src/thd_sensor_kbl_amdgpu_power.cpp \
src/thd_sensor_kbl_amdgpu_thermal.cpp \
src/thd_zone_kbl_g_mcp.cpp \
src/thd_sensor_kbl_g_mcp.cpp \
src/thd_zone_kbl_amdgpu.cpp \
src/thd_sensor_rapl_power.cpp \
src/thd_zone_rapl_power.cpp \
src/thd_gddv.cpp \
Expand Down
5 changes: 4 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ Releases

Release 2.5.8
- Lunar Lake support
- Deprecate modem support
- Arrow Lake support
- Remove coverity errors to minimum
- Add a script to plot temperature and trips from debug log
- Deprecate modem/KBL-G support
- Remove dbus-glib-devel as requirment

Release 2.5.7
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AC_PREREQ(1.0)

m4_define([td_major_version], [2])
m4_define([td_minor_version], [5.8-rc1])
m4_define([td_minor_version], [5.8])
m4_define([td_version],
[td_major_version.td_minor_version])

Expand Down
5 changes: 4 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,10 @@ int main(int argc, char *argv[]) {
fprintf(stderr, "Cannot create '%s': %s", TDRUNDIR, strerror(errno));
exit(EXIT_FAILURE);
}
g_mkdir_with_parents(TDCONFDIR, 0755); // Don't care return value as directory
if (g_mkdir_with_parents(TDCONFDIR, 0755) != 0) {
// Don't care return value as directory
fprintf(stderr, "Cannot create '%s': %s", TDCONFDIR, strerror(errno));
}
// may already exist
if (log_info) {
thd_log_level |= G_LOG_LEVEL_INFO;
Expand Down
29 changes: 20 additions & 9 deletions src/thd_cdev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,17 +254,19 @@ int cthd_cdev::thd_cdev_set_state(int set_point, int target_temp,
bool found = false;
bool first_entry = false;

if (zone_trip_limits.size() == 0)
if (zone_trip_limits.size() == 0) {
first_entry = true;

// Search for the zone and trip id in the list
for (unsigned int i = 0; i < zone_trip_limits.size(); ++i) {
if (zone_trip_limits[i].zone == zone_id
&& zone_trip_limits[i].trip == trip_id) {
found = true;
break;
} else {
// Search for the zone and trip id in the list
for (unsigned int i = 0; i < zone_trip_limits.size(); ++i) {
if (zone_trip_limits[i].zone == zone_id
&& zone_trip_limits[i].trip == trip_id) {
found = true;
break;
}
}
}

// If not found in the list add to the list
if (!found) {
zone_trip_limits_t limit;
Expand Down Expand Up @@ -326,7 +328,16 @@ int cthd_cdev::thd_cdev_set_state(int set_point, int target_temp,

zone_trip_limits_t limit;

limit = zone_trip_limits[zone_trip_limits.size() - 1];
/* The below check to keep static analysis happy. There is no way
* zone_trip_limits.size() == 0.
* The above !found case ensures atleast size == 1
*/
unsigned int zone_trips_size = zone_trip_limits.size();

if (!zone_trips_size)
zone_trips_size = 1;

limit = zone_trip_limits[zone_trips_size - 1];
target_state_valid = limit.target_state_valid;

target_value = limit.target_value;
Expand Down
8 changes: 4 additions & 4 deletions src/thd_cdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class cthd_cdev {
virtual int map_target_state(int target_valid, int target_state) {
return target_state;
}
virtual void set_adaptive_target(struct adaptive_target) {};
virtual void set_adaptive_target(struct adaptive_target &target) {};
void set_debounce_interval(int interval) {
debounce_interval = interval;
}
Expand Down Expand Up @@ -240,10 +240,10 @@ class cthd_cdev {
return cdev_sysfs.get_base_path();
}
void set_cdev_type(std::string _type_str) {
type_str = _type_str;
type_str = std::move(_type_str);
}
void set_cdev_alias(std::string _alias_str) {
alias_str = _alias_str;
alias_str = std::move(_alias_str);
}
void set_pid_param(double kp, double ki, double kd) {
pid_ctrl.kp = kp;
Expand All @@ -257,7 +257,7 @@ class cthd_cdev {
}

void thd_cdev_set_write_prefix(std::string prefix) {
write_prefix = prefix;
write_prefix = std::move(prefix);
}

void cdev_dump() {
Expand Down
2 changes: 1 addition & 1 deletion src/thd_cdev_gen_sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class cthd_gen_sysfs_cdev: public cthd_cdev {

public:
cthd_gen_sysfs_cdev(unsigned int _index, std::string control_path) :
cthd_cdev(_index, control_path) {
cthd_cdev(_index, std::move(control_path)) {
}
virtual void set_curr_state(int state, int arg);
virtual void set_curr_state_raw(int state, int arg);
Expand Down
144 changes: 0 additions & 144 deletions src/thd_cdev_kbl_amdgpu.cpp

This file was deleted.

44 changes: 0 additions & 44 deletions src/thd_cdev_kbl_amdgpu.h

This file was deleted.

5 changes: 3 additions & 2 deletions src/thd_cdev_rapl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,11 @@ void cthd_sysfs_cdev_rapl::set_tcc(int tcc) {
if (!sysfs.exists("tcc_offset_degree_celsius"))
return;

sysfs.write("tcc_offset_degree_celsius", tcc);
if (sysfs.write("tcc_offset_degree_celsius", tcc) == -1)
thd_log_debug("TCC write failed\n");
}

void cthd_sysfs_cdev_rapl::set_adaptive_target(struct adaptive_target target) {
void cthd_sysfs_cdev_rapl::set_adaptive_target(struct adaptive_target &target) {
int argument = std::stoi(target.argument, NULL);
if (target.code == "PL1MAX") {
int pl1_rapl;
Expand Down
16 changes: 14 additions & 2 deletions src/thd_cdev_rapl.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,16 @@ class cthd_sysfs_cdev_rapl: public cthd_cdev {
false), power_on_constraint_0_pwr(0), power_on_constraint_0_time_window(
0), power_on_enable_status(0), device_name("TCPU.D0")
{
pl1_max_pwr = 0;
pl1_min_pwr = 0;
pl1_min_window = 0;
pl1_max_window = 0;
pl1_step_pwr = 0;
pl1_valid = 0;
}
cthd_sysfs_cdev_rapl(unsigned int _index, int package,
std::string contol_path) :
cthd_cdev(_index, contol_path), phy_max(0), package_id(
cthd_cdev(_index, std::move(contol_path)), phy_max(0), package_id(
package), constraint_index(
0), pl2_index(
-1), dynamic_phy_max_enable(false), pl0_max_pwr(
Expand All @@ -99,6 +105,12 @@ class cthd_sysfs_cdev_rapl: public cthd_cdev {
false), power_on_constraint_0_pwr(0), power_on_constraint_0_time_window(
0), power_on_enable_status(0), device_name("TCPU.D0")
{
pl1_max_pwr = 0;
pl1_min_pwr = 0;
pl1_min_window = 0;
pl1_max_window = 0;
pl1_step_pwr = 0;
pl1_valid = 0;
}

virtual void set_curr_state(int state, int arg);
Expand All @@ -108,7 +120,7 @@ class cthd_sysfs_cdev_rapl: public cthd_cdev {
virtual int update();
virtual void set_curr_state_raw(int state, int arg);
void set_tcc(int tcc);
void set_adaptive_target(struct adaptive_target target);
void set_adaptive_target(struct adaptive_target &target);
void thd_cdev_set_min_state_param(int arg);
int get_phy_max_state() {
return phy_max;
Expand Down
2 changes: 1 addition & 1 deletion src/thd_cdev_rapl_dram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int cthd_sysfs_cdev_rapl_dram::update() {
if (!found)
return THD_ERROR;

cdev_sysfs.update_path(path_name);
cdev_sysfs.update_path(std::move(path_name));

return cthd_sysfs_cdev_rapl::update();
}
Expand Down
2 changes: 1 addition & 1 deletion src/thd_cdev_therm_sys_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class cthd_sysfs_cdev: public cthd_cdev {

public:
cthd_sysfs_cdev(unsigned int _index, std::string control_path) :
cthd_cdev(_index, control_path) {
cthd_cdev(_index, std::move(control_path)) {
}
virtual void set_curr_state(int state, int arg);
virtual int get_curr_state();
Expand Down
Loading

0 comments on commit df3b9ab

Please sign in to comment.