diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 8525e3cb25..a381a77078 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -380,6 +380,7 @@ DECLARE_DEBUG_VARIABLE(bool, ForceNonCoherentModeForTimestamps, false, "When act DECLARE_DEBUG_VARIABLE(bool, SetAssumeNotInUse, true, "Set AssumeNotInUse flag in d3d destroy allocation.") DECLARE_DEBUG_VARIABLE(bool, MitigateHostVisibleSignal, false, "Reset host visible signal in CB events, flush L3 when synchronize") DECLARE_DEBUG_VARIABLE(bool, ForceZeroCopyForUseHostPtr, false, "When active all buffer allocations created with CL_MEM_USE_HOST_PTR flag will use share memory with CPU.") +DECLARE_DEBUG_VARIABLE(bool, DummyPageBackingEnabled, false, "When true, pass page backing flag to KMD to recover from page faults. Windows only."); DECLARE_DEBUG_VARIABLE(int32_t, EnableReusingGpuTimestamps, -1, "Reuse GPU timestamp for next device time requests. -1: os-specific, 0: disable, 1: enable") DECLARE_DEBUG_VARIABLE(int32_t, AllowZeroCopyWithoutCoherency, -1, "Use cacheline flush instead of memory copy for map/unmap mem object") DECLARE_DEBUG_VARIABLE(int32_t, EnableHostPtrTracking, -1, "Enable host ptr tracking: -1 - default platform setting, 0 - disabled, 1 - enabled") diff --git a/shared/source/os_interface/windows/sharedata_wrapper.h b/shared/source/os_interface/windows/sharedata_wrapper.h index c9c37b47f2..72799509bc 100644 --- a/shared/source/os_interface/windows/sharedata_wrapper.h +++ b/shared/source/os_interface/windows/sharedata_wrapper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2024 Intel Corporation + * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -158,13 +158,14 @@ struct CREATECONTEXT_PVTDATA { // NOLINT(readability-identifier-naming) unsigned long *pHwContextId; uint32_t NumberOfHwContextIds; // NOLINT(readability-identifier-naming) - uint32_t ProcessID; // NOLINT(readability-identifier-naming) - uint8_t IsProtectedProcess; // NOLINT(readability-identifier-naming) - uint8_t IsDwm; // NOLINT(readability-identifier-naming) - uint8_t IsMediaUsage; // NOLINT(readability-identifier-naming) - uint8_t GpuVAContext; // NOLINT(readability-identifier-naming) - BOOLEAN NoRingFlushes; // NOLINT(readability-identifier-naming) - uint32_t UmdContextType; // NOLINT(readability-identifier-naming) + uint32_t ProcessID; // NOLINT(readability-identifier-naming) + uint8_t IsProtectedProcess; // NOLINT(readability-identifier-naming) + uint8_t IsDwm; // NOLINT(readability-identifier-naming) + uint8_t IsMediaUsage; // NOLINT(readability-identifier-naming) + uint8_t GpuVAContext; // NOLINT(readability-identifier-naming) + BOOLEAN NoRingFlushes; // NOLINT(readability-identifier-naming) + BOOLEAN DummyPageBackingEnabled; // NOLINT(readability-identifier-naming) + uint32_t UmdContextType; // NOLINT(readability-identifier-naming) }; struct PLATFORM_KMD : PLATFORM_GMM { // NOLINT(readability-identifier-naming) diff --git a/shared/source/os_interface/windows/wddm/wddm.cpp b/shared/source/os_interface/windows/wddm/wddm.cpp index 5c7b42e5e5..e97ab37b90 100644 --- a/shared/source/os_interface/windows/wddm/wddm.cpp +++ b/shared/source/os_interface/windows/wddm/wddm.cpp @@ -1006,6 +1006,7 @@ bool Wddm::createContext(OsContextWin &osContext) { privateData.ProcessID = NEO::SysCalls::getProcessId(); privateData.pHwContextId = &hwContextId; privateData.NoRingFlushes = debugManager.flags.UseNoRingFlushesKmdMode.get(); + privateData.DummyPageBackingEnabled = debugManager.flags.DummyPageBackingEnabled.get(); applyAdditionalContextFlags(privateData, osContext); diff --git a/shared/test/common/test_files/igdrcl.config b/shared/test/common/test_files/igdrcl.config index c441cc4c80..f1c8f3f128 100644 --- a/shared/test/common/test_files/igdrcl.config +++ b/shared/test/common/test_files/igdrcl.config @@ -663,5 +663,6 @@ DirectSubmissionRelaxedOrderingCounterHeuristicTreshold = -1 ClearStandaloneInOrderTimestampAllocation = -1 PipelinedEuThreadArbitration = -1 ExperimentalUSMAllocationReuseCleaner = -1 +DummyPageBackingEnabled = 0 EnableDeferBacking = 0 # Please don't edit below this line diff --git a/shared/test/unit_test/os_interface/windows/wddm20_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm20_tests.cpp index a54ba1af7e..4065e64ea4 100644 --- a/shared/test/unit_test/os_interface/windows/wddm20_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm20_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2024 Intel Corporation + * Copyright (C) 2018-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -833,6 +833,22 @@ TEST_F(Wddm20WithMockGdiDllTestsWithoutWddmInit, givenUseNoRingFlushesKmdModeDeb EXPECT_TRUE(!!privateData->NoRingFlushes); } +TEST_F(Wddm20WithMockGdiDllTestsWithoutWddmInit, whenCreateContextIsCalledThenDummyPageBackingEnabledFlagIsDisabled) { + init(); + auto createContextParams = this->getCreateContextDataFcn(); + auto privateData = (CREATECONTEXT_PVTDATA *)createContextParams->pPrivateDriverData; + EXPECT_FALSE(!!privateData->DummyPageBackingEnabled); +} + +TEST_F(Wddm20WithMockGdiDllTestsWithoutWddmInit, givenDummyPageBackingEnabledFlagSetToTrueWhenCreateContextIsCalledThenFlagIsEnabled) { + DebugManagerStateRestore dbgRestore; + debugManager.flags.DummyPageBackingEnabled.set(true); + init(); + auto createContextParams = this->getCreateContextDataFcn(); + auto privateData = (CREATECONTEXT_PVTDATA *)createContextParams->pPrivateDriverData; + EXPECT_TRUE(!!privateData->DummyPageBackingEnabled); +} + TEST_F(Wddm20WithMockGdiDllTestsWithoutWddmInit, givenEngineTypeWhenCreatingContextThenPassCorrectNodeOrdinal) { init(); auto createContextParams = this->getCreateContextDataFcn();