Remove allocation type UNDECIDED

Resolves: NEO-2733

Change-Id: If6102ca04f557feeedaf702fa0d9f63c79017fe4
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2019-04-17 13:59:24 +02:00
committed by sys_ocldev
parent 0c6823afd6
commit 6e97a69a2b
16 changed files with 73 additions and 93 deletions

View File

@@ -116,7 +116,7 @@ TEST_F(DrmCommandStreamTest, makeResident) {
.Times(0);
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_))
.Times(0);
DrmAllocation graphicsAllocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false);
DrmAllocation graphicsAllocation(GraphicsAllocation::AllocationType::UNKNOWN, nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false);
csr->makeResident(graphicsAllocation);
}
@@ -130,7 +130,7 @@ TEST_F(DrmCommandStreamTest, makeResidentTwiceTheSame) {
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_))
.Times(0);
DrmAllocation graphicsAllocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false);
DrmAllocation graphicsAllocation(GraphicsAllocation::AllocationType::UNKNOWN, nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false);
csr->makeResident(graphicsAllocation);
csr->makeResident(graphicsAllocation);
@@ -146,7 +146,7 @@ TEST_F(DrmCommandStreamTest, makeResidentSizeZero) {
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_))
.Times(0);
DrmAllocation graphicsAllocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 0, MemoryPool::MemoryNull, 1u, false);
DrmAllocation graphicsAllocation(GraphicsAllocation::AllocationType::UNKNOWN, nullptr, nullptr, 0, MemoryPool::MemoryNull, 1u, false);
csr->makeResident(graphicsAllocation);
}
@@ -161,8 +161,8 @@ TEST_F(DrmCommandStreamTest, makeResidentResized) {
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_))
.Times(0);
DrmAllocation graphicsAllocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false);
DrmAllocation graphicsAllocation2(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 8192, MemoryPool::MemoryNull, 1u, false);
DrmAllocation graphicsAllocation(GraphicsAllocation::AllocationType::UNKNOWN, nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false);
DrmAllocation graphicsAllocation2(GraphicsAllocation::AllocationType::UNKNOWN, nullptr, nullptr, 8192, MemoryPool::MemoryNull, 1u, false);
csr->makeResident(graphicsAllocation);
csr->makeResident(graphicsAllocation2);
@@ -468,8 +468,8 @@ TEST_F(DrmCommandStreamTest, FlushCheckFlags) {
.Times(1)
.WillRepeatedly(::testing::Return(0));
DrmAllocation allocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, (void *)0x7FFFFFFF, 1024, MemoryPool::MemoryNull, 1u, false);
DrmAllocation allocation2(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, (void *)0x307FFFFFFF, 1024, MemoryPool::MemoryNull, 1u, false);
DrmAllocation allocation(GraphicsAllocation::AllocationType::UNKNOWN, nullptr, (void *)0x7FFFFFFF, 1024, MemoryPool::MemoryNull, 1u, false);
DrmAllocation allocation2(GraphicsAllocation::AllocationType::UNKNOWN, nullptr, (void *)0x307FFFFFFF, 1024, MemoryPool::MemoryNull, 1u, false);
csr->makeResident(allocation);
csr->makeResident(allocation2);
csr->addBatchBufferEnd(cs, nullptr);
@@ -502,7 +502,7 @@ TEST_F(DrmCommandStreamTest, CheckDrmFree) {
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_))
.Times(2);
DrmAllocation allocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false);
DrmAllocation allocation(GraphicsAllocation::AllocationType::UNKNOWN, nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false);
csr->makeResident(allocation);
csr->addBatchBufferEnd(cs, nullptr);
@@ -543,7 +543,7 @@ TEST_F(DrmCommandStreamTest, CheckDrmFreeCloseFailed) {
.WillOnce(::testing::Return(-1));
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_WAIT, ::testing::_))
.Times(2);
DrmAllocation allocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false);
DrmAllocation allocation(GraphicsAllocation::AllocationType::UNKNOWN, nullptr, nullptr, 1024, MemoryPool::MemoryNull, 1u, false);
csr->makeResident(allocation);
csr->addBatchBufferEnd(cs, nullptr);
@@ -940,7 +940,7 @@ typedef Test<DrmCommandStreamEnhancedFixture> DrmCommandStreamLeaksTest;
TEST_F(DrmCommandStreamLeaksTest, makeResident) {
auto buffer = this->createBO(1024);
auto allocation = new DrmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, buffer, nullptr, buffer->peekSize(), MemoryPool::MemoryNull, 1u, false);
auto allocation = new DrmAllocation(GraphicsAllocation::AllocationType::UNKNOWN, buffer, nullptr, buffer->peekSize(), MemoryPool::MemoryNull, 1u, false);
EXPECT_EQ(nullptr, allocation->getUnderlyingBuffer());
csr->makeResident(*allocation);
@@ -962,8 +962,8 @@ TEST_F(DrmCommandStreamLeaksTest, makeResident) {
TEST_F(DrmCommandStreamLeaksTest, makeResidentOnly) {
BufferObject *buffer1 = this->createBO(4096);
BufferObject *buffer2 = this->createBO(4096);
auto allocation1 = new DrmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, buffer1, nullptr, buffer1->peekSize(), MemoryPool::MemoryNull, 1u, false);
auto allocation2 = new DrmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, buffer2, nullptr, buffer2->peekSize(), MemoryPool::MemoryNull, 1u, false);
auto allocation1 = new DrmAllocation(GraphicsAllocation::AllocationType::UNKNOWN, buffer1, nullptr, buffer1->peekSize(), MemoryPool::MemoryNull, 1u, false);
auto allocation2 = new DrmAllocation(GraphicsAllocation::AllocationType::UNKNOWN, buffer2, nullptr, buffer2->peekSize(), MemoryPool::MemoryNull, 1u, false);
EXPECT_EQ(nullptr, allocation1->getUnderlyingBuffer());
EXPECT_EQ(nullptr, allocation2->getUnderlyingBuffer());
@@ -990,7 +990,7 @@ TEST_F(DrmCommandStreamLeaksTest, makeResidentOnly) {
TEST_F(DrmCommandStreamLeaksTest, makeResidentTwice) {
auto buffer = this->createBO(1024);
auto allocation = new DrmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, buffer, nullptr, buffer->peekSize(), MemoryPool::MemoryNull, 1u, false);
auto allocation = new DrmAllocation(GraphicsAllocation::AllocationType::UNKNOWN, buffer, nullptr, buffer->peekSize(), MemoryPool::MemoryNull, 1u, false);
csr->makeResident(*allocation);
csr->processResidency(csr->getResidencyAllocations());
@@ -1262,7 +1262,7 @@ TEST_F(DrmCommandStreamLeaksTest, GivenTwoAllocationsWhenBackingStorageIsDiffere
TEST_F(DrmCommandStreamLeaksTest, makeResidentSizeZero) {
std::unique_ptr<BufferObject> buffer(this->createBO(0));
DrmAllocation allocation(GraphicsAllocation::AllocationType::UNDECIDED, buffer.get(), nullptr, buffer->peekSize(), MemoryPool::MemoryNull, 1u, false);
DrmAllocation allocation(GraphicsAllocation::AllocationType::UNKNOWN, buffer.get(), nullptr, buffer->peekSize(), MemoryPool::MemoryNull, 1u, false);
EXPECT_EQ(nullptr, allocation.getUnderlyingBuffer());
EXPECT_EQ(buffer->peekSize(), allocation.getUnderlyingBufferSize());
@@ -1487,7 +1487,7 @@ class DrmMockBuffer : public Buffer {
public:
static DrmMockBuffer *create() {
char *data = static_cast<char *>(::alignedMalloc(128, 64));
DrmAllocation *alloc = new (std::nothrow) DrmAllocation(GraphicsAllocation::AllocationType::UNDECIDED, nullptr, &data, sizeof(data), MemoryPool::MemoryNull, 1u, false);
DrmAllocation *alloc = new (std::nothrow) DrmAllocation(GraphicsAllocation::AllocationType::UNKNOWN, nullptr, &data, sizeof(data), MemoryPool::MemoryNull, 1u, false);
return new DrmMockBuffer(data, 128, alloc);
}