Implement the code related to the GetMixedComponentVersion()

Change-Id: I98aad97b4cb6498b7f2fc03a2d5ee7c9e949d5f1
Signed-off-by: Chen Gong <curry.gong@amd.com>
Este cometimento está contido em:
Chen Gong criou e Galantsev, Dmitrii cometeu 2024-09-10 10:06:44 -05:00
1 ascendente 8db404f84f
cometimento 1edd04d84e
9 ficheiros modificados
+153 -1

Não existem ficheiros que correspondam à sua pesquisa

+10
Ver ficheiro
@@ -26,6 +26,7 @@ THE SOFTWARE.
#include "common/rdc_fields_supported.h"
#include "rdc/rdc.h"
#include "rdc/rdc_private.h"
#include "rdc_lib/RdcHandler.h"
#include "rdc_lib/RdcLibraryLoader.h"
#include "rdc_lib/RdcLogger.h"
@@ -324,6 +325,15 @@ rdc_status_t rdc_test_case_run(rdc_handle_t p_rdc_handle, rdc_gpu_group_t group_
->rdc_test_case_run(group_id, test_case, config, config_size, result);
}
rdc_status_t get_mixed_component_version(rdc_handle_t p_rdc_handle, mixed_component_t component, mixed_component_version_t* p_mixed_compv) {
if (!p_rdc_handle || !p_mixed_compv) {
return RDC_ST_INVALID_HANDLER;
}
return static_cast<amd::rdc::RdcHandler*>(p_rdc_handle)
->get_mixed_component_version(component, p_mixed_compv);
}
const char* rdc_status_string(rdc_status_t result) {
switch (result) {
case RDC_ST_OK:
+8
Ver ficheiro
@@ -421,5 +421,13 @@ rdc_status_t RdcEmbeddedHandler::rdc_field_update_all(uint32_t wait_for_update)
return RDC_ST_OK;
}
// It is just a client interface under the GRPC framework and is not used as an RDC API.
// Just write an empty function to solve compilation errors
rdc_status_t RdcEmbeddedHandler::get_mixed_component_version(mixed_component_t component, mixed_component_version_t* p_mixed_compv) {
(void)(component);
(void)(p_mixed_compv);
return RDC_ST_OK;
}
} // namespace rdc
} // namespace amd
+22
Ver ficheiro
@@ -662,5 +662,27 @@ rdc_status_t RdcStandaloneHandler::rdc_field_update_all(uint32_t wait_for_update
return error_handle(status, reply.status());
}
// It is only an interface for the client under the GRPC framework and is not used as an RDC API.
rdc_status_t RdcStandaloneHandler::get_mixed_component_version(mixed_component_t component, mixed_component_version_t* p_mixed_compv) {
if (!p_mixed_compv) {
return RDC_ST_BAD_PARAMETER;
}
::rdc::GetMixedComponentVersionRequest request;
::rdc::GetMixedComponentVersionResponse reply;
::grpc::ClientContext context;
request.set_component_id(component);
::grpc::Status status = stub_->GetMixedComponentVersion(&context, request, &reply);
rdc_status_t err_status = error_handle(status, reply.status());
if (err_status != RDC_ST_OK) return err_status;
strncpy_with_null(p_mixed_compv->version, reply.version().c_str(), USR_MAX_VERSION_STR_LENGTH);
return RDC_ST_OK;
}
} // namespace rdc
} // namespace amd