fix: [SWDEV-458862] [rocm/rocm_smi_lib]

Fixes reading pp_od_clk_voltage new variable format and size.

Code changes related to the following:
  * get_od_clk_volt_info()
  * get_od_clk_volt_curve_regions()
  * Unit tests
  * CLI options restored: --showclkvolt, --showvc, --showvoltagerange, --setvc
    * Rework: 48ddd9ab
  * Bump CLI version
  * CHANGELOG.md

Change-Id: I817ca224de923fdaa992df84592d63b4d5a12b22
Signed-off-by: Oliveira, Daniel <daniel.oliveira@amd.com>
This commit is contained in:
Oliveira, Daniel
2024-05-03 02:58:31 -05:00
committed by Maisam Arif
parent 0c48cd9122
commit 8e6d66e15b
8 changed files with 294 additions and 90 deletions
-4
View File
@@ -2870,8 +2870,6 @@ rsmi_status_t rsmi_dev_od_clk_info_set(uint32_t dv_ind, rsmi_freq_ind_t level,
/**
* @brief This function sets 1 of the 3 voltage curve points.
*
* @deprecated This function is deprecated due to driver changes.
*
* @details Given a device index @p dv_ind, a voltage point @p vpoint
* and a voltage value @p voltvalue this function will set voltage curve point
*
@@ -2897,8 +2895,6 @@ rsmi_status_t rsmi_dev_od_volt_info_set(uint32_t dv_ind, uint32_t vpoint,
* @brief This function will retrieve the current valid regions in the
* frequency/voltage space.
*
* @deprecated This function is deprecated due to driver changes.
*
* @details Given a device index @p dv_ind, a pointer to an unsigned integer
* @p num_regions and a buffer of ::rsmi_freq_volt_region_t structures, @p
* buffer, this function will populate @p buffer with the current
+16 -7
View File
@@ -554,9 +554,9 @@ class TagTextContents_t
++line_counter;
}
// Any remaining elements?
// Any remaining elements? If so, the data belongs to the last found section title
if (line_counter > bottom_title_line) {
update_primary_tbl(bottom_title_line, (line_counter - 1));
update_primary_tbl(bottom_title_line, line_counter);
}
}
@@ -570,15 +570,24 @@ class TagTextContents_t
// Note: Organizes table with Title as a Key, a Key/ID for values and values.
// It takes into consideration the initial constraints were all good and
// that the primary table has been populated.
auto sec_key = std::string();
auto sec_data = std::string();
auto auto_key = uint32_t(0);
for (const auto& [prim_key, prim_values] : m_primary) {
for (const auto& value : prim_values) {
if (auto mark_pos = value.find_first_of(m_line_splitter_mark.c_str());
mark_pos != std::string::npos) {
auto sec_key = trim(value.substr(0, mark_pos + 1));
auto sec_data = trim(value.substr((mark_pos + 1), value.size()));
if (!sec_key.empty()) {
m_structured[prim_key].insert(std::make_pair(sec_key, sec_data));
}
sec_key = trim(value.substr(0, mark_pos + 1));
sec_data = trim(value.substr((mark_pos + 1), value.size()));
}
// In case there is no 'key' based on the data token marker, generate one.
else {
sec_key = std::to_string(auto_key) + m_line_splitter_mark;
sec_data = trim(value.substr(0, value.size()));
++auto_key;
}
if (!sec_key.empty()) {
m_structured[prim_key].insert(std::make_pair(sec_key, sec_data));
}
}
}