Add rsmi_dev_drm_render_minor_get()
Function to get the drm minor number associated with ROCm device Change-Id: I9356b9ca75151882acbb075076bc072f08b73aae Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
This commit is contained in:
@@ -830,6 +830,25 @@ rsmi_status_t rsmi_dev_subsystem_id_get(uint32_t dv_ind, uint16_t *id);
|
||||
rsmi_status_t
|
||||
rsmi_dev_subsystem_name_get(uint32_t dv_ind, char *name, size_t len);
|
||||
|
||||
/**
|
||||
* @brief Get the drm minor number associated with this device
|
||||
*
|
||||
* @details Given a device index @p dv_ind, find its render device file
|
||||
* /dev/dri/renderDN where N corresponds to its minor number.
|
||||
*
|
||||
* @param[in] dv_ind a device index
|
||||
*
|
||||
* @param[inout] minor a pointer to a uint32_t into which minor number will
|
||||
* be copied
|
||||
*
|
||||
* @retval :: RSMI_STATUS_SUCCESS is returned upon successful call.
|
||||
* @retval :: RSMI_STATUS_INIT_ERROR if failed to get minor number during
|
||||
* initialization.
|
||||
*
|
||||
*/
|
||||
rsmi_status_t
|
||||
rsmi_dev_drm_render_minor_get(uint32_t dv_ind, uint32_t *minor);
|
||||
|
||||
/**
|
||||
* @brief Get the device subsystem vendor id associated with the device with
|
||||
* provided device index.
|
||||
|
||||
@@ -139,6 +139,8 @@ class Device {
|
||||
int writeDevInfo(DevInfoTypes type, std::string val);
|
||||
uint32_t index(void) const {return index_;}
|
||||
void set_index(uint32_t index) {index_ = index;}
|
||||
uint32_t drm_render_minor(void) const {return drm_render_minor_;}
|
||||
void set_drm_render_minor(uint32_t minor) {drm_render_minor_ = minor;}
|
||||
static rsmi_dev_perf_level perfLvlStrToEnum(std::string s);
|
||||
uint64_t bdfid(void) const {return bdfid_;}
|
||||
void set_bdfid(uint64_t val) {bdfid_ = val;}
|
||||
@@ -153,6 +155,7 @@ class Device {
|
||||
std::string path_;
|
||||
shared_mutex_t mutex_;
|
||||
uint32_t index_;
|
||||
uint32_t drm_render_minor_;
|
||||
const RocmSMI_env_vars *env_;
|
||||
template <typename T> int openSysfsFileStream(DevInfoTypes type, T *fs,
|
||||
const char *str = nullptr);
|
||||
|
||||
Reference in New Issue
Block a user