Change API to get the driver date
Support the driver date from libdrm.
Change-Id: I88e694732b538220e11fdb4029712bb5a6f44380
[ROCm/amdsmi commit: 55bf9cbe13]
This commit is contained in:
@@ -375,6 +375,11 @@ typedef struct {
|
||||
uint32_t reserved[3];
|
||||
} amdsmi_asic_info_t;
|
||||
|
||||
typedef struct {
|
||||
char driver_version[AMDSMI_MAX_STRING_LENGTH];
|
||||
char driver_date[AMDSMI_MAX_STRING_LENGTH];
|
||||
} amdsmi_driver_info_t;
|
||||
|
||||
typedef struct {
|
||||
uint64_t serial_number;
|
||||
bool is_master;
|
||||
@@ -3205,13 +3210,13 @@ amdsmi_get_gpu_device_uuid(amdsmi_processor_handle processor_handle, unsigned in
|
||||
* string buffer. As output parameter length of the returned
|
||||
* string buffer.
|
||||
*
|
||||
* @param[out] version Version information in string format. Must be
|
||||
* @param[out] info Reference to driver information structure. Must be
|
||||
* allocated by user.
|
||||
*
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_gpu_driver_version(amdsmi_processor_handle processor_handle, int *length, char *version);
|
||||
amdsmi_get_gpu_driver_info(amdsmi_processor_handle processor_handle, amdsmi_driver_info_t *info);
|
||||
|
||||
/** @} End swversion */
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#define AMD_SMI_INCLUDE_IMPL_AMD_SMI_DRM_H_
|
||||
|
||||
#include <unistd.h>
|
||||
#include <xf86drm.h>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <mutex> // NOLINT
|
||||
@@ -74,6 +75,7 @@ class AMDSmiDrm {
|
||||
amdsmi_status_t amdgpu_query_hw_ip(int fd, unsigned info_id,
|
||||
unsigned hw_ip_type, unsigned size, void *value);
|
||||
amdsmi_status_t amdgpu_query_vbios(int fd, void *info);
|
||||
amdsmi_status_t amdgpu_query_driver_date(int fd, std::string& driver_date);
|
||||
|
||||
private:
|
||||
// when file is not found, the empty string will be returned
|
||||
@@ -87,6 +89,11 @@ class AMDSmiDrm {
|
||||
|
||||
AMDSmiLibraryLoader lib_loader_; // lazy load libdrm
|
||||
DrmCmdWriteFunc drm_cmd_write_; // drmCommandWrite
|
||||
using drmGetVersionFunc = drmVersionPtr (*)(int); // drmGetVersion
|
||||
using drmFreeVersionFunc = void (*)(drmVersionPtr); // drmFreeVersion
|
||||
drmGetVersionFunc drm_get_version_;
|
||||
drmFreeVersionFunc drm_free_version_;
|
||||
|
||||
std::mutex drm_mutex_;
|
||||
};
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ class AMDSmiGPUDevice: public AMDSmiProcessor {
|
||||
amdsmi_status_t amdgpu_query_fw(unsigned info_id, unsigned fw_type,
|
||||
unsigned size, void *value) const;
|
||||
amdsmi_status_t amdgpu_query_vbios(void *info) const;
|
||||
amdsmi_status_t amdgpu_query_driver_date(std::string& date) const;
|
||||
private:
|
||||
uint32_t gpu_id_;
|
||||
uint32_t fd_;
|
||||
|
||||
Reference in New Issue
Block a user