Pass execution environment to command stream receiver.

Change-Id: I598f67f8b005b5ce8249b638e080657eb6dc3547
This commit is contained in:
Mrozek, Michal
2018-08-08 13:49:09 +02:00
committed by sys_ocldev
parent 287d33d87e
commit 1599ea800e
76 changed files with 362 additions and 334 deletions

View File

@@ -39,19 +39,19 @@ using namespace OCLRT;
typedef Test<DeviceFixture> DeviceCommandStreamLeaksTest;
HWTEST_F(DeviceCommandStreamLeaksTest, Create) {
std::unique_ptr<CommandStreamReceiver> ptr(DeviceCommandStreamReceiver<FamilyType>::create(*platformDevices[0], false));
std::unique_ptr<CommandStreamReceiver> ptr(DeviceCommandStreamReceiver<FamilyType>::create(*platformDevices[0], false, this->executionEnvironment));
DrmMockSuccess mockDrm;
EXPECT_NE(nullptr, ptr);
}
HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultDrmCsrWhenItIsCreatedThenGemCloseWorkerInactiveModeIsSelected) {
std::unique_ptr<CommandStreamReceiver> ptr(DeviceCommandStreamReceiver<FamilyType>::create(*platformDevices[0], false));
std::unique_ptr<CommandStreamReceiver> ptr(DeviceCommandStreamReceiver<FamilyType>::create(*platformDevices[0], false, this->executionEnvironment));
auto drmCsr = (DrmCommandStreamReceiver<FamilyType> *)ptr.get();
EXPECT_EQ(drmCsr->peekGemCloseWorkerOperationMode(), gemCloseWorkerMode::gemCloseWorkerActive);
}
HWTEST_F(DeviceCommandStreamLeaksTest, givenDefaultDrmCsrWithAubDumWhenItIsCreatedThenGemCloseWorkerInactiveModeIsSelected) {
std::unique_ptr<CommandStreamReceiver> ptr(DeviceCommandStreamReceiver<FamilyType>::create(*platformDevices[0], true));
std::unique_ptr<CommandStreamReceiver> ptr(DeviceCommandStreamReceiver<FamilyType>::create(*platformDevices[0], true, this->executionEnvironment));
auto drmCsrWithAubDump = (CommandStreamReceiverWithAUBDump<DrmCommandStreamReceiver<FamilyType>> *)ptr.get();
EXPECT_EQ(drmCsrWithAubDump->peekGemCloseWorkerOperationMode(), gemCloseWorkerMode::gemCloseWorkerActive);
auto aubCSR = static_cast<CommandStreamReceiverWithAUBDump<DrmCommandStreamReceiver<FamilyType>> *>(ptr.get())->aubCSR;

View File

@@ -20,6 +20,7 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "runtime/execution_environment/execution_environment.h"
#include "runtime/os_interface/linux/drm_command_stream.h"
#include "runtime/os_interface/linux/drm_memory_manager.h"
#include "unit_tests/helpers/debug_manager_state_restore.h"
@@ -34,12 +35,13 @@ class DrmCommandStreamMMTest : public ::testing::Test {
HWTEST_F(DrmCommandStreamMMTest, MMwithPinBB) {
DebugManagerStateRestore dbgRestorer;
{
ExecutionEnvironment executionEnvironment;
DebugManager.flags.EnableForcePin.set(true);
std::unique_ptr<DrmMockCustom> mock(new DrmMockCustom());
ASSERT_NE(nullptr, mock);
DrmCommandStreamReceiver<FamilyType> csr(*platformDevices[0], mock.get(), gemCloseWorkerMode::gemCloseWorkerInactive);
DrmCommandStreamReceiver<FamilyType> csr(*platformDevices[0], mock.get(), executionEnvironment, gemCloseWorkerMode::gemCloseWorkerInactive);
auto mm = (DrmMemoryManager *)csr.createMemoryManager(false);
ASSERT_NE(nullptr, mm);
@@ -53,12 +55,13 @@ HWTEST_F(DrmCommandStreamMMTest, MMwithPinBB) {
HWTEST_F(DrmCommandStreamMMTest, givenForcePinDisabledWhenMemoryManagerIsCreatedThenPinBBIsCreated) {
DebugManagerStateRestore dbgRestorer;
{
ExecutionEnvironment executionEnvironment;
DebugManager.flags.EnableForcePin.set(false);
std::unique_ptr<DrmMockCustom> mock(new DrmMockCustom());
ASSERT_NE(nullptr, mock);
DrmCommandStreamReceiver<FamilyType> csr(*platformDevices[0], mock.get(), gemCloseWorkerMode::gemCloseWorkerInactive);
DrmCommandStreamReceiver<FamilyType> csr(*platformDevices[0], mock.get(), executionEnvironment, gemCloseWorkerMode::gemCloseWorkerInactive);
auto mm = (DrmMemoryManager *)csr.createMemoryManager(false);
csr.setMemoryManager(nullptr);

View File

@@ -63,7 +63,7 @@ class DrmCommandStreamFixture {
this->mock = new DrmMockImpl(mockFd);
csr = new DrmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>(*platformDevices[0], mock, gemCloseWorkerMode::gemCloseWorkerActive);
csr = new DrmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>(*platformDevices[0], mock, executionEnvironment, gemCloseWorkerMode::gemCloseWorkerActive);
ASSERT_NE(nullptr, csr);
// Memory manager creates pinBB with ioctl, expect one call
@@ -91,6 +91,7 @@ class DrmCommandStreamFixture {
}
static const uint64_t alignment = MemoryConstants::allocationAlignment;
DebugManagerStateRestore *dbgState;
ExecutionEnvironment executionEnvironment;
};
typedef Test<DrmCommandStreamFixture> DrmCommandStreamTest;
@@ -508,7 +509,7 @@ struct DrmCsrVfeTests : ::testing::Test {
using DrmCommandStreamReceiver<FamilyType>::mediaVfeStateLowPriorityDirty;
using CommandStreamReceiver::commandStream;
MyCsr() : DrmCommandStreamReceiver<FamilyType>(*platformDevices[0], nullptr, gemCloseWorkerMode::gemCloseWorkerInactive) {}
MyCsr(ExecutionEnvironment &executionEnvironment) : DrmCommandStreamReceiver<FamilyType>(*platformDevices[0], nullptr, executionEnvironment, gemCloseWorkerMode::gemCloseWorkerInactive) {}
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer *allocationsForResidency) override {
return (FlushStamp)0;
}
@@ -532,7 +533,7 @@ struct DrmCsrVfeTests : ::testing::Test {
HWCMDTEST_F(IGFX_GEN8_CORE, DrmCsrVfeTests, givenNonDirtyVfeForDefaultContextWhenLowPriorityIsFlushedThenReprogram) {
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto mockCsr = new MyCsr<FamilyType>;
auto mockCsr = new MyCsr<FamilyType>(*device->executionEnvironment);
device->resetCommandStreamReceiver(mockCsr);
@@ -560,7 +561,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DrmCsrVfeTests, givenNonDirtyVfeForDefaultContextWhe
HWCMDTEST_F(IGFX_GEN8_CORE, DrmCsrVfeTests, givenNonDirtyVfeForLowPriorityContextWhenDefaultPriorityIsFlushedThenReprogram) {
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto mockCsr = new MyCsr<FamilyType>;
auto mockCsr = new MyCsr<FamilyType>(*device->executionEnvironment);
device->resetCommandStreamReceiver(mockCsr);
@@ -588,7 +589,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DrmCsrVfeTests, givenNonDirtyVfeForLowPriorityContex
HWCMDTEST_F(IGFX_GEN8_CORE, DrmCsrVfeTests, givenNonDirtyVfeForLowPriorityContextWhenLowPriorityIsFlushedThenDontReprogram) {
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto mockCsr = new MyCsr<FamilyType>;
auto mockCsr = new MyCsr<FamilyType>(*device->executionEnvironment);
device->resetCommandStreamReceiver(mockCsr);
@@ -616,7 +617,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DrmCsrVfeTests, givenNonDirtyVfeForLowPriorityContex
HWTEST_F(DrmCsrVfeTests, givenNonDirtyVfeForBothPriorityContextWhenFlushedLowWithScratchRequirementThenMakeDefaultDirty) {
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto mockCsr = new MyCsr<FamilyType>;
auto mockCsr = new MyCsr<FamilyType>(*device->executionEnvironment);
device->resetCommandStreamReceiver(mockCsr);
@@ -637,7 +638,7 @@ HWTEST_F(DrmCsrVfeTests, givenNonDirtyVfeForBothPriorityContextWhenFlushedLowWit
HWTEST_F(DrmCsrVfeTests, givenNonDirtyVfeForBothPriorityContextWhenFlushedDefaultWithScratchRequirementThenMakeLowDirty) {
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto mockCsr = new MyCsr<FamilyType>;
auto mockCsr = new MyCsr<FamilyType>(*device->executionEnvironment);
device->resetCommandStreamReceiver(mockCsr);
@@ -668,16 +669,17 @@ class DrmCommandStreamEnhancedFixture
DrmMemoryManager *mm = nullptr;
MockDevice *device = nullptr;
DebugManagerStateRestore *dbgState;
ExecutionEnvironment *executionEnvironment;
void SetUp() {
ExecutionEnvironment *executionEnvironment = new ExecutionEnvironment;
executionEnvironment = new ExecutionEnvironment;
executionEnvironment->initGmm(*platformDevices);
this->dbgState = new DebugManagerStateRestore();
//make sure this is disabled, we don't want test this now
DebugManager.flags.EnableForcePin.set(false);
mock = new DrmMockCustom();
tCsr = new TestedDrmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>(mock);
tCsr = new TestedDrmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>(mock, *executionEnvironment);
csr = tCsr;
ASSERT_NE(nullptr, csr);
mm = reinterpret_cast<DrmMemoryManager *>(csr->createMemoryManager(false));
@@ -710,9 +712,9 @@ class DrmCommandStreamEnhancedFixture
public:
using CommandStreamReceiver::commandStream;
TestedDrmCommandStreamReceiver(Drm *drm, gemCloseWorkerMode mode) : DrmCommandStreamReceiver<GfxFamily>(*platformDevices[0], drm, mode) {
TestedDrmCommandStreamReceiver(Drm *drm, gemCloseWorkerMode mode, ExecutionEnvironment &executionEnvironment) : DrmCommandStreamReceiver<GfxFamily>(*platformDevices[0], drm, executionEnvironment, mode) {
}
TestedDrmCommandStreamReceiver(Drm *drm) : DrmCommandStreamReceiver<GfxFamily>(*platformDevices[0], drm, gemCloseWorkerMode::gemCloseWorkerInactive) {
TestedDrmCommandStreamReceiver(Drm *drm, ExecutionEnvironment &executionEnvironment) : DrmCommandStreamReceiver<GfxFamily>(*platformDevices[0], drm, executionEnvironment, gemCloseWorkerMode::gemCloseWorkerInactive) {
}
void overrideGemCloseWorkerOperationMode(gemCloseWorkerMode overrideValue) {
@@ -923,7 +925,7 @@ TEST_F(DrmCommandStreamGemWorkerTests, givenCommandStreamWithDuplicatesWhenItIsF
}
TEST_F(DrmCommandStreamGemWorkerTests, givenDrmCsrCreatedWithInactiveGemCloseWorkerPolicyThenThreadIsNotCreated) {
TestedDrmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME> testedCsr(mock, gemCloseWorkerMode::gemCloseWorkerInactive);
TestedDrmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME> testedCsr(mock, gemCloseWorkerMode::gemCloseWorkerInactive, *this->executionEnvironment);
EXPECT_EQ(gemCloseWorkerMode::gemCloseWorkerInactive, testedCsr.peekGemCloseWorkerOperationMode());
}

View File

@@ -72,7 +72,7 @@ class WddmCommandStreamFixture {
DebugManager.flags.CsrDispatchMode.set(static_cast<uint32_t>(DispatchMode::ImmediateDispatch));
csr.reset(new WddmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>(*platformDevices[0], wddm));
csr.reset(new WddmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>(*platformDevices[0], wddm, *device->executionEnvironment));
ASSERT_NE(nullptr, csr);
mockWddmMM = new MockWddmMemoryManager(wddm);
@@ -92,7 +92,7 @@ class WddmCommandStreamFixture {
template <typename GfxFamily>
struct MockWddmCsr : public WddmCommandStreamReceiver<GfxFamily> {
MockWddmCsr(const HardwareInfo &hwInfoIn, Wddm *wddm) : WddmCommandStreamReceiver(hwInfoIn, wddm){};
MockWddmCsr(const HardwareInfo &hwInfoIn, Wddm *wddm, ExecutionEnvironment &executionEnvironment) : WddmCommandStreamReceiver(hwInfoIn, wddm, executionEnvironment){};
using CommandStreamReceiver::commandStream;
using CommandStreamReceiver::dispatchMode;
using CommandStreamReceiver::getCS;
@@ -133,7 +133,7 @@ class WddmCommandStreamWithMockGdiFixture {
wddm->gdi.reset(gdi);
ASSERT_NE(wddm, nullptr);
DebugManager.flags.CsrDispatchMode.set(static_cast<uint32_t>(DispatchMode::ImmediateDispatch));
csr = new WddmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>(*platformDevices[0], wddm);
csr = new WddmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>(*platformDevices[0], wddm, *executionEnvironment);
ASSERT_NE(nullptr, csr);
memManager = csr->createMemoryManager(false);
@@ -162,14 +162,14 @@ using WddmDefaultTest = ::Test<WddmCommandStreamFixture>;
using DeviceCommandStreamTest = ::Test<GmmEnvironmentFixture>;
TEST_F(DeviceCommandStreamTest, CreateWddmCSR) {
std::unique_ptr<DeviceCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>> csr(static_cast<DeviceCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME> *>(DeviceCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>::create(DEFAULT_TEST_PLATFORM::hwInfo, false)));
std::unique_ptr<DeviceCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>> csr(static_cast<DeviceCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME> *>(DeviceCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>::create(DEFAULT_TEST_PLATFORM::hwInfo, false, this->executionEnvironment)));
EXPECT_NE(nullptr, csr);
std::unique_ptr<Wddm> wddm(static_cast<WddmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME> *>(csr.get())->peekWddm());
EXPECT_NE(nullptr, wddm);
}
TEST_F(DeviceCommandStreamTest, CreateWddmCSRWithAubDump) {
std::unique_ptr<DeviceCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>> csr(static_cast<DeviceCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME> *>(DeviceCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>::create(DEFAULT_TEST_PLATFORM::hwInfo, true)));
std::unique_ptr<DeviceCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>> csr(static_cast<DeviceCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME> *>(DeviceCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>::create(DEFAULT_TEST_PLATFORM::hwInfo, true, this->executionEnvironment)));
EXPECT_NE(nullptr, csr);
std::unique_ptr<Wddm> wddm(static_cast<WddmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME> *>(csr.get())->peekWddm());
EXPECT_NE(nullptr, wddm);
@@ -248,7 +248,7 @@ TEST(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIsOf
auto localHwInfo = *platformDevices[0];
localHwInfo.capabilityTable.defaultPreemptionMode = PreemptionMode::Disabled;
ExecutionEnvironment executionEnvironment;
executionEnvironment.commandStreamReceiver = std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(localHwInfo, wddm);
executionEnvironment.commandStreamReceiver = std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(localHwInfo, wddm, executionEnvironment);
executionEnvironment.memoryManager.reset(executionEnvironment.commandStreamReceiver->createMemoryManager(false));
executionEnvironment.commandStreamReceiver->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
@@ -270,7 +270,7 @@ TEST(WddmPreemptionHeaderTests, givenWddmCommandStreamReceiverWhenPreemptionIsOn
auto localHwInfo = *platformDevices[0];
localHwInfo.capabilityTable.defaultPreemptionMode = PreemptionMode::MidThread;
ExecutionEnvironment executionEnvironment;
executionEnvironment.commandStreamReceiver = std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(localHwInfo, wddm);
executionEnvironment.commandStreamReceiver = std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(localHwInfo, wddm, executionEnvironment);
executionEnvironment.memoryManager.reset(executionEnvironment.commandStreamReceiver->createMemoryManager(false));
executionEnvironment.commandStreamReceiver->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
@@ -290,7 +290,8 @@ TEST(WddmPreemptionHeaderTests, givenDeviceSupportingPreemptionWhenCommandStream
std::unique_ptr<WddmMock> wddm(static_cast<WddmMock *>(Wddm::createWddm(WddmInterfaceVersion::Wddm20)));
auto localHwInfo = *platformDevices[0];
localHwInfo.capabilityTable.defaultPreemptionMode = PreemptionMode::MidThread;
auto commandStreamReceiver = std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(localHwInfo, wddm.get());
ExecutionEnvironment executionEnvironment;
auto commandStreamReceiver = std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(localHwInfo, wddm.get(), executionEnvironment);
auto commandHeader = commandStreamReceiver->commandBufferHeader;
auto header = reinterpret_cast<COMMAND_BUFFER_HEADER *>(commandHeader);
EXPECT_TRUE(header->NeedsMidBatchPreEmptionSupport);
@@ -300,7 +301,8 @@ TEST(WddmPreemptionHeaderTests, givenDevicenotSupportingPreemptionWhenCommandStr
std::unique_ptr<WddmMock> wddm(static_cast<WddmMock *>(Wddm::createWddm(WddmInterfaceVersion::Wddm20)));
auto localHwInfo = *platformDevices[0];
localHwInfo.capabilityTable.defaultPreemptionMode = PreemptionMode::Disabled;
auto commandStreamReceiver = std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(localHwInfo, wddm.get());
ExecutionEnvironment executionEnvironment;
auto commandStreamReceiver = std::make_unique<MockWddmCsr<DEFAULT_TEST_FAMILY_NAME>>(localHwInfo, wddm.get(), executionEnvironment);
auto commandHeader = commandStreamReceiver->commandBufferHeader;
auto header = reinterpret_cast<COMMAND_BUFFER_HEADER *>(commandHeader);
EXPECT_FALSE(header->NeedsMidBatchPreEmptionSupport);
@@ -698,7 +700,7 @@ HWTEST_F(WddmCommandStreamMockGdiTest, givenRecordedCommandBufferWhenItIsSubmitt
tmpAllocation = GlobalMockSipProgram::sipProgram->getAllocation();
GlobalMockSipProgram::sipProgram->resetAllocation(memManager->allocateGraphicsMemory(1024));
}
auto mockCsr = new MockWddmCsr<FamilyType>(*platformDevices[0], this->wddm);
auto mockCsr = new MockWddmCsr<FamilyType>(*platformDevices[0], this->wddm, *device->executionEnvironment);
mockCsr->setMemoryManager(memManager);
mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
@@ -779,7 +781,7 @@ HWTEST_F(WddmCommandStreamMockGdiTest, givenRecordedCommandBufferWhenItIsSubmitt
HWTEST_F(WddmDefaultTest, givenDefaultWddmCsrWhenItIsCreatedThenBatchingIsTurnedOn) {
DebugManager.flags.CsrDispatchMode.set(0);
std::unique_ptr<MockWddmCsr<FamilyType>> mockCsr(new MockWddmCsr<FamilyType>(*platformDevices[0], this->wddm));
std::unique_ptr<MockWddmCsr<FamilyType>> mockCsr(new MockWddmCsr<FamilyType>(*platformDevices[0], this->wddm, *device->executionEnvironment));
EXPECT_EQ(DispatchMode::BatchedDispatch, mockCsr->dispatchMode);
}
@@ -791,7 +793,7 @@ HWTEST_F(WddmDefaultTest, givenFtrWddmHwQueuesFlagWhenCreatingCsrThenPickWddmVer
myFtrTable.ftrWddmHwQueues = false;
EXPECT_TRUE(WddmInterfaceVersion::Wddm20 == Wddm::pickWddmInterfaceVersion(myHwInfo));
{
WddmCommandStreamReceiver<FamilyType> wddmCsr20(myHwInfo, nullptr);
WddmCommandStreamReceiver<FamilyType> wddmCsr20(myHwInfo, nullptr, *device->executionEnvironment);
auto wddm20 = wddmCsr20.peekWddm();
EXPECT_EQ(typeid(*wddm20), typeid(WddmMock20));
delete wddm20;
@@ -800,7 +802,7 @@ HWTEST_F(WddmDefaultTest, givenFtrWddmHwQueuesFlagWhenCreatingCsrThenPickWddmVer
myFtrTable.ftrWddmHwQueues = true;
EXPECT_TRUE(WddmInterfaceVersion::Wddm23 == Wddm::pickWddmInterfaceVersion(myHwInfo));
{
WddmCommandStreamReceiver<FamilyType> wddmCsr23(myHwInfo, nullptr);
WddmCommandStreamReceiver<FamilyType> wddmCsr23(myHwInfo, nullptr, *device->executionEnvironment);
auto wddm23 = wddmCsr23.peekWddm();
EXPECT_EQ(typeid(*wddm23), typeid(WddmMock23));
delete wddm23;
@@ -835,7 +837,7 @@ HWTEST_F(WddmCsrCompressionTests, givenEnabledCompressionWhenInitializedThenCrea
setCompressionEnabled(compressionEnabled[i][0], compressionEnabled[i][1]);
createMockWddm();
EXPECT_EQ(nullptr, myMockWddm->getPageTableManager());
MockWddmCsr<FamilyType> mockWddmCsr(hwInfo, myMockWddm.get());
MockWddmCsr<FamilyType> mockWddmCsr(hwInfo, myMockWddm.get(), *device->executionEnvironment);
ASSERT_NE(nullptr, myMockWddm->getPageTableManager());
auto mockMngr = reinterpret_cast<MockGmmPageTableMngr *>(myMockWddm->getPageTableManager());
@@ -877,7 +879,7 @@ HWTEST_F(WddmCsrCompressionTests, givenEnabledCompressionWhenInitializedThenCrea
HWTEST_F(WddmCsrCompressionTests, givenDisabledCompressionWhenInitializedThenDontCreatePagetableMngr) {
setCompressionEnabled(false, false);
createMockWddm();
MockWddmCsr<FamilyType> mockWddmCsr(hwInfo, myMockWddm.get());
MockWddmCsr<FamilyType> mockWddmCsr(hwInfo, myMockWddm.get(), *device->executionEnvironment);
EXPECT_EQ(nullptr, myMockWddm->getPageTableManager());
}
@@ -886,7 +888,7 @@ HWTEST_F(WddmCsrCompressionTests, givenEnabledCompressionWhenFlushingThenInitTra
for (size_t i = 0; i < 2; i++) {
setCompressionEnabled(compressionEnabled[i][0], compressionEnabled[i][1]);
createMockWddm();
auto mockWddmCsr = new MockWddmCsr<FamilyType>(hwInfo, myMockWddm.get());
auto mockWddmCsr = new MockWddmCsr<FamilyType>(hwInfo, myMockWddm.get(), *device->executionEnvironment);
mockWddmCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
auto mockMngr = reinterpret_cast<MockGmmPageTableMngr *>(myMockWddm->getPageTableManager());
@@ -925,7 +927,7 @@ HWTEST_F(WddmCsrCompressionTests, givenEnabledCompressionWhenFlushingThenInitTra
HWTEST_F(WddmCsrCompressionTests, givenDisabledCompressionWhenFlushingThenDontInitTranslationTable) {
setCompressionEnabled(false, false);
createMockWddm();
auto mockWddmCsr = new MockWddmCsr<FamilyType>(hwInfo, myMockWddm.get());
auto mockWddmCsr = new MockWddmCsr<FamilyType>(hwInfo, myMockWddm.get(), *device->executionEnvironment);
mockWddmCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
EXPECT_EQ(nullptr, myMockWddm->getPageTableManager());

View File

@@ -35,7 +35,7 @@ namespace OCLRT {
extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE];
CommandStreamReceiver *createMockCommandStreamReceiver(const HardwareInfo &hwInfoIn, bool withAubDump);
CommandStreamReceiver *createMockCommandStreamReceiver(const HardwareInfo &hwInfoIn, bool withAubDump, ExecutionEnvironment &executionEnvironment);
class DriverInfoDeviceTest : public ::testing::Test {
public:
@@ -56,7 +56,7 @@ class DriverInfoDeviceTest : public ::testing::Test {
const HardwareInfo *hwInfo;
};
CommandStreamReceiver *createMockCommandStreamReceiver(const HardwareInfo &hwInfoIn, bool withAubDump) {
CommandStreamReceiver *createMockCommandStreamReceiver(const HardwareInfo &hwInfoIn, bool withAubDump, ExecutionEnvironment &executionEnvironment) {
auto csr = new MockCommandStreamReceiver();
OSInterface *osInterface = new OSInterface();
DriverInfoDeviceTest::wddmMock = new WddmMock();