Change DevicesBitfield type to struct

Change-Id: I7a005b07737cdd21efc174a2ee2be0f6b7f9068d
Signed-off-by: Jablonski, Mateusz <mateusz.jablonski@intel.com>
This commit is contained in:
Jablonski, Mateusz
2019-02-15 11:31:47 +01:00
parent 7ff379f8f3
commit 05d02a6fe7
24 changed files with 91 additions and 84 deletions

View File

@@ -487,9 +487,9 @@ HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWh
auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr);
AllocationProperties allocProperties = MemObjHelper::getAllocationProperties(&imgInfo, true);
DevicesBitfield devices = 0;
DevicesBitfield devicesBitfield = {};
auto imageAllocation = memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, devices, nullptr);
auto imageAllocation = memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, devicesBitfield, nullptr);
ASSERT_NE(nullptr, imageAllocation);
EXPECT_TRUE(aubCsr->writeMemory(*imageAllocation));

View File

@@ -1460,9 +1460,9 @@ HWTEST_F(HwImageTest, givenImageHwWhenSettingCCSParamsThenSetClearColorParamsIsC
auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr);
AllocationProperties allocProperties = MemObjHelper::getAllocationProperties(&imgInfo, true);
DevicesBitfield devices = 0;
DevicesBitfield devicesBitfield = {};
auto graphicsAllocation = memoryManager.allocateGraphicsMemoryInPreferredPool(allocProperties, devices, nullptr);
auto graphicsAllocation = memoryManager.allocateGraphicsMemoryInPreferredPool(allocProperties, devicesBitfield, nullptr);
SurfaceFormatInfo formatInfo = {};
std::unique_ptr<MockImageHw<FamilyType>> mockImage(new MockImageHw<FamilyType>(&context, format, imgDesc, formatInfo, graphicsAllocation));
@@ -1488,9 +1488,9 @@ HWTEST_F(HwImageTest, givenImageHwWithUnifiedSurfaceAndMcsWhenSettingParamsForMu
auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, nullptr);
AllocationProperties allocProperties = MemObjHelper::getAllocationProperties(&imgInfo, true);
DevicesBitfield devices = 0;
DevicesBitfield devicesBitfield = {};
auto graphicsAllocation = memoryManager.allocateGraphicsMemoryInPreferredPool(allocProperties, devices, nullptr);
auto graphicsAllocation = memoryManager.allocateGraphicsMemoryInPreferredPool(allocProperties, devicesBitfield, nullptr);
SurfaceFormatInfo formatInfo = {};
std::unique_ptr<MockImageHw<FamilyType>> mockImage(new MockImageHw<FamilyType>(&context, format, imgDesc, formatInfo, graphicsAllocation));

View File

