mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
refactor: Set the sysman device directory name in SysmanKmdInterface
The name of the Sysman Device Directory is added as a parameter in SysmanKmdInterface as the name depends on either i915 or xe driver Related-To: NEO-14070 Signed-off-by: Pratik Bari <pratik.bari@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6ee39ed94c
commit
2b7e92b280
@@ -173,23 +173,10 @@ void SysmanKmdInterface::convertSysfsValueUnit(const SysfsValueUnit dstUnit, con
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t SysmanKmdInterface::getEventTypeImpl(std::string &dirName, const bool isIntegratedDevice) {
|
||||
auto pSysFsAccess = getSysFsAccess();
|
||||
uint32_t SysmanKmdInterface::getEventType() {
|
||||
|
||||
auto pFsAccess = getFsAccess();
|
||||
|
||||
if (!isIntegratedDevice) {
|
||||
std::string bdfDir;
|
||||
ze_result_t result = pSysFsAccess->readSymLink(deviceDir, bdfDir);
|
||||
if (ZE_RESULT_SUCCESS != result) {
|
||||
return 0;
|
||||
}
|
||||
const auto loc = bdfDir.find_last_of('/');
|
||||
auto bdf = bdfDir.substr(loc + 1);
|
||||
std::replace(bdf.begin(), bdf.end(), ':', '_');
|
||||
dirName = dirName + "_" + bdf;
|
||||
}
|
||||
|
||||
const std::string eventTypeSysfsNode = sysDevicesDir + dirName + "/" + "type";
|
||||
const std::string eventTypeSysfsNode = sysDevicesDir + sysmanDeviceDirName + "/" + "type";
|
||||
auto eventTypeVal = 0u;
|
||||
if (ZE_RESULT_SUCCESS != pFsAccess->read(eventTypeSysfsNode, eventTypeVal)) {
|
||||
return 0;
|
||||
@@ -221,6 +208,24 @@ ze_result_t SysmanKmdInterface::checkErrorNumberAndReturnStatus() {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
ze_result_t SysmanKmdInterface::getDeviceDirName(std::string &dirName, const bool isIntegratedDevice) {
|
||||
|
||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||
if (!isIntegratedDevice) {
|
||||
auto pSysFsAccess = getSysFsAccess();
|
||||
std::string bdfDir;
|
||||
result = pSysFsAccess->readSymLink(deviceDir, bdfDir);
|
||||
if (ZE_RESULT_SUCCESS != result) {
|
||||
return result;
|
||||
}
|
||||
const auto loc = bdfDir.find_last_of('/');
|
||||
auto bdf = bdfDir.substr(loc + 1);
|
||||
std::replace(bdf.begin(), bdf.end(), ':', '_');
|
||||
dirName = dirName + "_" + bdf;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string SysmanKmdInterfaceI915::getBasePathI915(uint32_t subDeviceId) {
|
||||
return "gt/gt" + std::to_string(subDeviceId) + "/";
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ class SysmanKmdInterface {
|
||||
void convertSysfsValueUnit(const SysfsValueUnit dstUnit, const SysfsValueUnit srcUnit,
|
||||
const uint64_t srcValue, uint64_t &dstValue) const;
|
||||
virtual std::optional<std::string> getEngineClassString(uint16_t engineClass) = 0;
|
||||
virtual uint32_t getEventType(const bool isIntegratedDevice) = 0;
|
||||
uint32_t getEventType();
|
||||
virtual bool isDefaultFrequencyAvailable() const = 0;
|
||||
virtual bool isBoostFrequencyAvailable() const = 0;
|
||||
virtual bool isTdpFrequencyAvailable() const = 0;
|
||||
@@ -154,14 +154,16 @@ class SysmanKmdInterface {
|
||||
virtual std::string getGpuBindEntry() const = 0;
|
||||
virtual std::string getGpuUnBindEntry() const = 0;
|
||||
virtual std::vector<zes_power_domain_t> getPowerDomains() const = 0;
|
||||
virtual void setSysmanDeviceDirName(const bool isIntegratedDevice) = 0;
|
||||
ze_result_t checkErrorNumberAndReturnStatus();
|
||||
|
||||
protected:
|
||||
std::unique_ptr<FsAccessInterface> pFsAccess;
|
||||
std::unique_ptr<ProcFsAccessInterface> pProcfsAccess;
|
||||
std::unique_ptr<SysFsAccessInterface> pSysfsAccess;
|
||||
std::string sysmanDeviceDirName = "";
|
||||
virtual const std::map<SysfsName, SysfsValueUnit> &getSysfsNameToNativeUnitMap() = 0;
|
||||
uint32_t getEventTypeImpl(std::string &dirName, const bool isIntegratedDevice);
|
||||
ze_result_t getDeviceDirName(std::string &dirName, const bool isIntegratedDevice);
|
||||
void getWedgedStatusImpl(LinuxSysmanImp *pLinuxSysmanImp, zes_device_state_t *pState);
|
||||
};
|
||||
|
||||
@@ -199,7 +201,6 @@ class SysmanKmdInterfaceI915Upstream : public SysmanKmdInterface, SysmanKmdInter
|
||||
ze_bool_t onSubdevice,
|
||||
uint32_t subdeviceId) override;
|
||||
std::optional<std::string> getEngineClassString(uint16_t engineClass) override;
|
||||
uint32_t getEventType(const bool isIntegratedDevice) override;
|
||||
bool isBaseFrequencyFactorAvailable() const override { return false; }
|
||||
bool isMediaFrequencyFactorAvailable() const override { return true; }
|
||||
bool isSystemPowerBalanceAvailable() const override { return false; }
|
||||
@@ -216,6 +217,7 @@ class SysmanKmdInterfaceI915Upstream : public SysmanKmdInterface, SysmanKmdInter
|
||||
std::string getGpuBindEntry() const override;
|
||||
std::string getGpuUnBindEntry() const override;
|
||||
std::vector<zes_power_domain_t> getPowerDomains() const override { return {ZES_POWER_DOMAIN_PACKAGE}; }
|
||||
void setSysmanDeviceDirName(const bool isIntegratedDevice) override;
|
||||
|
||||
protected:
|
||||
std::map<SysfsName, valuePair> sysfsNameToFileMap;
|
||||
@@ -249,7 +251,6 @@ class SysmanKmdInterfaceI915Prelim : public SysmanKmdInterface, SysmanKmdInterfa
|
||||
ze_bool_t onSubdevice,
|
||||
uint32_t subdeviceId) override;
|
||||
std::optional<std::string> getEngineClassString(uint16_t engineClass) override;
|
||||
uint32_t getEventType(const bool isIntegratedDevice) override;
|
||||
bool isBaseFrequencyFactorAvailable() const override { return true; }
|
||||
bool isMediaFrequencyFactorAvailable() const override { return true; }
|
||||
bool isSystemPowerBalanceAvailable() const override { return true; }
|
||||
@@ -266,6 +267,7 @@ class SysmanKmdInterfaceI915Prelim : public SysmanKmdInterface, SysmanKmdInterfa
|
||||
std::string getGpuBindEntry() const override;
|
||||
std::string getGpuUnBindEntry() const override;
|
||||
std::vector<zes_power_domain_t> getPowerDomains() const override { return {ZES_POWER_DOMAIN_PACKAGE}; }
|
||||
void setSysmanDeviceDirName(const bool isIntegratedDevice) override;
|
||||
|
||||
protected:
|
||||
std::map<SysfsName, valuePair> sysfsNameToFileMap;
|
||||
@@ -299,7 +301,6 @@ class SysmanKmdInterfaceXe : public SysmanKmdInterface {
|
||||
ze_bool_t onSubdevice,
|
||||
uint32_t subdeviceId) override;
|
||||
std::optional<std::string> getEngineClassString(uint16_t engineClass) override;
|
||||
uint32_t getEventType(const bool isIntegratedDevice) override;
|
||||
bool isBaseFrequencyFactorAvailable() const override { return false; }
|
||||
bool isMediaFrequencyFactorAvailable() const override { return false; }
|
||||
bool isSystemPowerBalanceAvailable() const override { return false; }
|
||||
@@ -318,6 +319,7 @@ class SysmanKmdInterfaceXe : public SysmanKmdInterface {
|
||||
ze_result_t getBusyAndTotalTicksConfigs(uint64_t fnNumber, uint64_t engineInstance, uint64_t engineClass, std::pair<uint64_t, uint64_t> &configPair) override;
|
||||
std::string getGpuBindEntry() const override;
|
||||
std::string getGpuUnBindEntry() const override;
|
||||
void setSysmanDeviceDirName(const bool isIntegratedDevice) override;
|
||||
|
||||
protected:
|
||||
std::map<SysfsName, valuePair> sysfsNameToFileMap;
|
||||
|
||||
@@ -188,11 +188,6 @@ std::optional<std::string> SysmanKmdInterfaceI915Prelim::getEngineClassString(ui
|
||||
return sysfEngineString->second;
|
||||
}
|
||||
|
||||
uint32_t SysmanKmdInterfaceI915Prelim::getEventType(const bool isIntegratedDevice) {
|
||||
std::string i915DirName = "i915";
|
||||
return getEventTypeImpl(i915DirName, isIntegratedDevice);
|
||||
}
|
||||
|
||||
void SysmanKmdInterfaceI915Prelim::getWedgedStatus(LinuxSysmanImp *pLinuxSysmanImp, zes_device_state_t *pState) {
|
||||
getWedgedStatusImpl(pLinuxSysmanImp, pState);
|
||||
}
|
||||
@@ -227,5 +222,11 @@ std::string SysmanKmdInterfaceI915Prelim::getGpuUnBindEntry() const {
|
||||
return getGpuUnBindEntryI915();
|
||||
}
|
||||
|
||||
void SysmanKmdInterfaceI915Prelim::setSysmanDeviceDirName(const bool isIntegratedDevice) {
|
||||
|
||||
sysmanDeviceDirName = "i915";
|
||||
getDeviceDirName(sysmanDeviceDirName, isIntegratedDevice);
|
||||
}
|
||||
|
||||
} // namespace Sysman
|
||||
} // namespace L0
|
||||
@@ -144,11 +144,6 @@ ze_result_t SysmanKmdInterfaceI915Upstream::getNumEngineTypeAndInstances(std::ma
|
||||
return getNumEngineTypeAndInstancesForDevice(getEngineBasePath(subdeviceId), mapOfEngines, pSysfsAccess);
|
||||
}
|
||||
|
||||
uint32_t SysmanKmdInterfaceI915Upstream::getEventType(const bool isIntegratedDevice) {
|
||||
std::string i915DirName = "i915";
|
||||
return getEventTypeImpl(i915DirName, isIntegratedDevice);
|
||||
}
|
||||
|
||||
void SysmanKmdInterfaceI915Upstream::getWedgedStatus(LinuxSysmanImp *pLinuxSysmanImp, zes_device_state_t *pState) {
|
||||
getWedgedStatusImpl(pLinuxSysmanImp, pState);
|
||||
}
|
||||
@@ -180,5 +175,11 @@ std::string SysmanKmdInterfaceI915Upstream::getGpuUnBindEntry() const {
|
||||
return getGpuUnBindEntryI915();
|
||||
}
|
||||
|
||||
void SysmanKmdInterfaceI915Upstream::setSysmanDeviceDirName(const bool isIntegratedDevice) {
|
||||
|
||||
sysmanDeviceDirName = "i915";
|
||||
getDeviceDirName(sysmanDeviceDirName, isIntegratedDevice);
|
||||
}
|
||||
|
||||
} // namespace Sysman
|
||||
} // namespace L0
|
||||
|
||||
@@ -138,11 +138,6 @@ ze_result_t SysmanKmdInterfaceXe::getNumEngineTypeAndInstances(std::map<zes_engi
|
||||
return getNumEngineTypeAndInstancesForDevice(getEngineBasePath(subdeviceId), mapOfEngines, pSysfsAccess);
|
||||
}
|
||||
|
||||
uint32_t SysmanKmdInterfaceXe::getEventType(const bool isIntegratedDevice) {
|
||||
std::string xeDirName = "xe";
|
||||
return getEventTypeImpl(xeDirName, isIntegratedDevice);
|
||||
}
|
||||
|
||||
void SysmanKmdInterfaceXe::getDriverVersion(char (&driverVersion)[ZES_STRING_PROPERTY_SIZE]) {
|
||||
|
||||
auto pFsAccess = getFsAccess();
|
||||
@@ -170,5 +165,11 @@ std::string SysmanKmdInterfaceXe::getGpuUnBindEntry() const {
|
||||
return "/sys/bus/pci/drivers/xe/unbind";
|
||||
}
|
||||
|
||||
void SysmanKmdInterfaceXe::setSysmanDeviceDirName(const bool isIntegratedDevice) {
|
||||
|
||||
sysmanDeviceDirName = "xe";
|
||||
getDeviceDirName(sysmanDeviceDirName, isIntegratedDevice);
|
||||
}
|
||||
|
||||
} // namespace Sysman
|
||||
} // namespace L0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
* Copyright (C) 2020-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -28,13 +28,12 @@ inline int64_t PmuInterfaceImp::perfEventOpen(perf_event_attr *attr, pid_t pid,
|
||||
}
|
||||
|
||||
int64_t PmuInterfaceImp::pmuInterfaceOpen(uint64_t config, int group, uint32_t format) {
|
||||
const bool isIntegratedDevice = pDevice->getRootDeviceEnvironment().getHardwareInfo()->capabilityTable.isIntegratedDevice;
|
||||
struct perf_event_attr attr = {};
|
||||
int nrCpus = get_nprocs_conf();
|
||||
int cpu = 0;
|
||||
int64_t ret = 0;
|
||||
|
||||
attr.type = pSysmanKmdInterface->getEventType(isIntegratedDevice);
|
||||
attr.type = pSysmanKmdInterface->getEventType();
|
||||
if (attr.type == 0) {
|
||||
return -ENOENT;
|
||||
}
|
||||
@@ -63,7 +62,6 @@ int PmuInterfaceImp::pmuRead(int fd, uint64_t *data, ssize_t sizeOfdata) {
|
||||
}
|
||||
|
||||
PmuInterfaceImp::PmuInterfaceImp(LinuxSysmanImp *pLinuxSysmanImp) {
|
||||
pDevice = pLinuxSysmanImp->getSysmanDeviceImp();
|
||||
pSysmanKmdInterface = pLinuxSysmanImp->getSysmanKmdInterface();
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ class PmuInterfaceImp : public PmuInterface, NEO::NonCopyableAndNonMovableClass
|
||||
SysmanKmdInterface *pSysmanKmdInterface = nullptr;
|
||||
|
||||
private:
|
||||
SysmanDeviceImp *pDevice = nullptr;
|
||||
static const std::string deviceDir;
|
||||
static const std::string sysDevicesDir;
|
||||
};
|
||||
|
||||
@@ -61,6 +61,7 @@ ze_result_t LinuxSysmanImp::init() {
|
||||
if (result != ZE_RESULT_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
pSysmanKmdInterface->setSysmanDeviceDirName(getSysmanDeviceImp()->getRootDeviceEnvironment().getHardwareInfo()->capabilityTable.isIntegratedDevice);
|
||||
pFsAccess = pSysmanKmdInterface->getFsAccess();
|
||||
pProcfsAccess = pSysmanKmdInterface->getProcFsAccess();
|
||||
pSysfsAccess = pSysmanKmdInterface->getSysFsAccess();
|
||||
|
||||
@@ -53,7 +53,8 @@ class ZesEngineFixtureI915 : public ZesEngineFixture {
|
||||
pLinuxSysmanImp->pPmuInterface = pPmuInterface.get();
|
||||
|
||||
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
|
||||
pSysmanDeviceImp->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.isIntegratedDevice = true;
|
||||
bool isIntegratedDevice = true;
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
device = pSysmanDevice;
|
||||
getEngineHandles(0);
|
||||
}
|
||||
@@ -138,7 +139,8 @@ TEST_F(ZesEngineFixtureI915, GivenValidEngineHandleAndIntegratedDeviceWhenCallin
|
||||
}
|
||||
|
||||
TEST_F(ZesEngineFixtureI915, GivenValidEngineHandleAndDiscreteDeviceWhenCallingZesEngineGetActivityThenVerifyCallReturnsSuccess) {
|
||||
pSysmanDeviceImp->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.isIntegratedDevice = false;
|
||||
bool isIntegratedDevice = false;
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
zes_engine_stats_t stats = {};
|
||||
auto handles = getEngineHandles(handleComponentCount);
|
||||
EXPECT_EQ(handleComponentCount, handles.size());
|
||||
|
||||
@@ -49,7 +49,8 @@ class ZesEngineFixturePrelim : public SysmanDeviceFixture {
|
||||
pLinuxSysmanImp->pPmuInterface = pPmuInterface.get();
|
||||
|
||||
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
|
||||
pSysmanDeviceImp->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.isIntegratedDevice = true;
|
||||
bool isIntegratedDevice = true;
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
device = pSysmanDevice;
|
||||
getEngineHandles(0);
|
||||
}
|
||||
@@ -85,7 +86,6 @@ TEST_F(SysmanDeviceFixture, GivenComponentCountZeroAndOpenCallFailsWhenCallingZe
|
||||
osInterface->setDriverModel(std::unique_ptr<MockEngineNeoDrmPrelim>(pDrm));
|
||||
|
||||
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
|
||||
pSysmanDeviceImp->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.isIntegratedDevice = true;
|
||||
L0::Sysman::SysmanDevice *device = pSysmanDevice;
|
||||
|
||||
uint32_t count = 0;
|
||||
@@ -199,7 +199,8 @@ TEST_F(ZesEngineFixturePrelim, GivenValidEngineHandleAndPmuTimeStampIsZeroWhenCa
|
||||
|
||||
TEST_F(ZesEngineFixturePrelim, GivenValidEngineHandleAndDiscreteDeviceWhenCallingZesEngineGetActivityThenVerifyCallReturnsSuccess) {
|
||||
|
||||
pSysmanDeviceImp->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.isIntegratedDevice = false;
|
||||
bool isIntegratedDevice = false;
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
zes_engine_stats_t stats = {};
|
||||
auto handles = getEngineHandles(handleComponentCount);
|
||||
EXPECT_EQ(handleComponentCount, handles.size());
|
||||
@@ -404,7 +405,8 @@ class ZesEngineMultiFixturePrelim : public SysmanMultiDeviceFixture {
|
||||
pDrm->mockReadSysmanQueryEngineInfoMultiDevice = true;
|
||||
|
||||
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
|
||||
pSysmanDeviceImp->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.isIntegratedDevice = true;
|
||||
bool isIntegratedDevice = true;
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
device = pSysmanDevice;
|
||||
getEngineHandles(0);
|
||||
}
|
||||
|
||||
@@ -53,8 +53,8 @@ class ZesEngineFixtureXe : public SysmanDeviceFixture {
|
||||
pLinuxSysmanImp->pPmuInterface = pPmuInterface.get();
|
||||
|
||||
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
|
||||
pSysmanDeviceImp->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.isIntegratedDevice = true;
|
||||
|
||||
bool isIntegratedDevice = true;
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
getEngineHandles(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -84,9 +84,8 @@ TEST_F(SysmanPmuFixture, GivenValidPmuHandleWhenCallingPmuInterfaceOpenAndPerfEv
|
||||
});
|
||||
|
||||
uint64_t config = 10;
|
||||
auto &rootDeviceEnvironment = pLinuxSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironment();
|
||||
auto mutableHwInfo = rootDeviceEnvironment.getMutableHardwareInfo();
|
||||
mutableHwInfo->capabilityTable.isIntegratedDevice = true;
|
||||
bool isIntegratedDevice = true;
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
EXPECT_EQ(mockPmuFd, pLinuxSysmanImp->pPmuInterface->pmuInterfaceOpen(config, -1, PERF_FORMAT_TOTAL_TIME_ENABLED));
|
||||
}
|
||||
|
||||
@@ -124,9 +123,8 @@ TEST_F(SysmanPmuFixture, GivenValidPmuHandleWhenCallingPmuInterfaceOpenAndPerfEv
|
||||
|
||||
pPmuInterface->perfEventOpenResult = -1;
|
||||
uint64_t config = 10;
|
||||
auto &rootDeviceEnvironment = pLinuxSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironment();
|
||||
auto mutableHwInfo = rootDeviceEnvironment.getMutableHardwareInfo();
|
||||
mutableHwInfo->capabilityTable.isIntegratedDevice = true;
|
||||
bool isIntegratedDevice = true;
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
EXPECT_EQ(-1, pLinuxSysmanImp->pPmuInterface->pmuInterfaceOpen(config, -1, PERF_FORMAT_TOTAL_TIME_ENABLED));
|
||||
}
|
||||
|
||||
@@ -143,9 +141,8 @@ TEST_F(SysmanPmuFixture, GivenValidPmuHandleWhenCallingPmuInterfaceOpenAndPerfEv
|
||||
pPmuInterface->perfEventOpenResult = -1;
|
||||
pPmuInterface->getErrorNoResult = EBADF;
|
||||
uint64_t config = 10;
|
||||
auto &rootDeviceEnvironment = pLinuxSysmanImp->getSysmanDeviceImp()->getRootDeviceEnvironment();
|
||||
auto mutableHwInfo = rootDeviceEnvironment.getMutableHardwareInfo();
|
||||
mutableHwInfo->capabilityTable.isIntegratedDevice = true;
|
||||
bool isIntegratedDevice = true;
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
EXPECT_EQ(-1, pLinuxSysmanImp->pPmuInterface->pmuInterfaceOpen(config, -1, PERF_FORMAT_TOTAL_TIME_ENABLED));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2024 Intel Corporation
|
||||
* Copyright (C) 2024-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -26,6 +26,8 @@ class SysmanFixtureDeviceXe : public SysmanDeviceFixture {
|
||||
pLinuxSysmanImp->pSysmanKmdInterface.reset(new SysmanKmdInterfaceXe(pLinuxSysmanImp->getSysmanProductHelper()));
|
||||
mockInitFsAccess();
|
||||
pPmuInterface->pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
bool isIntegratedDevice = false;
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
|
||||
@@ -67,6 +67,8 @@ class SysmanFixtureDeviceI915Prelim : public SysmanDeviceFixture {
|
||||
pPmuInterface->pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
VariableBackup<L0::Sysman::PmuInterface *> pmuBackup(&pLinuxSysmanImp->pPmuInterface);
|
||||
pLinuxSysmanImp->pPmuInterface = pPmuInterface.get();
|
||||
bool isIntegratedDevice = false;
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
}
|
||||
|
||||
void mockInitFsAccess() {
|
||||
@@ -156,9 +158,11 @@ TEST_F(SysmanFixtureDeviceI915Prelim, GivenSysmanKmdInterfaceInstanceAndIsIntegr
|
||||
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsPread)> mockPread(&NEO::SysCalls::sysCallsPread, &mockReadSuccess);
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
bool isIntegratedDevice = true;
|
||||
EXPECT_EQ(mockReadVal, pSysmanKmdInterface->getEventType(isIntegratedDevice));
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
EXPECT_EQ(mockReadVal, pSysmanKmdInterface->getEventType());
|
||||
}
|
||||
|
||||
TEST_F(SysmanFixtureDeviceI915Prelim, GivenSysmanKmdInterfaceInstanceAndIsNotIntegratedDeviceWhenGetEventsIsCalledThenValidEventTypeIsReturned) {
|
||||
@@ -167,8 +171,7 @@ TEST_F(SysmanFixtureDeviceI915Prelim, GivenSysmanKmdInterfaceInstanceAndIsNotInt
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsPread)> mockPread(&NEO::SysCalls::sysCallsPread, &mockReadSuccess);
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
bool isIntegratedDevice = false;
|
||||
EXPECT_EQ(mockReadVal, pSysmanKmdInterface->getEventType(isIntegratedDevice));
|
||||
EXPECT_EQ(mockReadVal, pSysmanKmdInterface->getEventType());
|
||||
}
|
||||
|
||||
TEST_F(SysmanFixtureDeviceI915Prelim, GivenSysmanKmdInterfaceInstanceAndIsNotIntegratedDeviceAndReadSymLinkFailsWhenGetEventsIsCalledThenFailureIsReturned) {
|
||||
@@ -176,8 +179,7 @@ TEST_F(SysmanFixtureDeviceI915Prelim, GivenSysmanKmdInterfaceInstanceAndIsNotInt
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsReadlink)> mockReadLink(&NEO::SysCalls::sysCallsReadlink, &mockReadLinkFailure);
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
bool isIntegratedDevice = false;
|
||||
EXPECT_EQ(0u, pSysmanKmdInterface->getEventType(isIntegratedDevice));
|
||||
EXPECT_EQ(0u, pSysmanKmdInterface->getEventType());
|
||||
}
|
||||
|
||||
TEST_F(SysmanFixtureDeviceI915Prelim, GivenSysmanKmdInterfaceInstanceAndIsNotIntegratedDeviceAndFsReadFailsWhenGetEventsIsCalledThenFailureIsReturned) {
|
||||
@@ -185,8 +187,7 @@ TEST_F(SysmanFixtureDeviceI915Prelim, GivenSysmanKmdInterfaceInstanceAndIsNotInt
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsPread)> mockPread(&NEO::SysCalls::sysCallsPread, &mockReadFailure);
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
bool isIntegratedDevice = false;
|
||||
EXPECT_EQ(0u, pSysmanKmdInterface->getEventType(isIntegratedDevice));
|
||||
EXPECT_EQ(0u, pSysmanKmdInterface->getEventType());
|
||||
}
|
||||
|
||||
TEST_F(SysmanFixtureDeviceI915Prelim, GivenSysmanKmdInterfaceInstanceWhenCheckingAvailabilityOfFrequencyFilesThenTrueValueIsReturned) {
|
||||
|
||||
@@ -56,12 +56,15 @@ class SysmanFixtureDeviceI915Upstream : public SysmanDeviceFixture {
|
||||
std::unique_ptr<MockPmuInterfaceImp> pPmuInterface;
|
||||
|
||||
void SetUp() override {
|
||||
|
||||
SysmanDeviceFixture::SetUp();
|
||||
device = pSysmanDevice;
|
||||
pPmuInterface = std::make_unique<MockPmuInterfaceImp>(pLinuxSysmanImp);
|
||||
pPmuInterface->pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
VariableBackup<L0::Sysman::PmuInterface *> pmuBackup(&pLinuxSysmanImp->pPmuInterface);
|
||||
pLinuxSysmanImp->pPmuInterface = pPmuInterface.get();
|
||||
bool isIntegratedDevice = false;
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
@@ -233,9 +236,11 @@ TEST_F(SysmanFixtureDeviceI915Upstream, GivenSysmanKmdInterfaceInstanceAndIsInte
|
||||
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsPread)> mockPread(&NEO::SysCalls::sysCallsPread, &mockReadSuccess);
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
bool isIntegratedDevice = true;
|
||||
EXPECT_EQ(mockReadVal, pSysmanKmdInterface->getEventType(isIntegratedDevice));
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
EXPECT_EQ(mockReadVal, pSysmanKmdInterface->getEventType());
|
||||
}
|
||||
|
||||
TEST_F(SysmanFixtureDeviceI915Upstream, GivenSysmanKmdInterfaceInstanceAndIsNotIntegratedDeviceWhenGetEventsIsCalledThenValidEventTypeIsReturned) {
|
||||
@@ -244,8 +249,7 @@ TEST_F(SysmanFixtureDeviceI915Upstream, GivenSysmanKmdInterfaceInstanceAndIsNotI
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsPread)> mockPread(&NEO::SysCalls::sysCallsPread, &mockReadSuccess);
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
bool isIntegratedDevice = false;
|
||||
EXPECT_EQ(mockReadVal, pSysmanKmdInterface->getEventType(isIntegratedDevice));
|
||||
EXPECT_EQ(mockReadVal, pSysmanKmdInterface->getEventType());
|
||||
}
|
||||
|
||||
TEST_F(SysmanFixtureDeviceI915Upstream, GivenSysmanKmdInterfaceInstanceAndIsNotIntegratedDeviceAndReadSymLinkFailsWhenGetEventsIsCalledThenFailureIsReturned) {
|
||||
@@ -253,8 +257,7 @@ TEST_F(SysmanFixtureDeviceI915Upstream, GivenSysmanKmdInterfaceInstanceAndIsNotI
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsReadlink)> mockReadLink(&NEO::SysCalls::sysCallsReadlink, &mockReadLinkFailure);
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
bool isIntegratedDevice = false;
|
||||
EXPECT_EQ(0u, pSysmanKmdInterface->getEventType(isIntegratedDevice));
|
||||
EXPECT_EQ(0u, pSysmanKmdInterface->getEventType());
|
||||
}
|
||||
|
||||
TEST_F(SysmanFixtureDeviceI915Upstream, GivenSysmanKmdInterfaceInstanceAndIsNotIntegratedDeviceAndFsReadFailsWhenGetEventsIsCalledThenFailureIsReturned) {
|
||||
@@ -262,8 +265,7 @@ TEST_F(SysmanFixtureDeviceI915Upstream, GivenSysmanKmdInterfaceInstanceAndIsNotI
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsPread)> mockPread(&NEO::SysCalls::sysCallsPread, &mockReadFailure);
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
bool isIntegratedDevice = false;
|
||||
EXPECT_EQ(0u, pSysmanKmdInterface->getEventType(isIntegratedDevice));
|
||||
EXPECT_EQ(0u, pSysmanKmdInterface->getEventType());
|
||||
}
|
||||
|
||||
TEST_F(SysmanFixtureDeviceI915Upstream, GivenSysmanKmdInterfaceInstanceWhenCheckingSupportForSettingSchedulerModesThenTrueValueIsReturned) {
|
||||
|
||||
@@ -143,9 +143,11 @@ TEST_F(SysmanFixtureDeviceXe, GivenSysmanKmdInterfaceAndIsIntegratedDeviceInstan
|
||||
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsPread)> mockPread(&NEO::SysCalls::sysCallsPread, &mockReadSuccess);
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
bool isIntegratedDevice = true;
|
||||
EXPECT_EQ(mockReadVal, pSysmanKmdInterface->getEventType(isIntegratedDevice));
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
EXPECT_EQ(mockReadVal, pSysmanKmdInterface->getEventType());
|
||||
}
|
||||
|
||||
TEST_F(SysmanFixtureDeviceXe, GivenSysmanKmdInterfaceAndIsNotIntegratedDeviceInstanceWhenGetEventsIsCalledThenValidEventTypeIsReturned) {
|
||||
@@ -154,8 +156,7 @@ TEST_F(SysmanFixtureDeviceXe, GivenSysmanKmdInterfaceAndIsNotIntegratedDeviceIns
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsPread)> mockPread(&NEO::SysCalls::sysCallsPread, &mockReadSuccess);
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
bool isIntegratedDevice = false;
|
||||
EXPECT_EQ(mockReadVal, pSysmanKmdInterface->getEventType(isIntegratedDevice));
|
||||
EXPECT_EQ(mockReadVal, pSysmanKmdInterface->getEventType());
|
||||
}
|
||||
|
||||
TEST_F(SysmanFixtureDeviceXe, GivenSysmanKmdInterfaceInstanceAndIsNotIntegratedDeviceAndReadSymLinkFailsWhenGetEventsIsCalledThenFailureIsReturned) {
|
||||
@@ -163,8 +164,7 @@ TEST_F(SysmanFixtureDeviceXe, GivenSysmanKmdInterfaceInstanceAndIsNotIntegratedD
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsReadlink)> mockReadLink(&NEO::SysCalls::sysCallsReadlink, &mockReadLinkFailure);
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
bool isIntegratedDevice = false;
|
||||
EXPECT_EQ(0u, pSysmanKmdInterface->getEventType(isIntegratedDevice));
|
||||
EXPECT_EQ(0u, pSysmanKmdInterface->getEventType());
|
||||
}
|
||||
|
||||
TEST_F(SysmanFixtureDeviceXe, GivenSysmanKmdInterfaceInstanceAndIsNotIntegratedDeviceAndFsReadFailsWhenGetEventsIsCalledThenFailureIsReturned) {
|
||||
@@ -172,8 +172,7 @@ TEST_F(SysmanFixtureDeviceXe, GivenSysmanKmdInterfaceInstanceAndIsNotIntegratedD
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsPread)> mockPread(&NEO::SysCalls::sysCallsPread, &mockReadFailure);
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
bool isIntegratedDevice = false;
|
||||
EXPECT_EQ(0u, pSysmanKmdInterface->getEventType(isIntegratedDevice));
|
||||
EXPECT_EQ(0u, pSysmanKmdInterface->getEventType());
|
||||
}
|
||||
|
||||
TEST_F(SysmanFixtureDeviceXe, GivenSysmanKmdInterfaceInstanceWhenCheckingSupportForSettingSchedulerModesThenFalseValueIsReturned) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2024 Intel Corporation
|
||||
* Copyright (C) 2024-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -54,7 +54,8 @@ class ZesVfFixturePrelim : public SysmanDeviceFixture {
|
||||
pOriginalPmuInterface = pLinuxSysmanImp->pPmuInterface;
|
||||
pPmuInterface->pSysmanKmdInterface = pLinuxSysmanImp->pSysmanKmdInterface.get();
|
||||
pLinuxSysmanImp->pPmuInterface = pPmuInterface.get();
|
||||
pSysmanDeviceImp->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.isIntegratedDevice = true;
|
||||
bool isIntegratedDevice = true;
|
||||
pLinuxSysmanImp->pSysmanKmdInterface->setSysmanDeviceDirName(isIntegratedDevice);
|
||||
device = pSysmanDevice;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user