mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
feature(sysman): Added changes for Porting Standby API
The corresponding sysfs file names used by the standby module has been added in the sysfsNameToFileMap. The ULTs have been added in the standby module covering the new filename. The base path for the sysfs filenames corresponding to the Xe driver have been modified. Related-To: LOCI-4406 Signed-off-by: Bari, Pratik <pratik.bari@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
64bf895cf7
commit
b85222b4f3
@@ -32,12 +32,12 @@ std::unique_ptr<SysmanKmdInterface> SysmanKmdInterface::create(const NEO::Drm &d
|
||||
return pSysmanKmdInterface;
|
||||
}
|
||||
|
||||
std::string SysmanKmdInterfaceI915::getBasePath(int subDeviceId) const {
|
||||
std::string SysmanKmdInterfaceI915::getBasePath(uint32_t subDeviceId) const {
|
||||
return "gt/gt" + std::to_string(subDeviceId) + "/";
|
||||
}
|
||||
|
||||
std::string SysmanKmdInterfaceXe::getBasePath(int subDeviceId) const {
|
||||
return "device/gt" + std::to_string(subDeviceId) + "/";
|
||||
std::string SysmanKmdInterfaceXe::getBasePath(uint32_t subDeviceId) const {
|
||||
return "device/tile" + std::to_string(subDeviceId) + "/gt" + std::to_string(subDeviceId) + "/";
|
||||
}
|
||||
|
||||
void SysmanKmdInterfaceI915::initSysfsNameToFileMap(const PRODUCT_FAMILY productFamily) {
|
||||
@@ -62,6 +62,7 @@ void SysmanKmdInterfaceI915::initSysfsNameToFileMap(const PRODUCT_FAMILY product
|
||||
sysfsNameToFileMap[SysfsName::sysfsNameEnergyCounterNode] = std::make_pair("", "energy1_input");
|
||||
sysfsNameToFileMap[SysfsName::sysfsNameDefaultPowerLimit] = std::make_pair("", "power1_rated_max");
|
||||
sysfsNameToFileMap[SysfsName::sysfsNameCriticalPowerLimit] = std::make_pair("", (productFamily == IGFX_PVC) ? "curr1_crit" : "power1_crit");
|
||||
sysfsNameToFileMap[SysfsName::sysfsNameStandbyModeControl] = std::make_pair("rc6_enable", "power/rc6_enable");
|
||||
}
|
||||
|
||||
void SysmanKmdInterfaceXe::initSysfsNameToFileMap(const PRODUCT_FAMILY productFamily) {
|
||||
@@ -88,12 +89,12 @@ void SysmanKmdInterfaceXe::initSysfsNameToFileMap(const PRODUCT_FAMILY productFa
|
||||
sysfsNameToFileMap[SysfsName::sysfsNameCriticalPowerLimit] = std::make_pair("", (productFamily == IGFX_PVC) ? "curr1_crit" : "power1_crit");
|
||||
}
|
||||
|
||||
std::string SysmanKmdInterfaceI915::getSysfsFilePath(SysfsName sysfsName, int subDeviceId, bool baseDirectoryExists) {
|
||||
std::string SysmanKmdInterfaceI915::getSysfsFilePath(SysfsName sysfsName, uint32_t subDeviceId, bool baseDirectoryExists) {
|
||||
std::string filePath = baseDirectoryExists ? getBasePath(subDeviceId) + sysfsNameToFileMap[sysfsName].first : sysfsNameToFileMap[sysfsName].second;
|
||||
return filePath;
|
||||
}
|
||||
|
||||
std::string SysmanKmdInterfaceXe::getSysfsFilePath(SysfsName sysfsName, int subDeviceId, bool baseDirectoryExists) {
|
||||
std::string SysmanKmdInterfaceXe::getSysfsFilePath(SysfsName sysfsName, uint32_t subDeviceId, bool baseDirectoryExists) {
|
||||
std::string filePath = baseDirectoryExists ? getBasePath(subDeviceId) + sysfsNameToFileMap[sysfsName].first : sysfsNameToFileMap[sysfsName].second;
|
||||
return filePath;
|
||||
}
|
||||
@@ -126,12 +127,12 @@ int64_t SysmanKmdInterfaceXe::getEngineActivityFd(zes_engine_group_t engineGroup
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::string SysmanKmdInterfaceI915::getHwmonName(int subDeviceId, bool isSubdevice) const {
|
||||
std::string SysmanKmdInterfaceI915::getHwmonName(uint32_t subDeviceId, bool isSubdevice) const {
|
||||
std::string filePath = isSubdevice ? "i915_gt" + std::to_string(subDeviceId) : "i915";
|
||||
return filePath;
|
||||
}
|
||||
|
||||
std::string SysmanKmdInterfaceXe::getHwmonName(int subDeviceId, bool isSubdevice) const {
|
||||
std::string SysmanKmdInterfaceXe::getHwmonName(uint32_t subDeviceId, bool isSubdevice) const {
|
||||
std::string filePath = isSubdevice ? "xe_tile" + std::to_string(subDeviceId) : "xe";
|
||||
return filePath;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ enum class SysfsName {
|
||||
sysfsNameEnergyCounterNode,
|
||||
sysfsNameDefaultPowerLimit,
|
||||
sysfsNameCriticalPowerLimit,
|
||||
sysfsNameStandbyModeControl,
|
||||
};
|
||||
|
||||
class SysmanKmdInterface {
|
||||
@@ -78,10 +79,11 @@ class SysmanKmdInterface {
|
||||
virtual ~SysmanKmdInterface() = default;
|
||||
static std::unique_ptr<SysmanKmdInterface> create(const NEO::Drm &drm);
|
||||
|
||||
virtual std::string getBasePath(int subDeviceId) const = 0;
|
||||
virtual std::string getSysfsFilePath(SysfsName sysfsName, int subDeviceId, bool baseDirectoryExists) = 0;
|
||||
virtual std::string getBasePath(uint32_t subDeviceId) const = 0;
|
||||
virtual std::string getSysfsFilePath(SysfsName sysfsName, uint32_t subDeviceId, bool baseDirectoryExists) = 0;
|
||||
virtual int64_t getEngineActivityFd(zes_engine_group_t engineGroup, uint32_t engineInstance, uint32_t subDeviceId, PmuInterface *const &pmuInterface) = 0;
|
||||
virtual std::string getHwmonName(int subDeviceId, bool isSubdevice) const = 0;
|
||||
virtual std::string getHwmonName(uint32_t subDeviceId, bool isSubdevice) const = 0;
|
||||
virtual bool isStandbyModeControlAvailable() const = 0;
|
||||
};
|
||||
|
||||
class SysmanKmdInterfaceI915 : public SysmanKmdInterface {
|
||||
@@ -89,10 +91,11 @@ class SysmanKmdInterfaceI915 : public SysmanKmdInterface {
|
||||
SysmanKmdInterfaceI915(const PRODUCT_FAMILY productFamily) { initSysfsNameToFileMap(productFamily); }
|
||||
~SysmanKmdInterfaceI915() override = default;
|
||||
|
||||
std::string getBasePath(int subDeviceId) const override;
|
||||
std::string getSysfsFilePath(SysfsName sysfsName, int subDeviceId, bool baseDirectoryExists) override;
|
||||
std::string getBasePath(uint32_t subDeviceId) const override;
|
||||
std::string getSysfsFilePath(SysfsName sysfsName, uint32_t subDeviceId, bool baseDirectoryExists) override;
|
||||
int64_t getEngineActivityFd(zes_engine_group_t engineGroup, uint32_t engineInstance, uint32_t subDeviceId, PmuInterface *const &pmuInterface) override;
|
||||
std::string getHwmonName(int subDeviceId, bool isSubdevice) const override;
|
||||
std::string getHwmonName(uint32_t subDeviceId, bool isSubdevice) const override;
|
||||
bool isStandbyModeControlAvailable() const override { return true; }
|
||||
|
||||
protected:
|
||||
std::map<SysfsName, valuePair> sysfsNameToFileMap;
|
||||
@@ -104,10 +107,11 @@ class SysmanKmdInterfaceXe : public SysmanKmdInterface {
|
||||
SysmanKmdInterfaceXe(const PRODUCT_FAMILY productFamily) { initSysfsNameToFileMap(productFamily); }
|
||||
~SysmanKmdInterfaceXe() override = default;
|
||||
|
||||
std::string getBasePath(int subDeviceId) const override;
|
||||
std::string getSysfsFilePath(SysfsName sysfsName, int subDeviceId, bool baseDirectoryExists) override;
|
||||
std::string getBasePath(uint32_t subDeviceId) const override;
|
||||
std::string getSysfsFilePath(SysfsName sysfsName, uint32_t subDeviceId, bool baseDirectoryExists) override;
|
||||
int64_t getEngineActivityFd(zes_engine_group_t engineGroup, uint32_t engineInstance, uint32_t subDeviceId, PmuInterface *const &pmuInterface) override;
|
||||
std::string getHwmonName(int subDeviceId, bool isSubdevice) const override;
|
||||
std::string getHwmonName(uint32_t subDeviceId, bool isSubdevice) const override;
|
||||
bool isStandbyModeControlAvailable() const override { return false; }
|
||||
|
||||
protected:
|
||||
std::map<SysfsName, valuePair> sysfsNameToFileMap;
|
||||
|
||||
Reference in New Issue
Block a user