From b2909fef563ef0f701dc40be4f5192b7675d2750 Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Mon, 20 Sep 2021 17:39:16 +0000 Subject: [PATCH] Remove mockMaxOsContextCount Signed-off-by: Bartosz Dunajski --- ...ommand_stream_receiver_simulated_tests.cpp | 32 +++---- .../command_stream_receiver_tests.cpp | 2 +- .../hardware_commands_helper_tests.cpp | 4 +- opencl/test/unit_test/kernel/kernel_tests.cpp | 2 +- ..._manager_allocate_in_device_pool_tests.cpp | 4 +- .../memory_manager/memory_manager_tests.cpp | 4 +- .../utilities/tag_allocator_tests.cpp | 2 +- .../copy_engine_tests_xe_hp_core.cpp | 2 +- .../helpers/blit_commands_helper_tests.cpp | 12 +-- ...st_blit_commands_helper_xehp_and_later.cpp | 86 +++++++++---------- .../common/mocks/mock_graphics_allocation.h | 9 +- .../graphics_allocation_tests.cpp | 18 ++-- 12 files changed, 88 insertions(+), 89 deletions(-) diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_simulated_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_simulated_tests.cpp index 20600f7199..656d2204f4 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_simulated_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_simulated_tests.cpp @@ -38,7 +38,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndAllocationWithStorageIn executionEnvironment.initializeMemoryManager(); MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, - MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, mockMaxOsContextCount); + MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x2u; auto csr = std::make_unique>(executionEnvironment, 0, 1); @@ -57,7 +57,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndNonLocalMemoryAllocatio executionEnvironment.initializeMemoryManager(); MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, - MemoryConstants::pageSize, 0, MemoryPool::System4KBPages, false, false, mockMaxOsContextCount); + MemoryConstants::pageSize, 0, MemoryPool::System4KBPages, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x2u; auto csr = std::make_unique>(executionEnvironment, 0, 1); @@ -73,7 +73,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndAllocationWithStorageIn executionEnvironment.initializeMemoryManager(); MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, - MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, mockMaxOsContextCount); + MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x0u; DeviceBitfield deviceBitfield(0b100); @@ -92,7 +92,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndNonLocalMemoryAllocatio executionEnvironment.initializeMemoryManager(); MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, - MemoryConstants::pageSize, 0, MemoryPool::System64KBPages, false, false, mockMaxOsContextCount); + MemoryConstants::pageSize, 0, MemoryPool::System64KBPages, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x3u; DeviceBitfield deviceBitfield(1); @@ -111,7 +111,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryNoncloneableAllocationWith executionEnvironment.initializeMemoryManager(); MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, - MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, mockMaxOsContextCount); + MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x3u; allocation.storageInfo.cloningOfPageTables = false; @@ -135,7 +135,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryCloneableAllocationWithMan executionEnvironment.initializeMemoryManager(); MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, - MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, mockMaxOsContextCount); + MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x3u; allocation.storageInfo.cloningOfPageTables = true; @@ -159,7 +159,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryNoncloneableAllocationWith executionEnvironment.initializeMemoryManager(); MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, - MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, mockMaxOsContextCount); + MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x3u; allocation.storageInfo.cloningOfPageTables = false; @@ -184,7 +184,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenLocalMemoryAndAllocationWithStorageIn executionEnvironment.initializeMemoryManager(); MemoryAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000u, - MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, mockMaxOsContextCount); + MemoryConstants::pageSize, 0, MemoryPool::LocalMemory, false, false, MemoryManager::maxOsContextCount); allocation.storageInfo.memoryBanks = 0x0u; DeviceBitfield deviceBitfield(0b100); @@ -311,7 +311,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenSimulatedCommandStreamReceiverWhenClo int dummy = 1; GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN, - &dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, mockMaxOsContextCount}; + &dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; csr->writeMemoryWithAubManager(graphicsAllocation); @@ -334,7 +334,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenCompressedAllocationWhenCloningPageTa int dummy = 1; GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN, - &dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, mockMaxOsContextCount}; + &dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; graphicsAllocation.setDefaultGmm(&gmm); @@ -361,7 +361,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenTileInstancedAllocationWhenWriteMemor int dummy = 1; GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN, - &dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, mockMaxOsContextCount}; + &dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = false; graphicsAllocation.storageInfo.tileInstanced = true; graphicsAllocation.storageInfo.memoryBanks = 0b11u; @@ -393,7 +393,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenCompressedTileInstancedAllocationWhen int dummy = 1; GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN, - &dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, mockMaxOsContextCount}; + &dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = false; graphicsAllocation.storageInfo.tileInstanced = true; graphicsAllocation.storageInfo.memoryBanks = 0b11u; @@ -424,7 +424,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenTileInstancedAllocationWithMissingMem int dummy = 1; GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::UNKNOWN, - &dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, mockMaxOsContextCount}; + &dummy, 0, 0, sizeof(dummy), MemoryPool::LocalMemory, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = false; graphicsAllocation.storageInfo.tileInstanced = true; graphicsAllocation.storageInfo.memoryBanks = 2u; @@ -440,7 +440,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenCommandBufferAllocationWhenWriteMemor int dummy = 1; GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, - &dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, mockMaxOsContextCount}; + &dummy, 0, 0, sizeof(dummy), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; csr->writeMemoryWithAubManager(graphicsAllocation); @@ -474,7 +474,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenSpecificMemoryPoolAllocationWhenWrite mockHardwareContext->writeMemory2Called = false; GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, - &dummy, 0, 0, sizeof(dummy), poolsWith4kPages[i], mockMaxOsContextCount}; + &dummy, 0, 0, sizeof(dummy), poolsWith4kPages[i], MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; csr->writeMemoryWithAubManager(graphicsAllocation); @@ -507,7 +507,7 @@ HWTEST_F(CommandStreamSimulatedTests, givenSpecificMemoryPoolAllocationWhenWrite mockHardwareContext->writeMemory2Called = false; GraphicsAllocation graphicsAllocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, - &dummy, 0, 0, sizeof(dummy), poolsWith64kPages[i], mockMaxOsContextCount}; + &dummy, 0, 0, sizeof(dummy), poolsWith64kPages[i], MemoryManager::maxOsContextCount}; graphicsAllocation.storageInfo.cloningOfPageTables = true; csr->writeMemoryWithAubManager(graphicsAllocation); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp index 42727c6ef7..76c9af41f7 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp @@ -1100,7 +1100,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenTemporaryAllocationWhenCreateAll auto hostPtr = reinterpret_cast(0x1234); size_t size = 100; auto temporaryAllocation = std::make_unique(0, - GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, hostPtr, size, 0, MemoryPool::System4KBPages, mockMaxOsContextCount); + GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, hostPtr, size, 0, MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); auto allocationPtr = temporaryAllocation.get(); temporaryAllocation->updateTaskCount(0u, 0u); commandStreamReceiver->getInternalAllocationStorage()->storeAllocation(std::move(temporaryAllocation), TEMPORARY_ALLOCATION); diff --git a/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp b/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp index 29cc49be57..1eea2eb107 100644 --- a/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hardware_commands_helper_tests.cpp @@ -688,12 +688,12 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, WhenGettingBindingTableStateTh // setup global memory char globalBuffer[16]; - GraphicsAllocation gfxGlobalAlloc(0, GraphicsAllocation::AllocationType::UNKNOWN, globalBuffer, castToUint64(globalBuffer), 0llu, sizeof(globalBuffer), MemoryPool::MemoryNull, mockMaxOsContextCount); + GraphicsAllocation gfxGlobalAlloc(0, GraphicsAllocation::AllocationType::UNKNOWN, globalBuffer, castToUint64(globalBuffer), 0llu, sizeof(globalBuffer), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); program.setGlobalSurface(&gfxGlobalAlloc); // setup constant memory char constBuffer[16]; - GraphicsAllocation gfxConstAlloc(0, GraphicsAllocation::AllocationType::UNKNOWN, constBuffer, castToUint64(constBuffer), 0llu, sizeof(constBuffer), MemoryPool::MemoryNull, mockMaxOsContextCount); + GraphicsAllocation gfxConstAlloc(0, GraphicsAllocation::AllocationType::UNKNOWN, constBuffer, castToUint64(constBuffer), 0llu, sizeof(constBuffer), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); program.setConstantSurface(&gfxConstAlloc); // create kernel diff --git a/opencl/test/unit_test/kernel/kernel_tests.cpp b/opencl/test/unit_test/kernel/kernel_tests.cpp index dfa628c855..08086ff31e 100644 --- a/opencl/test/unit_test/kernel/kernel_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_tests.cpp @@ -3264,7 +3264,7 @@ HWTEST2_F(KernelConstantSurfaceTest, givenKernelWithConstantSurfaceWhenKernelIsC char buffer[MemoryConstants::pageSize64k]; GraphicsAllocation gfxAlloc(0, GraphicsAllocation::AllocationType::CONSTANT_SURFACE, buffer, - MemoryConstants::pageSize64k, (osHandle)8, MemoryPool::MemoryNull, mockMaxOsContextCount); + MemoryConstants::pageSize64k, (osHandle)8, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); MockContext context(pClDevice); MockProgram program(&context, false, toClDeviceVector(*pClDevice)); diff --git a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp index 38a76f0d72..ec1116cdef 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp +++ b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.cpp @@ -442,7 +442,7 @@ TEST(MemoryAllocationTest, givenAubDumpForceAllToLocalMemoryWhenMemoryAllocation DebugManager.flags.AUBDumpForceAllToLocalMemory.set(true); MemoryAllocation allocation(mockRootDeviceIndex, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000, - 0x1000, 0, MemoryPool::System4KBPages, false, false, mockMaxOsContextCount); + 0x1000, 0, MemoryPool::System4KBPages, false, false, MemoryManager::maxOsContextCount); EXPECT_EQ(MemoryPool::LocalMemory, allocation.getMemoryPool()); } @@ -451,7 +451,7 @@ TEST(MemoryAllocationTest, givenAubDumpForceAllToLocalMemoryWhenMemoryAllocation DebugManager.flags.AUBDumpForceAllToLocalMemory.set(true); MemoryAllocation allocation(mockRootDeviceIndex, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, reinterpret_cast(0x1000), 0x1000, - 0x1000, 0, MemoryPool::System4KBPages, false, false, mockMaxOsContextCount); + 0x1000, 0, MemoryPool::System4KBPages, false, false, MemoryManager::maxOsContextCount); allocation.overrideMemoryPool(MemoryPool::System64KBPages); EXPECT_EQ(MemoryPool::LocalMemory, allocation.getMemoryPool()); } diff --git a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp index 96cfaf75aa..38feff79af 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp @@ -2550,13 +2550,13 @@ TEST_F(HeapSelectorTest, givenDebugModuleAreaAllocationInLocalMemoryAndUseFrontW TEST(MemoryAllocationTest, givenAllocationTypeWhenPassedToMemoryAllocationConstructorThenAllocationTypeIsStored) { MemoryAllocation allocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, nullptr, nullptr, 0, 0, 0, - MemoryPool::MemoryNull, false, false, mockMaxOsContextCount}; + MemoryPool::MemoryNull, false, false, MemoryManager::maxOsContextCount}; EXPECT_EQ(GraphicsAllocation::AllocationType::COMMAND_BUFFER, allocation.getAllocationType()); } TEST(MemoryAllocationTest, givenMemoryPoolWhenPassedToMemoryAllocationConstructorThenMemoryPoolIsStored) { MemoryAllocation allocation{0, GraphicsAllocation::AllocationType::COMMAND_BUFFER, nullptr, nullptr, 0, 0, 0, - MemoryPool::System64KBPages, false, false, mockMaxOsContextCount}; + MemoryPool::System64KBPages, false, false, MemoryManager::maxOsContextCount}; EXPECT_EQ(MemoryPool::System64KBPages, allocation.getMemoryPool()); } diff --git a/opencl/test/unit_test/utilities/tag_allocator_tests.cpp b/opencl/test/unit_test/utilities/tag_allocator_tests.cpp index 939708e5bd..67bd3d1fa0 100644 --- a/opencl/test/unit_test/utilities/tag_allocator_tests.cpp +++ b/opencl/test/unit_test/utilities/tag_allocator_tests.cpp @@ -236,7 +236,7 @@ TEST_F(TagAllocatorTest, givenInputTagCountWhenCreatingAllocatorThenRequestedNum using MockMemoryManager::MockMemoryManager; GraphicsAllocation *allocateGraphicsMemoryWithAlignment(const AllocationData &allocationData) override { return new MemoryAllocation(0, TimestampPackets::getAllocationType(), nullptr, nullptr, 0, MemoryConstants::pageSize, - 1, MemoryPool::System4KBPages, false, false, mockMaxOsContextCount); + 1, MemoryPool::System4KBPages, false, false, MemoryManager::maxOsContextCount); } }; diff --git a/opencl/test/unit_test/xe_hp_core/copy_engine_tests_xe_hp_core.cpp b/opencl/test/unit_test/xe_hp_core/copy_engine_tests_xe_hp_core.cpp index 527c6d9c67..bd3736304f 100644 --- a/opencl/test/unit_test/xe_hp_core/copy_engine_tests_xe_hp_core.cpp +++ b/opencl/test/unit_test/xe_hp_core/copy_engine_tests_xe_hp_core.cpp @@ -565,7 +565,7 @@ XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenDebugFlagSetWhenCompressionIsUsedThe auto gmm = std::make_unique(clDevice->getGmmClientContext()); gmm->isCompressionEnabled = true; MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), - 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, mockMaxOsContextCount); + 0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0); BlitProperties properties = {}; diff --git a/shared/test/common/helpers/blit_commands_helper_tests.cpp b/shared/test/common/helpers/blit_commands_helper_tests.cpp index 77c7fcd2af..508907de8f 100644 --- a/shared/test/common/helpers/blit_commands_helper_tests.cpp +++ b/shared/test/common/helpers/blit_commands_helper_tests.cpp @@ -236,7 +236,7 @@ HWTEST_F(BlitTests, givenMemoryWhenFillPatternWithBlitThenCommandIsProgrammed) { LinearStream stream(streamBuffer, sizeof(streamBuffer)); MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( @@ -253,7 +253,7 @@ HWTEST_F(BlitTests, givenMemorySizeBiggerThanMaxWidthButLessThanTwiceMaxWidthWhe LinearStream stream(streamBuffer, sizeof(streamBuffer)); MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth) - 1, - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); GenCmdList cmdList; @@ -275,7 +275,7 @@ HWTEST_F(BlitTests, givenMemoryPointerOffsetVerifyCorrectDestinationBaseAddress) LinearStream stream(streamBuffer, sizeof(streamBuffer)); MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0x234, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); GenCmdList cmdList; @@ -297,7 +297,7 @@ HWTEST_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBli LinearStream stream(streamBuffer, sizeof(streamBuffer)); MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth * sizeof(uint32_t)), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( @@ -319,7 +319,7 @@ HWTEST_F(BlitTests, givenMemorySizeIsLessThanTwicenMaxWidthWhenFillPatternWithBl LinearStream stream(streamBuffer, sizeof(streamBuffer)); MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, ((BlitterConstants::maxBlitWidth + 1) * sizeof(uint32_t)), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( @@ -342,7 +342,7 @@ HWTEST2_F(BlitTests, givenMemoryWhenFillPatternSizeIs4BytesThen32BitMaskISSetCor LinearStream stream(streamBuffer, sizeof(streamBuffer)); MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, &pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( diff --git a/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp b/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp index 910050183a..295f4017a4 100644 --- a/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp +++ b/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp @@ -39,7 +39,7 @@ HWTEST2_F(BlitTests, givenDeviceWithoutDefaultGmmWhenAppendBlitCommandsForFillBu auto blitCmd = FamilyType::cmdInitXyColorBlt; MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); EXPECT_EQ(blitCmd.getDestinationCompressionEnable(), XY_COLOR_BLT::DESTINATION_COMPRESSION_ENABLE::DESTINATION_COMPRESSION_ENABLE_COMPRESSION_DISABLE); EXPECT_EQ(blitCmd.getDestinationAuxiliarysurfacemode(), XY_COLOR_BLT::DESTINATION_AUXILIARY_SURFACE_MODE::DESTINATION_AUXILIARY_SURFACE_MODE_AUX_NONE); @@ -52,7 +52,7 @@ HWTEST2_F(BlitTests, givenGmmWithDisabledCompresionWhenAppendBlitCommandsForFill gmm->isCompressionEnabled = false; MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); EXPECT_EQ(blitCmd.getDestinationCompressionEnable(), XY_COLOR_BLT::DESTINATION_COMPRESSION_ENABLE::DESTINATION_COMPRESSION_ENABLE_COMPRESSION_DISABLE); @@ -66,7 +66,7 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionWhenAppendBlitCommandsForFillB gmm->isCompressionEnabled = true; MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocation.setGmm(gmm.get(), 0); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); EXPECT_EQ(blitCmd.getDestinationCompressionEnable(), XY_COLOR_BLT::DESTINATION_COMPRESSION_ENABLE::DESTINATION_COMPRESSION_ENABLE_COMPRESSION_ENABLE); @@ -116,7 +116,7 @@ HWTEST2_F(BlitTests, givenA0StepWhenAppendBlitCommandsForFillBufferWithLocalAcce auto blitCmd = FamilyType::cmdInitXyColorBlt; MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::LocalMemory, mockMaxOsContextCount); + MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo(); const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo->platform.eProductFamily); hwInfo->platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, *hwInfo); @@ -133,7 +133,7 @@ HWTEST2_F(BlitTests, givenA0StepWhenAppendBlitCommandsForFillBufferWithLocalAcce auto blitCmd = FamilyType::cmdInitXyColorBlt; MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::LocalMemory, mockMaxOsContextCount); + MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo(); const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo->platform.eProductFamily); hwInfo->platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, *hwInfo); @@ -150,7 +150,7 @@ HWTEST2_F(BlitTests, givenBStepWhenAppendBlitCommandsForFillBufferWithLocalAcces auto blitCmd = FamilyType::cmdInitXyColorBlt; MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::LocalMemory, mockMaxOsContextCount); + MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo(); const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo->platform.eProductFamily); hwInfo->platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, *hwInfo); @@ -167,7 +167,7 @@ HWTEST2_F(BlitTests, givenBStepWhenAppendBlitCommandsForFillBufferWithLocalAcces auto blitCmd = FamilyType::cmdInitXyColorBlt; MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::LocalMemory, mockMaxOsContextCount); + MemoryPool::LocalMemory, MemoryManager::maxOsContextCount); HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo(); const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo->platform.eProductFamily); hwInfo->platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, *hwInfo); @@ -184,7 +184,7 @@ HWTEST2_F(BlitTests, givenAllocationInSystemMemWhenAppendBlitCommandsForFillBuff auto blitCmd = FamilyType::cmdInitXyColorBlt; MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo(); const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo->platform.eProductFamily); hwInfo->platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A1, *hwInfo); @@ -201,7 +201,7 @@ HWTEST2_F(BlitTests, givenAllocationInSystemMemWhenAppendBlitCommandsForFillBuff auto blitCmd = FamilyType::cmdInitXyColorBlt; MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo(); const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo->platform.eProductFamily); hwInfo->platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A1, *hwInfo); @@ -219,7 +219,7 @@ HWTEST2_F(BlitTests, givenOverridedMocksValueWhenAppendBlitCommandsForFillBuffer auto blitCmd = FamilyType::cmdInitXyColorBlt; MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); EXPECT_EQ(blitCmd.getDestinationMOCSvalue(), mockValue); } @@ -232,7 +232,7 @@ HWTEST2_F(BlitTests, givenOverridedBliterTargetToZeroWhenAppendBlitCommandsForFi auto blitCmd = FamilyType::cmdInitXyColorBlt; MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); EXPECT_EQ(blitCmd.getDestinationTargetMemory(), XY_COLOR_BLT::DESTINATION_TARGET_MEMORY::DESTINATION_TARGET_MEMORY_SYSTEM_MEM); @@ -246,7 +246,7 @@ HWTEST2_F(BlitTests, givenOverridedBliterTargetToOneWhenAppendBlitCommandsForFil auto blitCmd = FamilyType::cmdInitXyColorBlt; MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); EXPECT_EQ(blitCmd.getDestinationTargetMemory(), XY_COLOR_BLT::DESTINATION_TARGET_MEMORY::DESTINATION_TARGET_MEMORY_LOCAL_MEM); @@ -260,7 +260,7 @@ HWTEST2_F(BlitTests, givenOverridedBliterTargetToTwoWhenAppendBlitCommandsForFil auto blitCmd = FamilyType::cmdInitXyColorBlt; MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); EXPECT_EQ(blitCmd.getDestinationTargetMemory(), XY_COLOR_BLT::DESTINATION_TARGET_MEMORY::DESTINATION_TARGET_MEMORY_SYSTEM_MEM); @@ -424,10 +424,10 @@ HWTEST2_F(BlitTests, givenTiled4SrcAndDestinationAppendImageCommandsThenCorrectT flags->Info.Tile4 = true; MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); mockAllocationSrc.setGmm(gmm.get(), 0); mockAllocationDst.setGmm(gmm.get(), 0); @@ -450,10 +450,10 @@ HWTEST2_F(BlitTests, givenNotTiled64SrcAndDestinationAppendImageCommandsThenCorr flags->Info.Tile64 = true; MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); mockAllocationSrc.setGmm(gmm.get(), 0); mockAllocationDst.setGmm(gmm.get(), 0); @@ -476,10 +476,10 @@ HWTEST2_F(BlitTests, givenNotTiledSrcAndDestinationAppendImageCommandsThenCorrec flags->Info.Tile64 = false; MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); mockAllocationSrc.setGmm(gmm.get(), 0); mockAllocationDst.setGmm(gmm.get(), 0); @@ -511,10 +511,10 @@ HWTEST2_F(BlitTests, givenGmmParamsWhenAppendSurfaceTypeThenCorrectSurfaceTypeIs resourceInfo->mockResourceCreateParams.ArraySize = arraySize; MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocationSrc.setGmm(gmm.get(), 0); mockAllocationDst.setGmm(gmm.get(), 0); auto bltCmd = FamilyType::cmdInitXyCopyBlt; @@ -536,10 +536,10 @@ HWTEST2_F(BlitTests, givenInvalidResourceWhenAppendSurfaceTypeThenSurfaceTypeDoe MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocationSrc.setGmm(gmm.get(), 0); mockAllocationDst.setGmm(gmm.get(), 0); auto bltCmd = FamilyType::cmdInitXyCopyBlt; @@ -560,10 +560,10 @@ HWTEST2_F(BlitTests, givenResourcesWithoutGmmsWhenAppendSurfaceTypeThenSurfaceTy using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT; MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); auto bltCmd = FamilyType::cmdInitXyCopyBlt; BlitProperties properties = {}; properties.srcAllocation = &mockAllocationSrc; @@ -593,7 +593,7 @@ HWTEST2_F(BlitTests, givenGmmParamsWhenGetBlitAllocationPropertiesIsCalledThenCo resInfo.RenderCompressed = renderCompressed; MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); mockAllocationSrc.setGmm(gmm.get(), 0); BlitProperties properties = {}; properties.srcAllocation = &mockAllocationSrc; @@ -636,10 +636,10 @@ HWTEST2_F(BlitTests, givenResourceWithoutGmmWhenAppendImageCommandsThenPitchEqua using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT; MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); auto bltCmd = FamilyType::cmdInitXyCopyBlt; @@ -660,10 +660,10 @@ HWTEST2_F(BlitTests, givenInputAndDefaultSlicePitchWhenAppendBlitCommandsForImag using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT; MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor; auto bltCmd = FamilyType::cmdInitXyCopyBlt; BlitProperties properties = {}; @@ -701,10 +701,10 @@ HWTEST2_F(BlitTests, givenResourceInfoWithZeroPitchWhenAppendImageCommandsThenPi gmm->gmmResourceInfo.reset(new MyMockResourecInfo(pDevice->getRootDeviceEnvironment().getGmmClientContext(), &gmmParams)); MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); mockAllocationSrc.setGmm(gmm.get(), 0); mockAllocationDst.setGmm(gmm.get(), 0); @@ -734,10 +734,10 @@ HWTEST2_F(BlitTests, givenTiledAllocationWhenAppendBlitCommandsForImagesThenBlit flags->Info.Tile64 = true; MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); mockAllocationSrc.setGmm(gmm.get(), 0); mockAllocationDst.setGmm(gmm.get(), 0); @@ -763,10 +763,10 @@ HWTEST2_F(BlitTests, givenAlocationsWhenAppendBlitCommandsForImagesThenSurfaceSi auto gmm = std::make_unique(pDevice->getGmmClientContext()); MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor; mockAllocationSrc.setGmm(gmm.get(), 0); mockAllocationDst.setGmm(gmm.get(), 0); @@ -801,10 +801,10 @@ HWTEST2_F(BlitTests, givenLinearResourceInfoWithNotZeroPitchWhenAppendImageComma gmm->gmmResourceInfo.reset(myResourecInfo.release()); MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); mockAllocationSrc.setGmm(gmm.get(), 0); mockAllocationDst.setGmm(gmm.get(), 0); @@ -831,10 +831,10 @@ HWTEST2_F(BlitTests, givenLinearResorcesWhenAppendSliceOffsetsThenAdressAreOffse BlitProperties properties = {}; MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockClearColor(reinterpret_cast(0x1234), sizeof(uint32_t)); properties.copySize = {0x10, 0x10, 0x1}; properties.srcAllocation = &mockAllocationSrc; @@ -861,10 +861,10 @@ HWTEST2_F(BlitTests, givenTiledResorcesWhenAppendSliceOffsetsThenIndexsAreSet, I BlitProperties properties = {}; MockGraphicsAllocation mockAllocationSrc(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); MockGraphicsAllocation mockAllocationDst(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, sizeof(uint32_t), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); bltCmd.setSourceTiling(XY_COPY_BLT::TILING::TILING_TILE64); bltCmd.setDestinationTiling(XY_COPY_BLT::TILING::TILING_TILE64); uint32_t index = 1; @@ -883,7 +883,7 @@ HWTEST2_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBl LinearStream stream(streamBuffer, sizeof(streamBuffer)); MockGraphicsAllocation mockAllocation(0, GraphicsAllocation::AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth * sizeof(uint32_t)), - MemoryPool::System4KBPages, mockMaxOsContextCount); + MemoryPool::System4KBPages, MemoryManager::maxOsContextCount); BlitCommandsHelper::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]); GenCmdList cmdList; ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer( diff --git a/shared/test/common/mocks/mock_graphics_allocation.h b/shared/test/common/mocks/mock_graphics_allocation.h index 326f36782f..02e333b767 100644 --- a/shared/test/common/mocks/mock_graphics_allocation.h +++ b/shared/test/common/mocks/mock_graphics_allocation.h @@ -14,7 +14,6 @@ namespace NEO { constexpr uint32_t mockRootDeviceIndex = 0u; constexpr DeviceBitfield mockDeviceBitfield(0b1); -constexpr size_t mockMaxOsContextCount = 4u; class MockGraphicsAllocation : public MemoryAllocation { public: @@ -29,16 +28,16 @@ class MockGraphicsAllocation : public MemoryAllocation { using MemoryAllocation::usageInfos; MockGraphicsAllocation() - : MemoryAllocation(0, AllocationType::UNKNOWN, nullptr, 0u, 0, MemoryPool::MemoryNull, mockMaxOsContextCount) {} + : MemoryAllocation(0, AllocationType::UNKNOWN, nullptr, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} MockGraphicsAllocation(void *buffer, size_t sizeIn) - : MemoryAllocation(0, AllocationType::UNKNOWN, buffer, castToUint64(buffer), 0llu, sizeIn, MemoryPool::MemoryNull, mockMaxOsContextCount) {} + : MemoryAllocation(0, AllocationType::UNKNOWN, buffer, castToUint64(buffer), 0llu, sizeIn, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} MockGraphicsAllocation(void *buffer, uint64_t gpuAddr, size_t sizeIn) - : MemoryAllocation(0, AllocationType::UNKNOWN, buffer, gpuAddr, 0llu, sizeIn, MemoryPool::MemoryNull, mockMaxOsContextCount) {} + : MemoryAllocation(0, AllocationType::UNKNOWN, buffer, gpuAddr, 0llu, sizeIn, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} MockGraphicsAllocation(uint32_t rootDeviceIndex, void *buffer, size_t sizeIn) - : MemoryAllocation(rootDeviceIndex, AllocationType::UNKNOWN, buffer, castToUint64(buffer), 0llu, sizeIn, MemoryPool::MemoryNull, mockMaxOsContextCount) {} + : MemoryAllocation(rootDeviceIndex, AllocationType::UNKNOWN, buffer, castToUint64(buffer), 0llu, sizeIn, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount) {} void resetInspectionIds() { for (auto &usageInfo : usageInfos) { diff --git a/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp b/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp index be4ce127b5..453988c7c5 100644 --- a/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp +++ b/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp @@ -14,16 +14,16 @@ using namespace NEO; TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenIsCreatedThenAllInspectionIdsAreSetToZero) { - MockGraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, mockMaxOsContextCount); - for (auto i = 0u; i < mockMaxOsContextCount; i++) { + MockGraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); + for (auto i = 0u; i < MemoryManager::maxOsContextCount; i++) { EXPECT_EQ(0u, graphicsAllocation.getInspectionId(i)); } } TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenIsCreatedThenTaskCountsAreInitializedProperly) { - GraphicsAllocation graphicsAllocation1(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, mockMaxOsContextCount); - GraphicsAllocation graphicsAllocation2(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, mockMaxOsContextCount); - for (auto i = 0u; i < mockMaxOsContextCount; i++) { + GraphicsAllocation graphicsAllocation1(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); + GraphicsAllocation graphicsAllocation2(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, MemoryPool::MemoryNull, MemoryManager::maxOsContextCount); + for (auto i = 0u; i < MemoryManager::maxOsContextCount; i++) { EXPECT_EQ(MockGraphicsAllocation::objectNotUsed, graphicsAllocation1.getTaskCount(i)); EXPECT_EQ(MockGraphicsAllocation::objectNotUsed, graphicsAllocation2.getTaskCount(i)); EXPECT_EQ(MockGraphicsAllocation::objectNotResident, graphicsAllocation1.getResidencyTaskCount(i)); @@ -41,13 +41,13 @@ TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenUpdatedTaskCountThenOnly MockGraphicsAllocation graphicsAllocation; graphicsAllocation.updateTaskCount(1u, 0u); EXPECT_EQ(1u, graphicsAllocation.getTaskCount(0u)); - for (auto i = 1u; i < mockMaxOsContextCount; i++) { + for (auto i = 1u; i < MemoryManager::maxOsContextCount; i++) { EXPECT_EQ(MockGraphicsAllocation::objectNotUsed, graphicsAllocation.getTaskCount(i)); } graphicsAllocation.updateTaskCount(2u, 1u); EXPECT_EQ(1u, graphicsAllocation.getTaskCount(0u)); EXPECT_EQ(2u, graphicsAllocation.getTaskCount(1u)); - for (auto i = 2u; i < mockMaxOsContextCount; i++) { + for (auto i = 2u; i < MemoryManager::maxOsContextCount; i++) { EXPECT_EQ(MockGraphicsAllocation::objectNotUsed, graphicsAllocation.getTaskCount(i)); } } @@ -224,7 +224,7 @@ TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenQueryingUsedPageSizeThen MemoryPool::SystemCpuInaccessible}; for (auto pool : page4kPools) { - MockGraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, (osHandle)1, pool, mockMaxOsContextCount); + MockGraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, (osHandle)1, pool, MemoryManager::maxOsContextCount); EXPECT_EQ(MemoryConstants::pageSize, graphicsAllocation.getUsedPageSize()); } @@ -234,7 +234,7 @@ TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenQueryingUsedPageSizeThen MemoryPool::LocalMemory}; for (auto pool : page64kPools) { - MockGraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, pool, mockMaxOsContextCount); + MockGraphicsAllocation graphicsAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0u, 0u, 0, pool, MemoryManager::maxOsContextCount); EXPECT_EQ(MemoryConstants::pageSize64k, graphicsAllocation.getUsedPageSize()); }