mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
feature: Add support for late binding version on linux
Related-To: NEO-15216 Signed-off-by: shubham kumar <shubham.kumar@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
24906b3639
commit
5d4c23c4fb
@@ -195,6 +195,8 @@ class SysmanKmdInterface {
|
||||
const std::string getSysmanDeviceDirName() const;
|
||||
ze_result_t checkErrorNumberAndReturnStatus();
|
||||
virtual ze_result_t readPcieDowngradeAttribute(std::string sysfsName, uint32_t &val) { return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; }
|
||||
virtual void getLateBindingSupportedFwTypes(std::vector<std::string> &fwTypes) {}
|
||||
virtual bool isLateBindingVersionAvailable(std::string fwType, std::string &fwVersion) { return false; }
|
||||
|
||||
protected:
|
||||
std::unique_ptr<FsAccessInterface> pFsAccess;
|
||||
@@ -420,6 +422,8 @@ class SysmanKmdInterfaceXe : public SysmanKmdInterface {
|
||||
std::string getBurstPowerLimitFile(SysfsName sysfsName, uint32_t subDeviceId, bool baseDirectoryExists) override;
|
||||
std::string getFreqMediaDomainBasePath() override;
|
||||
ze_result_t readPcieDowngradeAttribute(std::string sysfsName, uint32_t &val) override;
|
||||
void getLateBindingSupportedFwTypes(std::vector<std::string> &fwTypes) override;
|
||||
bool isLateBindingVersionAvailable(std::string fwType, std::string &fwVersion) override;
|
||||
|
||||
protected:
|
||||
std::map<SysfsName, valuePair> sysfsNameToFileMap;
|
||||
|
||||
@@ -25,6 +25,10 @@ static const std::map<__u16, std::string> xeEngineClassToSysfsEngineMap = {
|
||||
{DRM_XE_ENGINE_CLASS_VIDEO_DECODE, "vcs"},
|
||||
{DRM_XE_ENGINE_CLASS_VIDEO_ENHANCE, "vecs"}};
|
||||
|
||||
static const std::map<std::string, std::string> lateBindingSysfsFileToNameMap = {
|
||||
{"VRConfig", "device/lb_voltage_regulator_version"},
|
||||
{"FanTable", "device/lb_fan_control_version"}};
|
||||
|
||||
SysmanKmdInterfaceXe::SysmanKmdInterfaceXe(SysmanProductHelper *pSysmanProductHelper) {
|
||||
initSysfsNameToFileMap(pSysmanProductHelper);
|
||||
initSysfsNameToNativeUnitMap(pSysmanProductHelper);
|
||||
@@ -406,5 +410,22 @@ ze_result_t SysmanKmdInterfaceXe::readPcieDowngradeAttribute(std::string sysfsNa
|
||||
return result;
|
||||
}
|
||||
|
||||
void SysmanKmdInterfaceXe::getLateBindingSupportedFwTypes(std::vector<std::string> &fwTypes) {
|
||||
for (auto it = lateBindingSysfsFileToNameMap.begin(); it != lateBindingSysfsFileToNameMap.end(); ++it) {
|
||||
if (pSysfsAccess->canRead(it->second) == ZE_RESULT_SUCCESS) {
|
||||
fwTypes.push_back(it->first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool SysmanKmdInterfaceXe::isLateBindingVersionAvailable(std::string fwType, std::string &fwVersion) {
|
||||
auto key = lateBindingSysfsFileToNameMap.find(fwType);
|
||||
if (key == lateBindingSysfsFileToNameMap.end()) {
|
||||
return false;
|
||||
}
|
||||
ze_result_t result = pSysfsAccess->read(key->second.data(), fwVersion);
|
||||
return result == ZE_RESULT_SUCCESS ? true : false;
|
||||
}
|
||||
|
||||
} // namespace Sysman
|
||||
} // namespace L0
|
||||
|
||||
@@ -89,7 +89,6 @@ class SysmanProductHelper {
|
||||
|
||||
// Firmware
|
||||
virtual void getDeviceSupportedFwTypes(FirmwareUtil *pFwInterface, std::vector<std::string> &fwTypes) = 0;
|
||||
virtual bool isLateBindingSupported() = 0;
|
||||
|
||||
// Ecc
|
||||
virtual bool isEccConfigurationSupported() = 0;
|
||||
|
||||
@@ -63,7 +63,6 @@ class SysmanProductHelperHw : public SysmanProductHelper {
|
||||
|
||||
// Firmware
|
||||
void getDeviceSupportedFwTypes(FirmwareUtil *pFwInterface, std::vector<std::string> &fwTypes) override;
|
||||
bool isLateBindingSupported() override;
|
||||
|
||||
// Ecc
|
||||
bool isEccConfigurationSupported() override;
|
||||
|
||||
@@ -353,11 +353,6 @@ void SysmanProductHelperHw<gfxProduct>::getDeviceSupportedFwTypes(FirmwareUtil *
|
||||
pFwInterface->getDeviceSupportedFwTypes(fwTypes);
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool SysmanProductHelperHw<gfxProduct>::isLateBindingSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool SysmanProductHelperHw<gfxProduct>::isEccConfigurationSupported() {
|
||||
return false;
|
||||
|
||||
@@ -1709,11 +1709,6 @@ bool SysmanProductHelperHw<gfxProduct>::isEccConfigurationSupported() {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool SysmanProductHelperHw<gfxProduct>::isLateBindingSupported() {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool SysmanProductHelperHw<gfxProduct>::isPcieDowngradeSupported() {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user