Skip to content

Commit 7cbe19c

Browse files
Revert "fix: Dont enable scratch pages when debugger is on"
This reverts commit 18d04b2. Signed-off-by: Compute-Runtime-Validation <[email protected]>
1 parent a8779c2 commit 7cbe19c

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

shared/source/os_interface/linux/drm_neo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,9 +1153,9 @@ void Drm::configureScratchPagePolicy() {
11531153
disableScratch = !!debugManager.flags.DisableScratchPages.get();
11541154
return;
11551155
}
1156-
11571156
const auto &productHelper = this->getRootDeviceEnvironment().getHelper<ProductHelper>();
1158-
disableScratch = productHelper.isDisableScratchPagesSupported() || rootDeviceEnvironment.executionEnvironment.isDebuggingEnabled();
1157+
disableScratch = (productHelper.isDisableScratchPagesSupported() &&
1158+
!rootDeviceEnvironment.executionEnvironment.isDebuggingEnabled());
11591159
}
11601160

11611161
void Drm::configureGpuFaultCheckThreshold() {

shared/test/common/libult/linux/drm_mock.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class DrmMock : public Drm {
3131
using Drm::chunkingMode;
3232
using Drm::completionFenceSupported;
3333
using Drm::contextDebugSupported;
34-
using Drm::disableScratch;
3534
using Drm::engineInfo;
3635
using Drm::engineInfoQueried;
3736
using Drm::fenceVal;

shared/test/unit_test/os_interface/linux/drm_query_prelim_tests.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ TEST(DrmBufferObjectTestPrelim, givenDisableScratchPagesWhenCreateDrmVirtualMemo
309309
EXPECT_TRUE(drm.receivedGemVmControl.flags & DrmPrelimHelper::getDisableScratchVmCreateFlag());
310310
}
311311

312-
TEST(DrmBufferObjectPrelim, givenDebuggingEnabledWithoutDisableScratchPagesFlagSetWhenCreateDrmVirtualMemoryThenDisableScratchPagesFlagIsSet) {
312+
TEST(DrmBufferObjectPrelim, givenDebuggingEnabledWithoutDisableScratchPagesFlagSetWhenCreateDrmVirtualMemoryThenDisableScratchPagesFlagIsNotSet) {
313313
DebugManagerStateRestore restorer;
314314
debugManager.flags.UseTileMemoryBankInVirtualMemoryCreation.set(0u);
315315

@@ -318,17 +318,16 @@ TEST(DrmBufferObjectPrelim, givenDebuggingEnabledWithoutDisableScratchPagesFlagS
318318
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
319319
drm.configureScratchPagePolicy();
320320
drm.configureGpuFaultCheckThreshold();
321-
EXPECT_TRUE(drm.disableScratch);
322321

323322
uint32_t vmId = 0;
324323
drm.createDrmVirtualMemory(vmId);
325324

326-
EXPECT_TRUE(drm.receivedGemVmControl.flags & DrmPrelimHelper::getDisableScratchVmCreateFlag());
325+
EXPECT_FALSE(drm.receivedGemVmControl.flags & DrmPrelimHelper::getDisableScratchVmCreateFlag());
327326
}
328327

329-
TEST(DrmBufferObjectTestPrelim, givenDisableScratchPagesDebugKeyOffAndDebuggingEnabledWhenCreateDrmVirtualMemoryThenEnvVariableIsPriority) {
328+
TEST(DrmBufferObjectTestPrelim, givenDisableScratchPagesAndDebuggingEnabledWhenCreateDrmVirtualMemoryThenEnvVariableIsPriority) {
330329
DebugManagerStateRestore restorer;
331-
debugManager.flags.DisableScratchPages.set(0);
330+
debugManager.flags.DisableScratchPages.set(1);
332331
debugManager.flags.UseTileMemoryBankInVirtualMemoryCreation.set(0u);
333332

334333
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
@@ -340,7 +339,7 @@ TEST(DrmBufferObjectTestPrelim, givenDisableScratchPagesDebugKeyOffAndDebuggingE
340339
uint32_t vmId = 0;
341340
drm.createDrmVirtualMemory(vmId);
342341

343-
EXPECT_FALSE(drm.receivedGemVmControl.flags & DrmPrelimHelper::getDisableScratchVmCreateFlag());
342+
EXPECT_TRUE(drm.receivedGemVmControl.flags & DrmPrelimHelper::getDisableScratchVmCreateFlag());
344343
}
345344

346345
TEST(DrmBufferObjectTestPrelim, givenLocalMemoryDisabledWhenCreateDrmVirtualMemoryThenVmRegionExtensionIsNotPassed) {

0 commit comments

Comments
 (0)