mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 06:23:01 +08:00
Create HardwareContext only when osContext is available
Change-Id: I8bcf2cb20f0e1e6b9da98b477f5be206407a7a57 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2018 Intel Corporation
|
||||
* Copyright (C) 2017-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -48,7 +48,7 @@ class DrmCommandStreamFixture {
|
||||
ASSERT_NE(nullptr, csr);
|
||||
executionEnvironment.commandStreamReceivers.resize(1);
|
||||
executionEnvironment.commandStreamReceivers[0][0].reset(csr);
|
||||
csr->setOsContext(*osContext);
|
||||
csr->setupContext(*osContext);
|
||||
|
||||
// Memory manager creates pinBB with ioctl, expect one call
|
||||
EXPECT_CALL(*mock, ioctl(::testing::_, ::testing::_))
|
||||
@@ -255,7 +255,7 @@ TEST_F(DrmCommandStreamTest, givenDrmContextIdWhenFlushingThenSetIdToAllExecBuff
|
||||
|
||||
osContext = std::make_unique<OsContext>(executionEnvironment.osInterface.get(), 1,
|
||||
gpgpuEngineInstances[0], PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]));
|
||||
csr->setOsContext(*osContext);
|
||||
csr->setupContext(*osContext);
|
||||
|
||||
auto &cs = csr->getCS();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2018 Intel Corporation
|
||||
* Copyright (C) 2017-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -250,7 +250,7 @@ TEST(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIsOf
|
||||
executionEnvironment->memoryManager.reset(executionEnvironment->commandStreamReceivers[0][0]->createMemoryManager(false, false));
|
||||
executionEnvironment->commandStreamReceivers[0][0]->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
|
||||
OsContext osContext(executionEnvironment->osInterface.get(), 0u, gpgpuEngineInstances[0], PreemptionHelper::getDefaultPreemptionMode(*hwInfo));
|
||||
executionEnvironment->commandStreamReceivers[0][0]->setOsContext(osContext);
|
||||
executionEnvironment->commandStreamReceivers[0][0]->setupContext(osContext);
|
||||
|
||||
auto commandBuffer = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||
LinearStream cs(commandBuffer);
|
||||
@@ -275,7 +275,7 @@ TEST(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIsOn
|
||||
executionEnvironment->memoryManager.reset(executionEnvironment->commandStreamReceivers[0][0]->createMemoryManager(false, false));
|
||||
executionEnvironment->commandStreamReceivers[0][0]->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
|
||||
OsContext osContext(executionEnvironment->osInterface.get(), 0u, gpgpuEngineInstances[0], PreemptionHelper::getDefaultPreemptionMode(*hwInfo));
|
||||
executionEnvironment->commandStreamReceivers[0][0]->setOsContext(osContext);
|
||||
executionEnvironment->commandStreamReceivers[0][0]->setupContext(osContext);
|
||||
|
||||
auto commandBuffer = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||
LinearStream cs(commandBuffer);
|
||||
|
||||
@@ -1466,7 +1466,7 @@ TEST(WddmMemoryManagerCleanupTest, givenUsedTagAllocationInWddmMemoryManagerWhen
|
||||
executionEnvironment.commandStreamReceivers[0][0] = std::unique_ptr<CommandStreamReceiver>(csr);
|
||||
|
||||
executionEnvironment.memoryManager = std::make_unique<WddmMemoryManager>(false, false, wddm, executionEnvironment);
|
||||
csr->setOsContext(*executionEnvironment.memoryManager->createAndRegisterOsContext(gpgpuEngineInstances[0], preemptionMode));
|
||||
csr->setupContext(*executionEnvironment.memoryManager->createAndRegisterOsContext(gpgpuEngineInstances[0], preemptionMode));
|
||||
EXPECT_EQ(csr, executionEnvironment.memoryManager->getDefaultCommandStreamReceiver(0));
|
||||
|
||||
auto tagAllocator = csr->getEventPerfCountAllocator();
|
||||
|
||||
Reference in New Issue
Block a user