Implement rdc_device_get_component_version API related code

Implement an API to obtain the version information of the rdc calling component.
See rdc_component_t for details on available components.
It can be expanded later if necessary.

Change-Id: I03b48f774179c52c57b606704283add74ca39a02
Signed-off-by: Chen Gong <curry.gong@amd.com>
Tento commit je obsažen v:
Chen Gong authored and Galantsev, Dmitrii committed 2024-09-10 10:06:44 -05:00
1 rodič 69a9f24b6e
revize 5a3fd9fbc1
9 files changed
+109

No files matched your search

+35
Zobrazit soubor
@@ -141,6 +141,11 @@ typedef enum { INTEGER = 0, DOUBLE, STRING, BLOB } rdc_field_type_t;
*/
#define RDC_MAX_NUM_FIELD_GROUPS 64
/**
* @brief The max string length occupied by version information
*/
#define RDC_MAX_VERSION_STR_LENGTH 60
/**
* These enums are used to specify a particular field to be retrieved.
*/
@@ -343,6 +348,13 @@ typedef struct {
char device_name[RDC_MAX_STR_LENGTH]; //!< Name of the device.
} rdc_device_attributes_t;
/**
* @brief Store version information for each component
*/
typedef struct {
char version[RDC_MAX_VERSION_STR_LENGTH];
} rdc_component_version_t;
/**
* @brief The structure to store the group info
*/
@@ -476,6 +488,14 @@ typedef enum {
RDC_DIAG_TEST_LAST = RDC_DIAG_GPU_PARAMETERS
} rdc_diag_test_cases_t;
/**
* @brief Type of Components
*/
typedef enum {
RDC_AMDMSI_COMPONENT
//If needed later, add them one by one
} rdc_component_t;
/**
* @brief The maximum test cases to run
*/
@@ -750,6 +770,21 @@ rdc_status_t rdc_device_get_all(rdc_handle_t p_rdc_handle,
rdc_status_t rdc_device_get_attributes(rdc_handle_t p_rdc_handle, uint32_t gpu_index,
rdc_device_attributes_t* p_rdc_attr);
/**
* @brief Get version information of components used by rdc.
*
* @details Given a component type, return its version information.
*
* @param[in] p_rdc_handle The RDC handler.
*
* @param[in] component Type of Components. See rdc_component_t definition for details.
*
* @param[out] p_rdc_compv Version information of the corresponding component.
*
* @retval ::RDC_ST_OK is returned upon successful call.
*/
rdc_status_t rdc_device_get_component_version(rdc_handle_t p_rdc_handle, rdc_component_t component, rdc_component_version_t* p_rdc_compv);
/**
* @brief Create a group contains multiple GPUs
*
+1
Zobrazit soubor
@@ -44,6 +44,7 @@ class RdcHandler {
uint32_t* count) = 0;
virtual rdc_status_t rdc_device_get_attributes(uint32_t gpu_index,
rdc_device_attributes_t* p_rdc_attr) = 0;
virtual rdc_status_t rdc_device_get_component_version(rdc_component_t component, rdc_component_version_t* p_rdc_compv) = 0;
// Group API
virtual rdc_status_t rdc_group_gpu_create(rdc_group_type_t type, const char* group_name,
+1
Zobrazit soubor
@@ -51,6 +51,7 @@ class RdcEmbeddedHandler final : public RdcHandler {
uint32_t* count) override;
rdc_status_t rdc_device_get_attributes(uint32_t gpu_index,
rdc_device_attributes_t* p_rdc_attr) override;
rdc_status_t rdc_device_get_component_version(rdc_component_t component, rdc_component_version_t* p_rdc_compv) override;
// Group API
rdc_status_t rdc_group_gpu_create(rdc_group_type_t type, const char* group_name,
+1
Zobrazit soubor
@@ -46,6 +46,7 @@ class RdcStandaloneHandler : public RdcHandler {
uint32_t* count) override;
rdc_status_t rdc_device_get_attributes(uint32_t gpu_index,
rdc_device_attributes_t* p_rdc_attr) override;
rdc_status_t rdc_device_get_component_version(rdc_component_t component, rdc_component_version_t* p_rdc_compv) override;
// Group RdcAPI
rdc_status_t rdc_group_gpu_create(rdc_group_type_t type, const char* group_name,