Renamed esmi library APIs and bound the APIs
to cpusocket handle Change-Id: I6e3d8aa667df475339c28b27294349843f32230c
Tento commit je obsažen v:
@@ -1861,14 +1861,20 @@ amdsmi_status_t amdsmi_get_processor_handle_from_bdf(amdsmi_bdf_t bdf,
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ESMI_LIB
|
||||
amdsmi_status_t amdsmi_get_hsmp_proto_ver(uint32_t *proto_ver)
|
||||
amdsmi_status_t amdsmi_get_cpu_hsmp_proto_ver(amdsmi_cpusocket_handle socket_handle,
|
||||
uint32_t *proto_ver)
|
||||
{
|
||||
amdsmi_status_t status;
|
||||
uint32_t hsmp_proto_ver;
|
||||
|
||||
if (proto_ver == nullptr)
|
||||
if (socket_handle == nullptr)
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
|
||||
amd::smi::AMDSmiCpuSocket* socket = nullptr;
|
||||
amdsmi_status_t r = get_cpu_socket_from_handle(socket_handle, &socket);
|
||||
if (r != AMDSMI_STATUS_SUCCESS)
|
||||
return r;
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_hsmp_proto_ver_get(&hsmp_proto_ver));
|
||||
*proto_ver = hsmp_proto_ver;
|
||||
|
||||
@@ -1878,14 +1884,20 @@ amdsmi_status_t amdsmi_get_hsmp_proto_ver(uint32_t *proto_ver)
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
amdsmi_status_t amdsmi_get_smu_fw_version(amdsmi_smu_fw_version_t *amdsmi_smu_fw)
|
||||
amdsmi_status_t amdsmi_get_cpu_smu_fw_version(amdsmi_cpusocket_handle socket_handle,
|
||||
amdsmi_smu_fw_version_t *amdsmi_smu_fw)
|
||||
{
|
||||
amdsmi_status_t status;
|
||||
struct smu_fw_version smu_fw;
|
||||
|
||||
if (amdsmi_smu_fw == nullptr)
|
||||
if (socket_handle == nullptr)
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
|
||||
amd::smi::AMDSmiCpuSocket* socket = nullptr;
|
||||
amdsmi_status_t r = get_cpu_socket_from_handle(socket_handle, &socket);
|
||||
if (r != AMDSMI_STATUS_SUCCESS)
|
||||
return r;
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_smu_fw_version_get(&smu_fw));
|
||||
|
||||
amdsmi_smu_fw->major = smu_fw.major;
|
||||
@@ -2309,14 +2321,20 @@ amdsmi_status_t amdsmi_set_cpu_socket_boostlimit(amdsmi_cpusocket_handle socket_
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
amdsmi_status_t amdsmi_get_cpu_ddr_bw(amdsmi_ddr_bw_metrics_t *ddr_bw)
|
||||
amdsmi_status_t amdsmi_get_cpu_ddr_bw(amdsmi_cpusocket_handle socket_handle,
|
||||
amdsmi_ddr_bw_metrics_t *ddr_bw)
|
||||
{
|
||||
amdsmi_status_t status;
|
||||
struct ddr_bw_metrics ddr;
|
||||
|
||||
if (ddr_bw == nullptr)
|
||||
if (socket_handle == nullptr)
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
|
||||
amd::smi::AMDSmiCpuSocket* socket = nullptr;
|
||||
amdsmi_status_t r = get_cpu_socket_from_handle(socket_handle, &socket);
|
||||
if (r != AMDSMI_STATUS_SUCCESS)
|
||||
return r;
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_ddr_bw_get(&ddr));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
@@ -2624,15 +2642,21 @@ amdsmi_status_t amdsmi_get_cpu_current_io_bandwidth(amdsmi_cpusocket_handle sock
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
amdsmi_status_t amdsmi_get_cpu_current_xgmi_bw(amdsmi_link_id_bw_type_t link, uint32_t *xgmi_bw)
|
||||
amdsmi_status_t amdsmi_get_cpu_current_xgmi_bw(amdsmi_cpusocket_handle socket_handle,
|
||||
amdsmi_link_id_bw_type_t link, uint32_t *xgmi_bw)
|
||||
{
|
||||
amdsmi_status_t status;
|
||||
uint32_t bw;
|
||||
struct link_id_bw_type io_link;
|
||||
|
||||
if (xgmi_bw == nullptr)
|
||||
if (socket_handle == nullptr)
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
|
||||
amd::smi::AMDSmiCpuSocket* socket = nullptr;
|
||||
amdsmi_status_t r = get_cpu_socket_from_handle(socket_handle, &socket);
|
||||
if (r != AMDSMI_STATUS_SUCCESS)
|
||||
return r;
|
||||
|
||||
status = static_cast<amdsmi_status_t>(esmi_current_xgmi_bw_get(io_link, &bw));
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
|
||||
Odkázat v novém úkolu
Zablokovat Uživatele