[SWDEV-532125] Remove_Unused_Definitions (#385)
Signed-off-by: Narlo, Joseph <Joseph.Narlo@amd.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7c29b4eab8
Коммит
b6d638d942
@@ -12,6 +12,18 @@ Full documentation for amd_smi_lib is available at [https://rocm.docs.amd.com/pr
|
||||
|
||||
### Changed
|
||||
|
||||
- N/A
|
||||
|
||||
### Removed
|
||||
|
||||
- **Removed unused definition `AMDSMI_MAX_NAME`**
|
||||
- **Removed unused definition `AMDSMI_256_LENGTH`**
|
||||
- **Removed unused definition `AMDSMI_MAX_DATE_LENGTH`**
|
||||
- **Removed unused definition `MAX_AMDSMI_NAME_LENGTH`**
|
||||
- **Removed unused definition `AMDSMI_LIB_VERSION_YEAR`**
|
||||
- **Removed unused definition `AMDSMI_DEFAULT_VARIANT`**
|
||||
- **Removed unused definition `AMDSMI_MAX_NUM_POWER_PROFILES`**
|
||||
- **Removed unused member `year` in struct `amdsmi_version_t`**
|
||||
- **Updated `amdsmi_get_gpu_asic_info` in `amdsmi.h`.**
|
||||
- Added `subsystem_id` structure member.
|
||||
- **Removed `amdsmi_io_link_type_t` and replaced with amdsmi_link_type_t**.
|
||||
|
||||
@@ -60,7 +60,6 @@ typedef enum {
|
||||
* @cond @tag{gpu_bm_linux} @tag{host} @tag{guest_windows} @endcond
|
||||
*/
|
||||
#define AMDSMI_MAX_MM_IP_COUNT 8
|
||||
#define AMDSMI_MAX_DATE_LENGTH 32 //!< YYYY-MM-DD:HH:MM:SS.MSC
|
||||
#define AMDSMI_MAX_STRING_LENGTH 256
|
||||
#define AMDSMI_MAX_DEVICES 32
|
||||
#define AMDSMI_MAX_DRIVER_VERSION_LENGTH 80
|
||||
@@ -77,10 +76,8 @@ typedef enum {
|
||||
*
|
||||
* @cond @tag{gpu_bm_linux} @endcond
|
||||
*/
|
||||
#define AMDSMI_MAX_NAME 32
|
||||
#define AMDSMI_MAX_NUM_XGMI_PHYSICAL_LINK 64
|
||||
#define AMDSMI_MAX_CONTAINER_TYPE 2
|
||||
#define AMDSMI_256_LENGTH AMDSMI_MAX_STRING_LENGTH //!< Deprecated
|
||||
|
||||
/**
|
||||
* @brief The following structure holds the gpu metrics values for a device.
|
||||
@@ -197,9 +194,6 @@ typedef enum {
|
||||
* @cond @tag{gpu_bm_linux} @endcond
|
||||
*/
|
||||
|
||||
//! Year should follow the IP driver package version: 22.40/23.10 and similar
|
||||
#define AMDSMI_LIB_VERSION_YEAR 25 //!< To Be Deprecated
|
||||
|
||||
//! Major version should be changed for every header change that breaks ABI
|
||||
//! Such as adding/deleting APIs, changing names, fields of structures, etc.
|
||||
#define AMDSMI_LIB_VERSION_MAJOR 25
|
||||
@@ -1568,13 +1562,6 @@ typedef struct {
|
||||
amdsmi_memory_page_status_t status; //!< Page "reserved" status
|
||||
} amdsmi_retired_page_record_t;
|
||||
|
||||
/**
|
||||
* @brief Number of possible power profiles that a system could support
|
||||
*
|
||||
* @cond @tag{gpu_bm_linux} @endcond
|
||||
*/
|
||||
#define AMDSMI_MAX_NUM_POWER_PROFILES (sizeof(amdsmi_bit_field_t) * 8)
|
||||
|
||||
/**
|
||||
* @brief This structure contains information about which power profiles are
|
||||
* supported by the system for a given device, and which power profile is
|
||||
@@ -1646,7 +1633,6 @@ typedef struct {
|
||||
* @cond @tag{gpu_bm_linux} @endcond
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t year; //!< Last 2 digits of the Year released - To Be Deprecated
|
||||
uint32_t major; //!< Major version
|
||||
uint32_t minor; //!< Minor version
|
||||
uint32_t release; //!< Patch, build or stepping version
|
||||
@@ -1968,8 +1954,6 @@ typedef struct {
|
||||
uint64_t reserved[7];
|
||||
} amdsmi_xgmi_link_status_t;
|
||||
|
||||
#define MAX_AMDSMI_NAME_LENGTH 64
|
||||
|
||||
/**
|
||||
* @brief This structure holds the name value pairs
|
||||
*
|
||||
@@ -2068,9 +2052,6 @@ typedef enum {
|
||||
AMDSMI_AFFINITY_SCOPE_SOCKET = 1 // socket affinity
|
||||
} amdsmi_affinity_scope_t;
|
||||
|
||||
|
||||
#define AMDSMI_DEFAULT_VARIANT 0xFFFFFFFFFFFFFFFF
|
||||
|
||||
#ifdef ENABLE_ESMI_LIB
|
||||
|
||||
/**
|
||||
|
||||
@@ -77,17 +77,13 @@ AMDSMI_NUM_VOLTAGE_CURVE_POINTS = 3
|
||||
|
||||
# Max size definitions
|
||||
AMDSMI_MAX_MM_IP_COUNT = 8
|
||||
AMDSMI_MAX_DATE_LENGTH = 32
|
||||
AMDSMI_MAX_STRING_LENGTH = 256
|
||||
AMDSMI_MAX_DEVICES = 32
|
||||
AMDSMI_MAX_NAME = 32
|
||||
AMDSMI_MAX_DRIVER_VERSION_LENGTH = 80
|
||||
AMDSMI_256_LENGTH = 256
|
||||
AMDSMI_MAX_CONTAINER_TYPE = 2
|
||||
AMDSMI_MAX_CACHE_TYPES = 10
|
||||
AMDSMI_MAX_NUM_XGMI_PHYSICAL_LINK = 64
|
||||
AMDSMI_GPU_UUID_SIZE = 38
|
||||
MAX_AMDSMI_NAME_LENGTH = 64
|
||||
_AMDSMI_STRING_LENGTH = 80
|
||||
|
||||
|
||||
|
||||
@@ -1835,10 +1835,10 @@ class struct_amdsmi_version_t(Structure):
|
||||
|
||||
struct_amdsmi_version_t._pack_ = 1 # source:False
|
||||
struct_amdsmi_version_t._fields_ = [
|
||||
('year', ctypes.c_uint32),
|
||||
('major', ctypes.c_uint32),
|
||||
('minor', ctypes.c_uint32),
|
||||
('release', ctypes.c_uint32),
|
||||
('PADDING_0', ctypes.c_ubyte * 4),
|
||||
('build', ctypes.POINTER(ctypes.c_char)),
|
||||
]
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ pub fn amdsmi_get_socket_handles() -> AmdsmiResult<Vec<AmdsmiSocketHandle>> {
|
||||
///
|
||||
/// This function will return the error in [`AmdsmiStatusT`] if the underlying `amdsmi_wrapper::amdsmi_get_socket_info` call fails.
|
||||
pub fn amdsmi_get_socket_info(socket_handle: AmdsmiSocketHandle) -> AmdsmiResult<String> {
|
||||
let (mut info, len) = define_cstr!(amdsmi_wrapper::AMDSMI_256_LENGTH);
|
||||
let (mut info, len) = define_cstr!(amdsmi_wrapper::AMDSMI_MAX_STRING_LENGTH);
|
||||
call_unsafe!(amdsmi_wrapper::amdsmi_get_socket_info(
|
||||
socket_handle,
|
||||
len,
|
||||
@@ -4776,7 +4776,7 @@ pub fn amdsmi_topo_get_p2p_status(
|
||||
pub fn amdsmi_get_gpu_compute_partition(
|
||||
processor_handle: AmdsmiProcessorHandle,
|
||||
) -> AmdsmiResult<String> {
|
||||
let (mut compute_partition, len) = define_cstr!(amdsmi_wrapper::AMDSMI_256_LENGTH);
|
||||
let (mut compute_partition, len) = define_cstr!(amdsmi_wrapper::AMDSMI_MAX_STRING_LENGTH);
|
||||
call_unsafe!(amdsmi_wrapper::amdsmi_get_gpu_compute_partition(
|
||||
processor_handle,
|
||||
compute_partition.as_mut_ptr(),
|
||||
@@ -4884,7 +4884,7 @@ pub fn amdsmi_set_gpu_compute_partition(
|
||||
pub fn amdsmi_get_gpu_memory_partition(
|
||||
processor_handle: AmdsmiProcessorHandle,
|
||||
) -> AmdsmiResult<String> {
|
||||
let (mut memory_partition, len) = define_cstr!(amdsmi_wrapper::AMDSMI_256_LENGTH);
|
||||
let (mut memory_partition, len) = define_cstr!(amdsmi_wrapper::AMDSMI_MAX_STRING_LENGTH);
|
||||
call_unsafe!(amdsmi_wrapper::amdsmi_get_gpu_memory_partition(
|
||||
processor_handle,
|
||||
memory_partition.as_mut_ptr(),
|
||||
|
||||
@@ -102,11 +102,8 @@ where
|
||||
}
|
||||
}
|
||||
pub const AMDSMI_MAX_MM_IP_COUNT: u32 = 8;
|
||||
pub const AMDSMI_MAX_DATE_LENGTH: u32 = 32;
|
||||
pub const AMDSMI_MAX_STRING_LENGTH: u32 = 256;
|
||||
pub const AMDSMI_256_LENGTH: u32 = 256;
|
||||
pub const AMDSMI_MAX_DEVICES: u32 = 32;
|
||||
pub const AMDSMI_MAX_NAME: u32 = 32;
|
||||
pub const AMDSMI_MAX_DRIVER_VERSION_LENGTH: u32 = 80;
|
||||
pub const AMDSMI_MAX_CONTAINER_TYPE: u32 = 2;
|
||||
pub const AMDSMI_MAX_CACHE_TYPES: u32 = 10;
|
||||
@@ -127,7 +124,6 @@ pub const AMDSMI_MAX_NUM_XCC: u32 = 8;
|
||||
pub const AMDSMI_MAX_NUM_XCP: u32 = 8;
|
||||
pub const AMDSMI_TIME_FORMAT: &[u8; 20] = b"%02d:%02d:%02d.%03d\0";
|
||||
pub const AMDSMI_DATE_FORMAT: &[u8; 35] = b"%04d-%02d-%02d:%02d:%02d:%02d.%03d\0";
|
||||
pub const AMDSMI_LIB_VERSION_YEAR: u32 = 25;
|
||||
pub const AMDSMI_LIB_VERSION_MAJOR: u32 = 25;
|
||||
pub const AMDSMI_LIB_VERSION_MINOR: u32 = 4;
|
||||
pub const AMDSMI_LIB_VERSION_RELEASE: u32 = 2;
|
||||
@@ -136,7 +132,6 @@ pub const AMDSMI_MAX_FAN_SPEED: u32 = 255;
|
||||
pub const AMDSMI_NUM_VOLTAGE_CURVE_POINTS: u32 = 3;
|
||||
pub const AMDSMI_MAX_UTILIZATION_VALUES: u32 = 4;
|
||||
pub const AMDSMI_MAX_NUM_PM_POLICIES: u32 = 32;
|
||||
pub const AMDSMI_DEFAULT_VARIANT: i32 = -1;
|
||||
#[repr(u32)]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum AmdsmiInitFlagsT {
|
||||
|
||||
@@ -710,17 +710,17 @@ amdsmi_get_gpu_board_info(amdsmi_processor_handle processor_handle, amdsmi_board
|
||||
}
|
||||
if (board_info->product_name[0] == '\0') {
|
||||
status = rsmi_wrapper(rsmi_dev_name_get, processor_handle, 0,
|
||||
board_info->product_name, AMDSMI_256_LENGTH);
|
||||
board_info->product_name, AMDSMI_MAX_STRING_LENGTH);
|
||||
// Check if the value is in hex format
|
||||
if (status == AMDSMI_STATUS_SUCCESS) {
|
||||
if (board_info->product_name[0] == '0' && board_info->product_name[1] == 'x') {
|
||||
memset(board_info->product_name, 0,
|
||||
AMDSMI_256_LENGTH * sizeof(board_info->product_name[0]));
|
||||
AMDSMI_MAX_STRING_LENGTH * sizeof(board_info->product_name[0]));
|
||||
}
|
||||
}
|
||||
if (status != AMDSMI_STATUS_SUCCESS) {
|
||||
memset(board_info->product_name, 0,
|
||||
AMDSMI_256_LENGTH * sizeof(board_info->product_name[0]));
|
||||
AMDSMI_MAX_STRING_LENGTH * sizeof(board_info->product_name[0]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -749,17 +749,17 @@ amdsmi_get_gpu_board_info(amdsmi_processor_handle processor_handle, amdsmi_board
|
||||
if (board_info->product_name[0] == '\0') {
|
||||
status = rsmi_wrapper(rsmi_dev_name_get, processor_handle, 0,
|
||||
board_info->product_name,
|
||||
AMDSMI_256_LENGTH);
|
||||
AMDSMI_MAX_STRING_LENGTH);
|
||||
// Check if the value is in hex format
|
||||
if (status == AMDSMI_STATUS_SUCCESS) {
|
||||
if (board_info->product_name[0] == '0' && board_info->product_name[1] == 'x') {
|
||||
memset(board_info->product_name, 0,
|
||||
AMDSMI_256_LENGTH * sizeof(board_info->product_name[0]));
|
||||
AMDSMI_MAX_STRING_LENGTH * sizeof(board_info->product_name[0]));
|
||||
}
|
||||
}
|
||||
if (status != AMDSMI_STATUS_SUCCESS) {
|
||||
memset(board_info->product_name, 0,
|
||||
AMDSMI_256_LENGTH * sizeof(board_info->product_name[0]));
|
||||
AMDSMI_MAX_STRING_LENGTH * sizeof(board_info->product_name[0]));
|
||||
}
|
||||
ss << __PRETTY_FUNCTION__ << " | [rsmi_correction] board_info->product_name= |"
|
||||
<< board_info->product_name << "|";
|
||||
@@ -1443,7 +1443,7 @@ amdsmi_get_gpu_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_i
|
||||
amdsmi_status_t status = smi_amdgpu_get_market_name_from_dev_id(gpu_device, info->market_name);
|
||||
if (status != AMDSMI_STATUS_SUCCESS) {
|
||||
rsmi_wrapper(rsmi_dev_brand_get, processor_handle, 0,
|
||||
info->market_name, AMDSMI_256_LENGTH);
|
||||
info->market_name, AMDSMI_MAX_STRING_LENGTH);
|
||||
}
|
||||
|
||||
std::string render_name = gpu_device->get_gpu_path();
|
||||
@@ -3546,7 +3546,6 @@ amdsmi_status_t amdsmi_get_lib_version(amdsmi_version_t *version) {
|
||||
if (version == nullptr)
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
|
||||
version->year = AMDSMI_LIB_VERSION_YEAR;
|
||||
version->major = AMDSMI_LIB_VERSION_MAJOR;
|
||||
version->minor = AMDSMI_LIB_VERSION_MINOR;
|
||||
version->release = AMDSMI_LIB_VERSION_RELEASE;
|
||||
|
||||
@@ -659,7 +659,7 @@ amdsmi_status_t smi_amdgpu_get_market_name_from_dev_id(amd::smi::AMDSmiGPUDevice
|
||||
ret = amdgpu_device_initialize(fd, &major_version, &minor_version, &device_handle);
|
||||
if (ret != 0) {
|
||||
std::string empty = "";
|
||||
std::strncpy(market_name, empty.c_str(), AMDSMI_256_LENGTH - 1);
|
||||
std::strncpy(market_name, empty.c_str(), AMDSMI_MAX_STRING_LENGTH - 1);
|
||||
amdgpu_device_deinitialize(device_handle);
|
||||
close(fd);
|
||||
return AMDSMI_STATUS_DRM_ERROR;
|
||||
@@ -668,8 +668,8 @@ amdsmi_status_t smi_amdgpu_get_market_name_from_dev_id(amd::smi::AMDSmiGPUDevice
|
||||
// Get the marketing name using libdrm's API
|
||||
const char *name = amdgpu_get_marketing_name(device_handle);
|
||||
if (name != nullptr) {
|
||||
std::strncpy(market_name, name, AMDSMI_256_LENGTH - 1);
|
||||
market_name[AMDSMI_256_LENGTH - 1] = '\0';
|
||||
std::strncpy(market_name, name, AMDSMI_MAX_STRING_LENGTH - 1);
|
||||
market_name[AMDSMI_MAX_STRING_LENGTH - 1] = '\0';
|
||||
amdgpu_device_deinitialize(device_handle);
|
||||
close(fd);
|
||||
libdrm_amdgpu_.AMDSmiLibraryLoader::unload();
|
||||
|
||||
@@ -70,7 +70,7 @@ void TestSysInfoRead::Run(void) {
|
||||
amdsmi_status_t err;
|
||||
uint64_t val_ui64;
|
||||
int32_t val_i32;
|
||||
amdsmi_version_t ver = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, nullptr};
|
||||
amdsmi_version_t ver = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, nullptr};
|
||||
|
||||
TestBase::Run();
|
||||
if (setup_failed_) {
|
||||
|
||||
@@ -65,7 +65,7 @@ static const uint32_t kVerMaxStrLen = 80;
|
||||
|
||||
void TestVersionRead::Run(void) {
|
||||
amdsmi_status_t err;
|
||||
amdsmi_version_t ver = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, nullptr};
|
||||
amdsmi_version_t ver = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, nullptr};
|
||||
|
||||
TestBase::Run();
|
||||
if (setup_failed_) {
|
||||
|
||||
Ссылка в новой задаче
Block a user