Initialize TBX stream only when hardwareContext is not created
Change-Id: I05d8c5c395cc342ea699333dd59966913f9a98df
This commit is contained in:
parent
56eced2faa
commit
e195b0e380
|
@ -177,13 +177,14 @@ CommandStreamReceiver *TbxCommandStreamReceiverHw<GfxFamily>::create(const Hardw
|
|||
csr = new TbxCommandStreamReceiverHw<GfxFamily>(hwInfoIn, executionEnvironment);
|
||||
}
|
||||
|
||||
// Open our stream
|
||||
csr->stream->open(nullptr);
|
||||
|
||||
// Add the file header.
|
||||
bool streamInitialized = csr->stream->init(AubMemDump::SteppingValues::A, csr->aubDeviceId);
|
||||
csr->streamInitialized = streamInitialized;
|
||||
if (csr->hardwareContext == nullptr) {
|
||||
// Open our stream
|
||||
csr->stream->open(nullptr);
|
||||
|
||||
// Add the file header.
|
||||
bool streamInitialized = csr->stream->init(AubMemDump::SteppingValues::A, csr->aubDeviceId);
|
||||
csr->streamInitialized = streamInitialized;
|
||||
}
|
||||
return csr;
|
||||
}
|
||||
|
||||
|
|
|
@ -440,3 +440,16 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenMakeCoherentIsC
|
|||
|
||||
EXPECT_TRUE(mockHardwareContext->readMemoryCalled);
|
||||
}
|
||||
|
||||
HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenHardwareContextIsCreatedThenTbxStreamInCsrIsNotInitialized) {
|
||||
const HardwareInfo &hwInfo = *platformDevices[0];
|
||||
MockAubManager *mockManager = new MockAubManager();
|
||||
MockAubCenter *mockAubCenter = new MockAubCenter(&hwInfo, false, "");
|
||||
mockAubCenter->aubManager = std::unique_ptr<MockAubManager>(mockManager);
|
||||
ExecutionEnvironment executionEnvironment;
|
||||
executionEnvironment.aubCenter = std::unique_ptr<MockAubCenter>(mockAubCenter);
|
||||
auto tbxCsr = std::unique_ptr<TbxCommandStreamReceiverHw<FamilyType>>(reinterpret_cast<TbxCommandStreamReceiverHw<FamilyType> *>(
|
||||
TbxCommandStreamReceiverHw<FamilyType>::create(hwInfo, false, executionEnvironment)));
|
||||
|
||||
EXPECT_FALSE(tbxCsr->streamInitialized);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue