Remove padding allocation

Change-Id: I0017640ee22b687af1d85fa10d221d2b3cafed0a
Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
This commit is contained in:
Jobczyk, Lukasz
2019-12-09 09:55:20 +01:00
committed by sys_ocldev
parent b544b2da60
commit ac0471adc5
7 changed files with 9 additions and 53 deletions

View File

@@ -962,29 +962,6 @@ TEST(OsAgnosticMemoryManager, givenDefaultMemoryManagerWhenGraphicsAllocationIsP
ASSERT_NE(nullptr, paddedGraphicsAllocation);
EXPECT_NE(paddedGraphicsAllocation, graphicsAllocation);
//padding buffer was created
ASSERT_NE(nullptr, memoryManager.peekPaddingAllocation());
auto paddingAllocation = memoryManager.peekPaddingAllocation();
EXPECT_EQ(paddingBufferSize, paddingAllocation->getUnderlyingBufferSize());
memoryManager.freeGraphicsMemory(paddedGraphicsAllocation);
memoryManager.freeGraphicsMemory(graphicsAllocation);
}
TEST(OsAgnosticMemoryManager, givenDefaultMemoryManagerWhenTwoGraphicsAllocationArePaddedThenOnlyOnePaddingBufferIsUsed) {
MockExecutionEnvironment executionEnvironment(*platformDevices);
MemoryManagerCreate<OsAgnosticMemoryManager> memoryManager(false, false, executionEnvironment);
auto graphicsAllocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
auto sizeWithPadding = 8192;
auto paddedGraphicsAllocation = memoryManager.createGraphicsAllocationWithPadding(graphicsAllocation, sizeWithPadding);
auto paddingAllocation = memoryManager.peekPaddingAllocation();
auto paddedGraphicsAllocation2 = memoryManager.createGraphicsAllocationWithPadding(graphicsAllocation, sizeWithPadding);
auto paddingAllocation2 = memoryManager.peekPaddingAllocation();
EXPECT_EQ(paddingAllocation2, paddingAllocation);
memoryManager.freeGraphicsMemory(paddedGraphicsAllocation2);
memoryManager.freeGraphicsMemory(paddedGraphicsAllocation);
memoryManager.freeGraphicsMemory(graphicsAllocation);
}

View File

@@ -2122,9 +2122,9 @@ TEST_F(DrmMemoryManagerTest, givenSharedAllocationWithSmallerThenRealSizeWhenCre
}
TEST_F(DrmMemoryManagerTest, givenMemoryManagerSupportingVirutalPaddingWhenItIsRequiredThenNewGraphicsAllocationIsCreated) {
mock->ioctl_expected.gemUserptr = 3;
mock->ioctl_expected.gemWait = 3;
mock->ioctl_expected.gemClose = 3;
mock->ioctl_expected.gemUserptr = 2;
mock->ioctl_expected.gemWait = 2;
mock->ioctl_expected.gemClose = 2;
//first let's create normal buffer
auto bufferSize = MemoryConstants::pageSize;
auto buffer = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{bufferSize});
@@ -2132,8 +2132,6 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerSupportingVirutalPaddingWhenItIsR
//buffer should have size 16
EXPECT_EQ(bufferSize, buffer->getUnderlyingBufferSize());
EXPECT_EQ(nullptr, memoryManager->peekPaddingAllocation());
auto bufferWithPaddingSize = 8192u;
auto paddedAllocation = memoryManager->createGraphicsAllocationWithPadding(buffer, 8192u);
EXPECT_NE(nullptr, paddedAllocation);
@@ -2277,10 +2275,10 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedForInternalAllocationWit
}
TEST_F(DrmMemoryManagerTest, givenMemoryManagerSupportingVirutalPaddingWhenAllocUserptrFailsThenReturnsNullptr) {
mock->ioctl_expected.gemUserptr = 3;
mock->ioctl_expected.gemWait = 2;
mock->ioctl_expected.gemClose = 2;
this->ioctlResExt = {mock->ioctl_cnt.total + 2, -1};
mock->ioctl_expected.gemUserptr = 2;
mock->ioctl_expected.gemWait = 1;
mock->ioctl_expected.gemClose = 1;
this->ioctlResExt = {mock->ioctl_cnt.total + 1, -1};
mock->ioctl_res_ext = &ioctlResExt;
//first let's create normal buffer
@@ -2290,8 +2288,6 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerSupportingVirutalPaddingWhenAlloc
//buffer should have size 16
EXPECT_EQ(bufferSize, buffer->getUnderlyingBufferSize());
EXPECT_EQ(nullptr, memoryManager->peekPaddingAllocation());
auto bufferWithPaddingSize = 8192u;
auto paddedAllocation = memoryManager->createGraphicsAllocationWithPadding(buffer, bufferWithPaddingSize);
EXPECT_EQ(nullptr, paddedAllocation);