Refactor: don't use global GfxCoreHelper getter in shared files 1/n

Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2022-12-27 15:26:22 +00:00
committed by Compute-Runtime-Automation
parent 9934a24174
commit a55680e82e
7 changed files with 21 additions and 14 deletions

View File

@@ -72,7 +72,7 @@ void DrmMockCustom::testIoctls() {
int DrmMockCustom::ioctl(DrmIoctl request, void *arg) {
auto ext = ioctl_res_ext.load();
//store flags
// store flags
switch (request) {
case DrmIoctl::GemExecbuffer2: {
auto execbuf = static_cast<NEO::MockExecBuffer *>(arg);
@@ -111,7 +111,7 @@ int DrmMockCustom::ioctl(DrmIoctl request, void *arg) {
} break;
case DrmIoctl::PrimeFdToHandle: {
auto *primeToHandleParams = static_cast<NEO::PrimeHandle *>(arg);
//return BO
// return BO
primeToHandleParams->handle = outputHandle;
inputFd = primeToHandleParams->fileDescriptor;
ioctl_cnt.primeFdToHandle++;
@@ -121,7 +121,7 @@ int DrmMockCustom::ioctl(DrmIoctl request, void *arg) {
} break;
case DrmIoctl::PrimeHandleToFd: {
auto *handleToPrimeParams = static_cast<NEO::PrimeHandle *>(arg);
//return FD
// return FD
inputHandle = handleToPrimeParams->handle;
inputFlags = handleToPrimeParams->flags;
handleToPrimeParams->fileDescriptor = outputFd;
@@ -220,7 +220,8 @@ int DrmMockCustom::ioctl(DrmIoctl request, void *arg) {
DrmMockCustom::DrmMockCustom(RootDeviceEnvironment &rootDeviceEnvironment)
: Drm(std::make_unique<HwDeviceIdDrm>(mockFd, mockPciPath), rootDeviceEnvironment) {
reset();
ioctl_expected.contextCreate = static_cast<int>(NEO::GfxCoreHelper::get(NEO::defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*NEO::defaultHwInfo).size());
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<NEO::GfxCoreHelper>();
ioctl_expected.contextCreate = static_cast<int>(gfxCoreHelper.getGpgpuEngineInstances(*NEO::defaultHwInfo).size());
ioctl_expected.contextDestroy = ioctl_expected.contextCreate.load();
setupIoctlHelper(rootDeviceEnvironment.getHardwareInfo()->platform.eProductFamily);
createVirtualMemoryAddressSpace(NEO::GfxCoreHelper::getSubDevicesCount(rootDeviceEnvironment.getHardwareInfo()));

View File

@@ -46,7 +46,8 @@ struct WddmFixture : public Test<MockExecutionEnvironmentGmmFixture> {
auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo);
wddm->init();
auto hwInfo = rootDeviceEnvironment->getHardwareInfo();
auto engine = GfxCoreHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0];
auto &gfxCoreHelper = rootDeviceEnvironment->getHelper<GfxCoreHelper>();
auto engine = gfxCoreHelper.getGpgpuEngineInstances(*hwInfo)[0];
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(engine, preemptionMode));
osContext->ensureContextInitialized();
mockTemporaryResources = static_cast<MockWddmResidentAllocationsContainer *>(wddm->temporaryResources.get());
@@ -77,7 +78,8 @@ struct WddmFixtureLuid : public Test<MockExecutionEnvironmentGmmFixture> {
auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo);
wddm->init();
auto hwInfo = rootDeviceEnvironment->getHardwareInfo();
auto engine = GfxCoreHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0];
auto &gfxCoreHelper = rootDeviceEnvironment->getHelper<GfxCoreHelper>();
auto engine = gfxCoreHelper.getGpgpuEngineInstances(*hwInfo)[0];
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(engine, preemptionMode));
osContext->ensureContextInitialized();
mockTemporaryResources = static_cast<MockWddmResidentAllocationsContainer *>(wddm->temporaryResources.get());
@@ -114,7 +116,8 @@ struct WddmFixtureWithMockGdiDll : public GdiDllFixture, public MockExecutionEnv
wddm->wddmInterface.reset(wddmMockInterface);
auto hwInfo = rootDeviceEnvironment->getHardwareInfo();
auto engine = GfxCoreHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0];
auto &gfxCoreHelper = rootDeviceEnvironment->getHelper<GfxCoreHelper>();
auto engine = gfxCoreHelper.getGpgpuEngineInstances(*hwInfo)[0];
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(engine, preemptionMode));
osContext->ensureContextInitialized();
}
@@ -162,7 +165,8 @@ struct WddmFixtureWithMockGdiDllWddmNoCleanup : public GdiDllFixture, public Moc
wddm->wddmInterface.reset(wddmMockInterface);
auto hwInfo = rootDeviceEnvironment->getHardwareInfo();
auto engine = GfxCoreHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0];
auto &gfxCoreHelper = rootDeviceEnvironment->getHelper<GfxCoreHelper>();
auto engine = gfxCoreHelper.getGpgpuEngineInstances(*hwInfo)[0];
osContext = std::make_unique<OsContextWin>(*osInterface->getDriverModel()->as<Wddm>(), 0, 0u, EngineDescriptorHelper::getDefaultDescriptor(engine, preemptionMode));
osContext->ensureContextInitialized();
}