@@ -23,7 +23,7 @@ class MemoryManagerGetAlloctionDataTest : public testing::TestWithParam<Graphics
TEST(MemoryManagerGetAlloctionDataTest, givenHostMemoryAllocationTypeAndAllocateMemoryFlagAndNullptrWhenAllocationDataIsQueriedThenCorrectFlagsAndSizeAreSet) {
AllocationData allocData;
AllocationProperties properties(true, 10, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
EXPECT_TRUE(allocData.flags.mustBeZeroCopy);
EXPECT_TRUE(allocData.flags.useSystemMemory);
@@ -35,7 +35,7 @@ TEST(MemoryManagerGetAlloctionDataTest, givenNonHostMemoryAllocatoinTypeWhenAllo
AllocationData allocData;
AllocationProperties properties(true, 10, GraphicsAllocation::AllocationType::BUFFER);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
EXPECT_FALSE(allocData.flags.mustBeZeroCopy);
EXPECT_FALSE(allocData.flags.useSystemMemory);
@@ -48,7 +48,7 @@ TEST(MemoryManagerGetAlloctionDataTest, givenAllocateMemoryFlagTrueWhenHostPtrIs
char memory = 0;
AllocationProperties properties(true, sizeof(memory), GraphicsAllocation::AllocationType::BUFFER);
MockMemoryManager::getAllocationData(allocData, properties, 0, &memory);
MockMemoryManager::getAllocationData(allocData, properties, {}, &memory);
EXPECT_EQ(sizeof(memory), allocData.size);
EXPECT_EQ(nullptr, allocData.hostPtr);
@@ -58,7 +58,7 @@ TEST(MemoryManagerGetAlloctionDataTest, givenBufferTypeWhenAllocationDataIsQueri
AllocationData allocData;
AllocationProperties properties(true, 10, GraphicsAllocation::AllocationType::BUFFER);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
EXPECT_TRUE(allocData.flags.forcePin);
}
@@ -67,7 +67,7 @@ TEST(MemoryManagerGetAlloctionDataTest, givenBufferHostMemoryTypeWhenAllocationD
AllocationData allocData;
AllocationProperties properties(true, 10, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
EXPECT_TRUE(allocData.flags.forcePin);
}
@@ -76,7 +76,7 @@ TEST(MemoryManagerGetAlloctionDataTest, givenBufferCompressedTypeWhenAllocationD
AllocationData allocData;
AllocationProperties properties(true, 10, GraphicsAllocation::AllocationType::BUFFER_COMPRESSED);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
EXPECT_TRUE(allocData.flags.forcePin);
}
@@ -85,19 +85,11 @@ TEST(MemoryManagerGetAlloctionDataTest, givenDefaultAllocationFlagsWhenAllocatio
AllocationData allocData;
AllocationProperties properties(false, 0, GraphicsAllocation::AllocationType::BUFFER_COMPRESSED);
char memory;
MockMemoryManager::getAllocationData(allocData, properties, 0, &memory);
MockMemoryManager::getAllocationData(allocData, properties, {}, &memory);
EXPECT_FALSE(allocData.flags.allocateMemory);
}
TEST(MemoryManagerGetAlloctionDataTest, givenSpecificDeviceWhenAllocationDataIsQueriedThenDeviceIsPropagatedToAllocationData) {
AllocationData allocData;
AllocationProperties properties(true, 0, GraphicsAllocation::AllocationType::BUFFER_COMPRESSED);
MockMemoryManager::getAllocationData(allocData, properties, 3u, nullptr);
EXPECT_EQ(3u, allocData.devicesBitfield);
}
typedef MemoryManagerGetAlloctionDataTest MemoryManagerGetAlloctionData32BitAnd64kbPagesAllowedTest;
TEST_P(MemoryManagerGetAlloctionData32BitAnd64kbPagesAllowedTest, givenAllocationTypesWith32BitAnd64kbPagesAllowedWhenAllocationDataIsQueriedThenProperFlagsAreSet) {
@@ -105,7 +97,7 @@ TEST_P(MemoryManagerGetAlloctionData32BitAnd64kbPagesAllowedTest, givenAllocatio
auto allocType = GetParam();
AllocationProperties properties(true, 0, allocType);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
EXPECT_TRUE(allocData.flags.allow32Bit);
EXPECT_TRUE(allocData.flags.allow64kbPages);
@@ -117,7 +109,7 @@ TEST_P(MemoryManagerGetAlloctionData32BitAnd64kbPagesAllowedTest, given64kbAllow
AllocationData allocData;
AllocationProperties properties(true, 10, allocType);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
bool bufferCompressedType = (allocType == GraphicsAllocation::AllocationType::BUFFER_COMPRESSED);
EXPECT_TRUE(allocData.flags.allow64kbPages);
MockMemoryManager mockMemoryManager(true, false);
@@ -136,7 +128,7 @@ TEST_P(MemoryManagerGetAlloctionData32BitAnd64kbPagesNotAllowedTest, givenAlloca
auto allocType = GetParam();
AllocationProperties properties(true, 0, allocType);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
EXPECT_FALSE(allocData.flags.allow32Bit);
EXPECT_FALSE(allocData.flags.allow64kbPages);
@@ -177,7 +169,7 @@ TEST(MemoryManagerTest, givenForced32BitSetWhenGraphicsMemoryFor32BitAllowedType
AllocationData allocData;
AllocationProperties properties(true, 10, GraphicsAllocation::AllocationType::BUFFER);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
auto allocation = memoryManager.allocateGraphicsMemory(allocData);
ASSERT_NE(nullptr, allocation);
@@ -200,7 +192,7 @@ TEST(MemoryManagerTest, givenForced32BitEnabledWhenGraphicsMemoryWihtoutAllow32B
AllocationData allocData;
AllocationProperties properties(true, 10, GraphicsAllocation::AllocationType::BUFFER);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
allocData.flags.allow32Bit = false;
auto allocation = memoryManager.allocateGraphicsMemory(allocData);
@@ -218,7 +210,7 @@ TEST(MemoryManagerTest, givenForced32BitDisabledWhenGraphicsMemoryWith32BitFlagF
AllocationData allocData;
AllocationProperties properties(true, 10, GraphicsAllocation::AllocationType::BUFFER);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
auto allocation = memoryManager.allocateGraphicsMemory(allocData);
ASSERT_NE(nullptr, allocation);
@@ -233,7 +225,7 @@ TEST(MemoryManagerTest, givenEnabled64kbPagesWhenGraphicsMemoryMustBeHostMemoryA
AllocationData allocData;
AllocationProperties properties(true, 10, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
auto allocation = memoryManager.allocateGraphicsMemory(allocData);
ASSERT_NE(nullptr, allocation);
@@ -250,7 +242,7 @@ TEST(MemoryManagerTest, givenEnabled64kbPagesWhenGraphicsMemoryWithoutAllow64kbP
AllocationData allocData;
AllocationProperties properties(true, 10, GraphicsAllocation::AllocationType::BUFFER);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
allocData.flags.allow64kbPages = false;
auto allocation = memoryManager.allocateGraphicsMemory(allocData);
@@ -266,7 +258,7 @@ TEST(MemoryManagerTest, givenDisabled64kbPagesWhenGraphicsMemoryMustBeHostMemory
AllocationData allocData;
AllocationProperties properties(true, 10, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
auto allocation = memoryManager.allocateGraphicsMemory(allocData);
ASSERT_NE(nullptr, allocation);
@@ -285,7 +277,7 @@ TEST(MemoryManagerTest, givenForced32BitAndEnabled64kbPagesWhenGraphicsMemoryMus
AllocationData allocData;
AllocationProperties properties(true, 10, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
auto allocation = memoryManager.allocateGraphicsMemory(allocData);
ASSERT_NE(nullptr, allocation);
@@ -305,7 +297,7 @@ TEST(MemoryManagerTest, givenEnabled64kbPagesWhenGraphicsMemoryIsAllocatedWithHo
AllocationProperties properties(false, 1, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
char memory[1];
MockMemoryManager::getAllocationData(allocData, properties, 0, &memory);
MockMemoryManager::getAllocationData(allocData, properties, {}, &memory);
auto allocation = memoryManager.allocateGraphicsMemory(allocData);
ASSERT_NE(nullptr, allocation);
@@ -350,47 +342,47 @@ TEST(MemoryManagerTest, givenMemoryManagerWhenBufferTypeIsPassedAndAllocateInDev
TEST(MemoryManagerTest, givenSvmAllocationTypeWhenGetAllocationDataIsCalledThenZeroCopyIsRequested) {
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::SVM}, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::SVM}, {}, nullptr);
EXPECT_TRUE(allocData.flags.mustBeZeroCopy);
EXPECT_TRUE(allocData.flags.allocateMemory);
}
TEST(MemoryManagerTest, givenSvmAllocationTypeWhenGetAllocationDataIsCalledThen64kbPagesAreAllowedAnd32BitAllocationIsDisallowed) {
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::SVM}, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::SVM}, {}, nullptr);
EXPECT_TRUE(allocData.flags.allow64kbPages);
EXPECT_FALSE(allocData.flags.allow32Bit);
}
TEST(MemoryManagerTest, givenUndecidedTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) {
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::UNDECIDED}, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::UNDECIDED}, {}, nullptr);
EXPECT_TRUE(allocData.flags.useSystemMemory);
}
TEST(MemoryManagerTest, givenFillPatternTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) {
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::FILL_PATTERN}, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::FILL_PATTERN}, {}, nullptr);
EXPECT_TRUE(allocData.flags.useSystemMemory);
}
TEST(MemoryManagerTest, givenLinearStreamTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) {
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::LINEAR_STREAM}, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::LINEAR_STREAM}, {}, nullptr);
EXPECT_FALSE(allocData.flags.useSystemMemory);
EXPECT_TRUE(allocData.flags.requiresCpuAccess);
}
TEST(MemoryManagerTest, givenTimestampPacketTagBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequestedAndRequireCpuAccess) {
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER}, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER}, {}, nullptr);
EXPECT_FALSE(allocData.flags.useSystemMemory);
EXPECT_TRUE(allocData.flags.requiresCpuAccess);
}
TEST(MemoryManagerTest, givenProfilingTagBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) {
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER}, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER}, {}, nullptr);
EXPECT_TRUE(allocData.flags.useSystemMemory);
EXPECT_FALSE(allocData.flags.requiresCpuAccess);
}
@@ -401,7 +393,7 @@ TEST(MemoryManagerTest, givenAllocationPropertiesWithMultiOsContextCapableFlagEn
properties.flags.multiOsContextCapable = true;
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
EXPECT_TRUE(allocData.flags.multiOsContextCapable);
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(properties);
@@ -415,7 +407,7 @@ TEST(MemoryManagerTest, givenAllocationPropertiesWithMultiOsContextCapableFlagDi
properties.flags.multiOsContextCapable = false;
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
EXPECT_FALSE(allocData.flags.multiOsContextCapable);
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(properties);
@@ -425,31 +417,31 @@ TEST(MemoryManagerTest, givenAllocationPropertiesWithMultiOsContextCapableFlagDi
TEST(MemoryManagerTest, givenInternalHeapTypeWhenGetAllocationDataIsCalledThenInternalAllocationIsRequested) {
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::INTERNAL_HEAP}, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::INTERNAL_HEAP}, {}, nullptr);
EXPECT_EQ(AllocationOrigin::INTERNAL_ALLOCATION, allocData.allocationOrigin);
}
TEST(MemoryManagerTest, givenInternalHeapTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) {
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::INTERNAL_HEAP}, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::INTERNAL_HEAP}, {}, nullptr);
EXPECT_FALSE(allocData.flags.useSystemMemory);
EXPECT_TRUE(allocData.flags.requiresCpuAccess);
}
TEST(MemoryManagerTest, givenKernelIsaTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) {
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::KERNEL_ISA}, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::KERNEL_ISA}, {}, nullptr);
EXPECT_FALSE(allocData.flags.useSystemMemory);
EXPECT_TRUE(allocData.flags.requiresCpuAccess);
}
TEST(MemoryManagerTest, givenLinearStreamWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequested) {
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::LINEAR_STREAM}, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::LINEAR_STREAM}, {}, nullptr);
EXPECT_FALSE(allocData.flags.useSystemMemory);
EXPECT_TRUE(allocData.flags.requiresCpuAccess);
}
TEST(MemoryManagerTest, givenKernelIsaTypeWhenGetAllocationDataIsCalledThenInternalAllocationIsRequested) {
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::KERNEL_ISA}, 0, nullptr);
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::KERNEL_ISA}, {}, nullptr);
EXPECT_EQ(AllocationOrigin::INTERNAL_ALLOCATION, allocData.allocationOrigin);
}

