L0 Debug - Zero init debug surface in windows

Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
This commit is contained in:
Yates, Brandon
2022-10-21 04:18:01 +00:00
committed by Compute-Runtime-Automation
parent ade323ce90
commit 518016f20f
2 changed files with 15 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/engine_descriptor_helper.h"
#include "shared/test/common/helpers/execution_environment_helper.h"
#include "shared/test/common/helpers/gtest_helpers.h"
#include "shared/test/common/helpers/ult_hw_config.h"
#include "shared/test/common/helpers/unit_test_helper.h"
#include "shared/test/common/mocks/mock_deferred_deleter.h"
@ -172,6 +173,18 @@ TEST(WddmMemoryManagerWithDeferredDeleterTest, givenWmmWhenAsyncDeleterIsEnabled
executionEnvironment->decRefInternal();
}
TEST_F(WddmMemoryManagerSimpleTest, givenAllocateGraphicsMemoryWithPropertiesCalledWithDebugSurfaceTypeThenDebugSurfaceIsCreatedAndZerod) {
AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, 0b1011};
auto debugSurface = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties(debugSurfaceProperties));
EXPECT_NE(nullptr, debugSurface);
auto mem = debugSurface->getUnderlyingBuffer();
auto size = debugSurface->getUnderlyingBufferSize();
EXPECT_TRUE(memoryZeroed(mem, size));
memoryManager->freeGraphicsMemory(debugSurface);
}
TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWhenAllocateGraphicsMemoryIsCalledThenMemoryPoolIsSystem4KBPages) {
memoryManager.reset(new MockWddmMemoryManager(false, false, *executionEnvironment));
if (memoryManager->isLimitedGPU(0)) {