mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
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:
committed by
Compute-Runtime-Automation
parent
a8779c2387
commit
7cbe19c5a9
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user