diff --git a/shared/source/memory_manager/graphics_allocation.cpp b/shared/source/memory_manager/graphics_allocation.cpp index d0ea3fd342..73f90dc52e 100644 --- a/shared/source/memory_manager/graphics_allocation.cpp +++ b/shared/source/memory_manager/graphics_allocation.cpp @@ -139,6 +139,10 @@ void GraphicsAllocation::updateCompletionDataForAllocationAndFragments(uint64_t } bool GraphicsAllocation::hasAllocationReadOnlyType() { + if (allocationType == AllocationType::kernelIsa || + allocationType == AllocationType::kernelIsaInternal) { + return true; + } if (debugManager.flags.ReadOnlyAllocationsTypeMask.get() != 0) { UNRECOVERABLE_IF(allocationType == AllocationType::unknown); auto maskVal = debugManager.flags.ReadOnlyAllocationsTypeMask.get(); 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 7feb3831cf..ac981bacb2 100644 --- a/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp +++ b/shared/test/unit_test/memory_manager/graphics_allocation_tests.cpp @@ -604,24 +604,24 @@ TEST(GraphicsAllocationTest, givenGraphicsAllocationsWhenAllocationTypeIsLinearS graphicsAllocation.allocationType = AllocationType::linearStream; EXPECT_TRUE(graphicsAllocation.hasAllocationReadOnlyType()); } -TEST(GraphicsAllocationTest, givenGraphicsAllocationsWhenAllocationTypeIsKernelIsaAndMaskDoesNotSupportItThenAllocationHasNotReadonlyType) { +TEST(GraphicsAllocationTest, givenGraphicsAllocationsWhenAllocationTypeIsKernelIsaAndMaskDoesNotSupportItThenAllocationHasReadonlyType) { DebugManagerStateRestore restorer; auto mask = 1llu << (static_cast(AllocationType::linearStream) - 1); debugManager.flags.ReadOnlyAllocationsTypeMask.set(mask); MockGraphicsAllocation graphicsAllocation; graphicsAllocation.hasAllocationReadOnlyTypeCallBase = true; graphicsAllocation.allocationType = AllocationType::kernelIsa; - EXPECT_FALSE(graphicsAllocation.hasAllocationReadOnlyType()); + EXPECT_TRUE(graphicsAllocation.hasAllocationReadOnlyType()); } -TEST(GraphicsAllocationTest, givenGraphicsAllocationsWhenAllocationTypeIsInternalIsaAndMaskDoesNotSupportItThenAllocationHasNotReadonlyType) { +TEST(GraphicsAllocationTest, givenGraphicsAllocationsWhenAllocationTypeIsInternalIsaAndMaskDoesNotSupportItThenAllocationHasReadonlyType) { DebugManagerStateRestore restorer; auto mask = 1llu << (static_cast(AllocationType::kernelIsa) - 1); debugManager.flags.ReadOnlyAllocationsTypeMask.set(mask); MockGraphicsAllocation graphicsAllocation; graphicsAllocation.hasAllocationReadOnlyTypeCallBase = true; graphicsAllocation.allocationType = AllocationType::kernelIsaInternal; - EXPECT_FALSE(graphicsAllocation.hasAllocationReadOnlyType()); + EXPECT_TRUE(graphicsAllocation.hasAllocationReadOnlyType()); } TEST(GraphicsAllocationTest, givenGraphicsAllocationsWhenAllocationTypeIsCommandBufferAndMaskDoesNotSupportItThenAllocationHasNotReadonlyType) { DebugManagerStateRestore restorer;