Revert "fix: Dont enable scratch pages when debugger is on"

This reverts commit 18d04b239e.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2025-01-29 00:53:43 +01:00
committed by Compute-Runtime-Automation
parent a8779c2387
commit 7cbe19c5a9
3 changed files with 20 additions and 22 deletions

View File

@@ -1153,9 +1153,9 @@ void Drm::configureScratchPagePolicy() {
disableScratch = !!debugManager.flags.DisableScratchPages.get();
return;
}
const auto &productHelper = this->getRootDeviceEnvironment().getHelper<ProductHelper>();
disableScratch = productHelper.isDisableScratchPagesSupported() || rootDeviceEnvironment.executionEnvironment.isDebuggingEnabled();
disableScratch = (productHelper.isDisableScratchPagesSupported() &&
!rootDeviceEnvironment.executionEnvironment.isDebuggingEnabled());
}
void Drm::configureGpuFaultCheckThreshold() {

View File

@@ -31,7 +31,6 @@ class DrmMock : public Drm {
using Drm::chunkingMode;
using Drm::completionFenceSupported;
using Drm::contextDebugSupported;
using Drm::disableScratch;
using Drm::engineInfo;
using Drm::engineInfoQueried;
using Drm::fenceVal;

View File

@@ -309,28 +309,10 @@ TEST(DrmBufferObjectTestPrelim, givenDisableScratchPagesWhenCreateDrmVirtualMemo
EXPECT_TRUE(drm.receivedGemVmControl.flags & DrmPrelimHelper::getDisableScratchVmCreateFlag());
}
TEST(DrmBufferObjectPrelim, givenDebuggingEnabledWithoutDisableScratchPagesFlagSetWhenCreateDrmVirtualMemoryThenDisableScratchPagesFlagIsSet) {
TEST(DrmBufferObjectPrelim, givenDebuggingEnabledWithoutDisableScratchPagesFlagSetWhenCreateDrmVirtualMemoryThenDisableScratchPagesFlagIsNotSet) {
DebugManagerStateRestore restorer;
debugManager.flags.UseTileMemoryBankInVirtualMemoryCreation.set(0u);
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
drm.configureScratchPagePolicy();
drm.configureGpuFaultCheckThreshold();
EXPECT_TRUE(drm.disableScratch);
uint32_t vmId = 0;
drm.createDrmVirtualMemory(vmId);
EXPECT_TRUE(drm.receivedGemVmControl.flags & DrmPrelimHelper::getDisableScratchVmCreateFlag());
}
TEST(DrmBufferObjectTestPrelim, givenDisableScratchPagesDebugKeyOffAndDebuggingEnabledWhenCreateDrmVirtualMemoryThenEnvVariableIsPriority) {
DebugManagerStateRestore restorer;
debugManager.flags.DisableScratchPages.set(0);
debugManager.flags.UseTileMemoryBankInVirtualMemoryCreation.set(0u);
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
@@ -343,6 +325,23 @@ TEST(DrmBufferObjectTestPrelim, givenDisableScratchPagesDebugKeyOffAndDebuggingE
EXPECT_FALSE(drm.receivedGemVmControl.flags & DrmPrelimHelper::getDisableScratchVmCreateFlag());
}
TEST(DrmBufferObjectTestPrelim, givenDisableScratchPagesAndDebuggingEnabledWhenCreateDrmVirtualMemoryThenEnvVariableIsPriority) {
DebugManagerStateRestore restorer;
debugManager.flags.DisableScratchPages.set(1);
debugManager.flags.UseTileMemoryBankInVirtualMemoryCreation.set(0u);
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
drm.configureScratchPagePolicy();
drm.configureGpuFaultCheckThreshold();
uint32_t vmId = 0;
drm.createDrmVirtualMemory(vmId);
EXPECT_TRUE(drm.receivedGemVmControl.flags & DrmPrelimHelper::getDisableScratchVmCreateFlag());
}
TEST(DrmBufferObjectTestPrelim, givenLocalMemoryDisabledWhenCreateDrmVirtualMemoryThenVmRegionExtensionIsNotPassed) {
DebugManagerStateRestore restorer;
debugManager.flags.EnableLocalMemory.set(0);