Add mechanism to avoid calling gdi calls while process exit

Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
This commit is contained in:
Kamil Diedrich
2022-05-17 15:23:15 +00:00
committed by Compute-Runtime-Automation
parent 673a6244ee
commit ddd8a08fac
49 changed files with 327 additions and 107 deletions

View File

@@ -55,8 +55,9 @@ class ZesDiagnosticsFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pMockFwInterface.reset(nullptr);
pLinuxSysmanImp->pFwUtilInterface = pFwUtilInterfaceOld;
SysmanDeviceFixture::TearDown();
}
void clearAndReinitHandles(std::vector<ze_device_handle_t> &deviceHandles) {

View File

@@ -76,12 +76,13 @@ class ZesEngineFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
device->getDriverHandle()->setMemoryManager(pMemoryManagerOriginal);
pLinuxSysmanImp->pDrm = pOriginalDrm;
pLinuxSysmanImp->pPmuInterface = pOriginalPmuInterface;
pLinuxSysmanImp->pSysfsAccess = pSysfsAccessOriginal;
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
SysmanDeviceFixture::TearDown();
}
std::vector<zes_engine_handle_t> getEngineHandles(uint32_t count) {

View File

@@ -52,9 +52,9 @@ class ZesFirmwareFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pFwUtilInterface = pFwUtilInterfaceOld;
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
SysmanDeviceFixture::TearDown();
}
std::vector<zes_firmware_handle_t> getFirmwareHandles(uint32_t count) {

View File

@@ -85,8 +85,8 @@ class SysmanDeviceFrequencyFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pSysfsAccess = pSysfsAccessOld;
SysmanDeviceFixture::TearDown();
}
double clockValue(const double calculatedClock) {

View File

@@ -148,10 +148,11 @@ class SysmanGlobalOperationsFixture : public SysmanDeviceFixture {
pSysmanDeviceImp->pDiagnosticsHandleContext = pDiagnosticsHandleContextOld;
pSysmanDeviceImp->pFirmwareHandleContext = pFirmwareHandleContextOld;
pSysmanDeviceImp->pRasHandleContext = pRasHandleContextOld;
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pSysfsAccess = pSysfsAccessOld;
pLinuxSysmanImp->pProcfsAccess = pProcfsAccessOld;
pLinuxSysmanImp->pFsAccess = pFsAccessOld;
SysmanDeviceFixture::TearDown();
}
};
class SysmanGlobalOperationsIntegratedFixture : public SysmanGlobalOperationsFixture {
@@ -237,7 +238,7 @@ TEST_F(SysmanGlobalOperationsFixture, GivenValidDeviceHandleWhenCallingzesDevice
TEST_F(SysmanGlobalOperationsFixture, GivenValidDeviceHandleWhenCallingzesDeviceGetPropertiesForCheckingDevicePropertiesWhenVendorIsUnKnownThenVerifyzesDeviceGetPropertiesCallSucceeds) {
ON_CALL(*pSysfsAccess.get(), read(_, Matcher<std::string &>(_)))
.WillByDefault(::testing::Invoke(pSysfsAccess.get(), &Mock<GlobalOperationsSysfsAccess>::getFalseValString));
neoDevice->deviceInfo.vendorId = 1806; //Unknown Vendor id
neoDevice->deviceInfo.vendorId = 1806; // Unknown Vendor id
pGlobalOperationsImp->init();
zes_device_properties_t properties;
ze_result_t result = zesDeviceGetProperties(device, &properties);

View File

@@ -85,6 +85,7 @@ class SysmanDeviceFixture : public DeviceFixture, public ::testing::Test {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
DeviceFixture::TearDown();
unsetenv("ZES_ENABLE_SYSMAN");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -45,9 +45,9 @@ struct SysmanPmuFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pPmuInterface = pOriginalPmuInterface;
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
SysmanDeviceFixture::TearDown();
}
};

View File

@@ -54,11 +54,11 @@ class SysmanDeviceMemoryFixture : public SysmanDeviceFixture {
GTEST_SKIP();
}
device->getDriverHandle()->setMemoryManager(pMemoryManagerOld);
SysmanDeviceFixture::TearDown();
if (pMemoryManager != nullptr) {
delete pMemoryManager;
pMemoryManager = nullptr;
}
SysmanDeviceFixture::TearDown();
}
void setLocalSupportedAndReinit(bool supported) {

View File

@@ -66,7 +66,6 @@ class SysmanDeviceMemoryFixture : public SysmanDeviceFixture {
GTEST_SKIP();
}
device->getDriverHandle()->setMemoryManager(pMemoryManagerOld);
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pDrm = pOriginalDrm;
if (pDrm != nullptr) {
delete pDrm;
@@ -76,6 +75,7 @@ class SysmanDeviceMemoryFixture : public SysmanDeviceFixture {
delete pMemoryManager;
pMemoryManager = nullptr;
}
SysmanDeviceFixture::TearDown();
}
void setLocalSupportedAndReinit(bool supported) {

View File

@@ -198,7 +198,6 @@ class ZesPciFixture : public SysmanDeviceFixture {
GTEST_SKIP();
}
device->getDriverHandle()->setMemoryManager(pMemoryManagerOld);
SysmanDeviceFixture::TearDown();
if (nullptr != pPciImp->pOsPci) {
delete pPciImp->pOsPci;
}
@@ -211,6 +210,7 @@ class ZesPciFixture : public SysmanDeviceFixture {
delete memoryManager;
memoryManager = nullptr;
}
SysmanDeviceFixture::TearDown();
}
};

View File

@@ -396,9 +396,9 @@ class SysmanDevicePowerFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
pLinuxSysmanImp->pSysfsAccess = pSysfsAccessOld;
SysmanDeviceFixture::TearDown();
}
std::vector<zes_pwr_handle_t> getPowerHandles(uint32_t count) {
@@ -474,10 +474,10 @@ class SysmanDevicePowerMultiDeviceFixture : public SysmanMultiDeviceFixture {
for (const auto &pmtMapElement : pLinuxSysmanImp->mapOfSubDeviceIdToPmtObject) {
delete pmtMapElement.second;
}
SysmanMultiDeviceFixture::TearDown();
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
pLinuxSysmanImp->pSysfsAccess = pSysfsAccessOld;
pLinuxSysmanImp->mapOfSubDeviceIdToPmtObject = mapOriginal;
SysmanMultiDeviceFixture::TearDown();
}
std::vector<zes_pwr_handle_t> getPowerHandles(uint32_t count) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -58,8 +58,8 @@ class SysmanDevicePowerFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pWddmSysmanImp->pKmdSysManager = pOriginalKmdSysManager;
SysmanDeviceFixture::TearDown();
}
std::vector<zes_pwr_handle_t> get_power_handles(uint32_t count) {

View File

@@ -49,8 +49,8 @@ struct SysmanRasFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
SysmanDeviceFixture::TearDown();
}
std::vector<zes_ras_handle_t> getRasHandles(uint32_t count) {

View File

@@ -92,8 +92,8 @@ class SysmanDeviceSchedulerFixture : public SysmanDeviceFixture {
GTEST_SKIP();
}
pSysfsAccess->cleanUpMap();
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pSysfsAccess = pSysfsAccessOld;
SysmanDeviceFixture::TearDown();
}
std::vector<zes_sched_handle_t> getSchedHandles(uint32_t count) {

View File

@@ -124,8 +124,8 @@ class SysmanMultiDeviceTemperatureFixture : public SysmanMultiDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanMultiDeviceFixture::TearDown();
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
SysmanMultiDeviceFixture::TearDown();
}
std::vector<zes_temp_handle_t> getTempHandles(uint32_t count) {
@@ -244,8 +244,8 @@ class SysmanDeviceTemperatureFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
SysmanDeviceFixture::TearDown();
}
std::vector<zes_temp_handle_t> getTempHandles(uint32_t count) {