From 9f6eab0689ac0d31142d95a97ba33cafd63cf31f Mon Sep 17 00:00:00 2001 From: "Dunajski, Bartosz" Date: Fri, 8 Feb 2019 08:29:45 +0100 Subject: [PATCH] Change allocation properties for TIMESTAMP_PACKET_TAG_BUFFER type Change-Id: Ied1c0d4d7ecd27104421a5cde6c79c04c4222265 Signed-off-by: Dunajski, Bartosz --- runtime/memory_manager/memory_manager.cpp | 2 +- .../memory_manager_allocate_in_preferred_pool_tests.inl | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/runtime/memory_manager/memory_manager.cpp b/runtime/memory_manager/memory_manager.cpp index 1edab5b787..390ef8c0bc 100644 --- a/runtime/memory_manager/memory_manager.cpp +++ b/runtime/memory_manager/memory_manager.cpp @@ -258,7 +258,6 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo switch (properties.allocationType) { case GraphicsAllocation::AllocationType::UNDECIDED: case GraphicsAllocation::AllocationType::FILL_PATTERN: - case GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: case GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER: allocationData.flags.useSystemMemory = true; break; @@ -279,6 +278,7 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo case GraphicsAllocation::AllocationType::LINEAR_STREAM: case GraphicsAllocation::AllocationType::KERNEL_ISA: case GraphicsAllocation::AllocationType::INTERNAL_HEAP: + case GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: allocationData.flags.requiresCpuAccess = true; break; default: diff --git a/unit_tests/memory_manager/memory_manager_allocate_in_preferred_pool_tests.inl b/unit_tests/memory_manager/memory_manager_allocate_in_preferred_pool_tests.inl index 9f56d2cc29..7bb585bbe9 100644 --- a/unit_tests/memory_manager/memory_manager_allocate_in_preferred_pool_tests.inl +++ b/unit_tests/memory_manager/memory_manager_allocate_in_preferred_pool_tests.inl @@ -381,16 +381,18 @@ TEST(MemoryManagerTest, givenLinearStreamTypeWhenGetAllocationDataIsCalledThenSy EXPECT_TRUE(allocData.flags.requiresCpuAccess); } -TEST(MemoryManagerTest, givenTimestampTagBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) { +TEST(MemoryManagerTest, givenTimestampPacketTagBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsNotRequestedAndRequireCpuAccess) { AllocationData allocData; MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER}, 0, nullptr); - EXPECT_TRUE(allocData.flags.useSystemMemory); + 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); EXPECT_TRUE(allocData.flags.useSystemMemory); + EXPECT_FALSE(allocData.flags.requiresCpuAccess); } TEST(MemoryManagerTest, givenAllocationPropertiesWithMultiOsContextCapableFlagEnabledWhenAllocateMemoryThenAllocationIsMultiOsContextCapable) {