mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Make sure that resources are not made resident multiple times.
Related-To: NEO-3054 Change-Id: I32d01f8993e8d327ee117a352a8b4bcb1bbb7e30 Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
a807a7498c
commit
97bc604316
@ -212,6 +212,21 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenWriteMemoryIsCa
|
||||
memoryManager->freeGraphicsMemory(graphicsAllocation);
|
||||
}
|
||||
|
||||
HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenWriteMemoryIsCalledWithGraphicsAllocationThatIsOnlyOneTimeWriteableThenGraphicsAllocationIsUpdated) {
|
||||
TbxCommandStreamReceiverHw<FamilyType> *tbxCsr = (TbxCommandStreamReceiverHw<FamilyType> *)pCommandStreamReceiver;
|
||||
TbxMemoryManager *memoryManager = tbxCsr->getMemoryManager();
|
||||
ASSERT_NE(nullptr, memoryManager);
|
||||
|
||||
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
ASSERT_NE(nullptr, graphicsAllocation);
|
||||
|
||||
EXPECT_TRUE(graphicsAllocation->isAubWritable());
|
||||
EXPECT_TRUE(tbxCsr->writeMemory(*graphicsAllocation));
|
||||
EXPECT_FALSE(graphicsAllocation->isAubWritable());
|
||||
|
||||
memoryManager->freeGraphicsMemory(graphicsAllocation);
|
||||
}
|
||||
|
||||
HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenWriteMemoryIsCalledForGraphicsAllocationWithZeroSizeThenItShouldReturnFalse) {
|
||||
TbxCommandStreamReceiverHw<FamilyType> *tbxCsr = (TbxCommandStreamReceiverHw<FamilyType> *)pCommandStreamReceiver;
|
||||
MockGraphicsAllocation graphicsAllocation((void *)0x1234, 0);
|
||||
|
Reference in New Issue
Block a user