From a585cb45b709700149922b49c5031dc9c918320a Mon Sep 17 00:00:00 2001 From: Compute-Runtime-Validation Date: Sat, 12 Jul 2025 07:18:56 +0200 Subject: [PATCH] Revert "fix: use alignment when allocate by kmd" This reverts commit 72492a9a1813e75221c12de037eaf00f0f65b873. Signed-off-by: Compute-Runtime-Validation --- .../os_interface/windows/wddm_memory_manager.cpp | 2 +- shared/test/common/mocks/mock_wddm.cpp | 2 -- shared/test/common/mocks/wddm_mock_helpers.h | 1 - .../windows/wddm_memory_manager_tests.cpp | 12 ------------ 4 files changed, 1 insertion(+), 16 deletions(-) diff --git a/shared/source/os_interface/windows/wddm_memory_manager.cpp b/shared/source/os_interface/windows/wddm_memory_manager.cpp index 55433e9acb..c0dd3d7491 100644 --- a/shared/source/os_interface/windows/wddm_memory_manager.cpp +++ b/shared/source/os_interface/windows/wddm_memory_manager.cpp @@ -165,7 +165,7 @@ GraphicsAllocation *WddmMemoryManager::allocateMemoryByKMD(const AllocationData GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = allocationData.flags.preferCompressed; - auto gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), allocationData.hostPtr, allocationData.size, allocationData.alignment, + auto gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), allocationData.hostPtr, allocationData.size, 0u, CacheSettingsHelper::getGmmUsageType(allocationData.type, !!allocationData.flags.uncacheable, productHelper, hwInfo), systemMemoryStorageInfo, gmmRequirements); auto allocation = std::make_unique(allocationData.rootDeviceIndex, 1u, // numGmms diff --git a/shared/test/common/mocks/mock_wddm.cpp b/shared/test/common/mocks/mock_wddm.cpp index f35b3d37f0..d6ff588bdb 100644 --- a/shared/test/common/mocks/mock_wddm.cpp +++ b/shared/test/common/mocks/mock_wddm.cpp @@ -9,7 +9,6 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" -#include "shared/source/gmm_helper/gmm.h" #include "shared/source/helpers/aligned_memory.h" #include "shared/source/os_interface/windows/gdi_interface.h" #include "shared/source/os_interface/windows/os_environment_win.h" @@ -104,7 +103,6 @@ bool WddmMock::mapGpuVirtualAddress(Gmm *gmm, D3DKMT_HANDLE handle, D3DGPU_VIRTU mapGpuVirtualAddressResult.called++; mapGpuVirtualAddressResult.cpuPtrPassed = reinterpret_cast(preferredAddress); mapGpuVirtualAddressResult.uint64ParamPassed = preferredAddress; - mapGpuVirtualAddressResult.alignment = gmm->resourceParams.BaseAlignment; if (callBaseMapGpuVa) { return mapGpuVirtualAddressResult.success = Wddm::mapGpuVirtualAddress(gmm, handle, minimumAddress, maximumAddress, preferredAddress, gpuPtr, type); } else { diff --git a/shared/test/common/mocks/wddm_mock_helpers.h b/shared/test/common/mocks/wddm_mock_helpers.h index fb8b85bee7..ba2c78e415 100644 --- a/shared/test/common/mocks/wddm_mock_helpers.h +++ b/shared/test/common/mocks/wddm_mock_helpers.h @@ -18,7 +18,6 @@ namespace WddmMockHelpers { struct CallResult { uint32_t called = 0; uint64_t uint64ParamPassed = -1; - size_t alignment = 0; bool success = false; void *cpuPtrPassed = nullptr; }; diff --git a/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp index 473826b9a6..95d19631fe 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp @@ -1173,18 +1173,6 @@ TEST_F(WddmMemoryManagerSimpleTest, GivenShareableEnabledAndHugeSizeWhenAskedToC memoryManager->freeGraphicsMemory(allocation); } -TEST_F(WddmMemoryManagerSimpleTest, GivenMemoryManagerWhenAllocateByKmdThenAlignmentIsCorrect) { - memoryManager.reset(new MockWddmMemoryManager(false, false, executionEnvironment)); - AllocationData allocationData; - allocationData.size = 2ULL * MemoryConstants::pageSize64k; - allocationData.flags.shareable = true; - allocationData.alignment = 8388608; - auto allocation = memoryManager->allocateMemoryByKMD(allocationData); - EXPECT_NE(nullptr, allocation); - EXPECT_EQ(static_cast(&memoryManager->getWddm(0u))->mapGpuVirtualAddressResult.alignment, allocationData.alignment); - memoryManager->freeGraphicsMemory(allocation); -} - TEST_F(WddmMemoryManagerSimpleTest, GivenShareableEnabledAndSmallSizeWhenAskedToCreatePhysicalGraphicsAllocationThenValidAllocationIsReturned) { memoryManager.reset(new MockWddmMemoryManager(false, false, executionEnvironment)); memoryManager->hugeGfxMemoryChunkSize = MemoryConstants::pageSize64k;