View File

@@ -92,9 +92,9 @@ class TestedDrmMemoryManager : public DrmMemoryManager {
bool allocateMemory = ptr == nullptr;
AllocationData allocationData;
if (allocationOrigin == AllocationOrigin::EXTERNAL_ALLOCATION) {
getAllocationData(allocationData, MockAllocationProperties::getPropertiesFor32BitExternalAllocation(size, allocateMemory), 0u, ptr);
getAllocationData(allocationData, MockAllocationProperties::getPropertiesFor32BitExternalAllocation(size, allocateMemory), {}, ptr);
} else {
getAllocationData(allocationData, MockAllocationProperties::getPropertiesFor32BitInternalAllocation(size, allocateMemory), 0u, ptr);
getAllocationData(allocationData, MockAllocationProperties::getPropertiesFor32BitInternalAllocation(size, allocateMemory), {}, ptr);
}
return allocate32BitGraphicsMemoryImpl(allocationData);
}

View File

@@ -81,8 +81,8 @@ struct MockAubCsr : public AUBCommandStreamReceiverHw<GfxFamily> {
AUBCommandStreamReceiverHw<GfxFamily>::initializeEngine();
initializeEngineCalled = true;
}
void writeMemory(uint64_t gpuAddress, void *cpuAddress, size_t size, uint32_t memoryBank, uint64_t entryBits, DevicesBitfield devicesBitfield) override {
AUBCommandStreamReceiverHw<GfxFamily>::writeMemory(gpuAddress, cpuAddress, size, memoryBank, entryBits, devicesBitfield);
void writeMemory(uint64_t gpuAddress, void *cpuAddress, size_t size, uint32_t memoryBank, uint64_t entryBits) override {
AUBCommandStreamReceiverHw<GfxFamily>::writeMemory(gpuAddress, cpuAddress, size, memoryBank, entryBits);
writeMemoryCalled = true;
}
void submitBatchBuffer(uint64_t batchBufferGpuAddress, const void *batchBuffer, size_t batchBufferSize, uint32_t memoryBank, uint64_t entryBits) override {

View File

@@ -51,7 +51,7 @@ GraphicsAllocation *MockMemoryManager::allocateGraphicsMemory64kb(AllocationData
auto allocation = OsAgnosticMemoryManager::allocateGraphicsMemory64kb(allocationData);
if (allocation) {
allocation->gmm = new Gmm(allocation->getUnderlyingBuffer(), allocationData.size, false, preferRenderCompressedFlagPassed, true, 0);
allocation->gmm = new Gmm(allocation->getUnderlyingBuffer(), allocationData.size, false, preferRenderCompressedFlagPassed, true, {});
allocation->gmm->isRenderCompressed = preferRenderCompressedFlagPassed;
}
return allocation;
@@ -85,9 +85,9 @@ GraphicsAllocation *MockMemoryManager::allocate32BitGraphicsMemory(size_t size,
bool allocateMemory = ptr == nullptr;
AllocationData allocationData;
if (allocationOrigin == AllocationOrigin::EXTERNAL_ALLOCATION) {
getAllocationData(allocationData, MockAllocationProperties::getPropertiesFor32BitExternalAllocation(size, allocateMemory), 0u, ptr);
getAllocationData(allocationData, MockAllocationProperties::getPropertiesFor32BitExternalAllocation(size, allocateMemory), {}, ptr);
} else {
getAllocationData(allocationData, MockAllocationProperties::getPropertiesFor32BitInternalAllocation(size, allocateMemory), 0u, ptr);
getAllocationData(allocationData, MockAllocationProperties::getPropertiesFor32BitInternalAllocation(size, allocateMemory), {}, ptr);
}
return allocate32BitGraphicsMemoryImpl(allocationData);
}

View File

@@ -49,8 +49,8 @@ class MockTbxCsr : public TbxCommandStreamReceiverHw<GfxFamily> {
writeMemoryWithAubManagerCalled = true;
}
void writeMemory(uint64_t gpuAddress, void *cpuAddress, size_t size, uint32_t memoryBank, uint64_t entryBits, DevicesBitfield devicesBitfield) override {
TbxCommandStreamReceiverHw<GfxFamily>::writeMemory(gpuAddress, cpuAddress, size, memoryBank, entryBits, devicesBitfield);
void writeMemory(uint64_t gpuAddress, void *cpuAddress, size_t size, uint32_t memoryBank, uint64_t entryBits) override {
TbxCommandStreamReceiverHw<GfxFamily>::writeMemory(gpuAddress, cpuAddress, size, memoryBank, entryBits);
writeMemoryCalled = true;
}
void submitBatchBuffer(uint64_t batchBufferGpuAddress, const void *batchBuffer, size_t batchBufferSize, uint32_t memoryBank, uint64_t entryBits) override {

View File

@@ -37,9 +37,9 @@ class MockWddmMemoryManager : public WddmMemoryManager {
bool allocateMemory = ptr == nullptr;
AllocationData allocationData;
if (allocationOrigin == AllocationOrigin::EXTERNAL_ALLOCATION) {
getAllocationData(allocationData, MockAllocationProperties::getPropertiesFor32BitExternalAllocation(size, allocateMemory), 0u, ptr);
getAllocationData(allocationData, MockAllocationProperties::getPropertiesFor32BitExternalAllocation(size, allocateMemory), {}, ptr);
} else {
getAllocationData(allocationData, MockAllocationProperties::getPropertiesFor32BitInternalAllocation(size, allocateMemory), 0u, ptr);
getAllocationData(allocationData, MockAllocationProperties::getPropertiesFor32BitInternalAllocation(size, allocateMemory), {}, ptr);
}
return allocate32BitGraphicsMemoryImpl(allocationData);
}

View File

@@ -1094,9 +1094,9 @@ TEST_F(WddmMemoryManagerWithAsyncDeleterTest, givenMemoryManagerWithAsyncDeleter
deleter->expectDrainBlockingValue(true);
AllocationProperties allocProperties = MemObjHelper::getAllocationProperties(&imgInfo, true);
DevicesBitfield devices = 0;
DevicesBitfield devicesBitfield = {};
memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, devices, nullptr);
memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, devicesBitfield, nullptr);
EXPECT_EQ(1, deleter->drainCalled);
EXPECT_EQ(2u, wddm->createAllocationResult.called);
}
@@ -1114,9 +1114,9 @@ TEST_F(WddmMemoryManagerWithAsyncDeleterTest, givenMemoryManagerWithAsyncDeleter
EXPECT_EQ(0u, wddm->mapGpuVirtualAddressResult.called);
AllocationProperties allocProperties = MemObjHelper::getAllocationProperties(&imgInfo, true);
DevicesBitfield devices = 0;
DevicesBitfield devicesBitfield = {};
auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, devices, nullptr);
auto allocation = memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, devicesBitfield, nullptr);
EXPECT_EQ(0, deleter->drainCalled);
EXPECT_EQ(1u, wddm->createAllocationResult.called);
EXPECT_EQ(1u, wddm->mapGpuVirtualAddressResult.called);
@@ -1133,9 +1133,9 @@ TEST_F(WddmMemoryManagerWithAsyncDeleterTest, givenMemoryManagerWithoutAsyncDele
EXPECT_EQ(0u, wddm->createAllocationResult.called);
AllocationProperties allocProperties = MemObjHelper::getAllocationProperties(&imgInfo, true);
DevicesBitfield devices = 0;
DevicesBitfield devicesBitfield = {};
memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, devices, nullptr);
memoryManager->allocateGraphicsMemoryInPreferredPool(allocProperties, devicesBitfield, nullptr);
EXPECT_EQ(1u, wddm->createAllocationResult.called);
}