mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Set cooperative flag for debuggable contexts during creation
Related-To: NEO-6668 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
cd9cc53159
commit
b71a12c252
@ -607,6 +607,7 @@ TEST(DrmTest, givenProgramDebuggingAndContextDebugAvailableWhenCreatingContextTh
|
||||
|
||||
DrmMockNonFailing drmMock(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
drmMock.contextDebugSupported = true;
|
||||
drmMock.callBaseCreateDrmContext = false;
|
||||
|
||||
OsContextLinux osContext(drmMock, 5u, EngineDescriptorHelper::getDefaultDescriptor());
|
||||
osContext.ensureContextInitialized();
|
||||
@ -632,6 +633,37 @@ TEST(DrmTest, givenProgramDebuggingAndContextDebugAvailableWhenCreatingContextFo
|
||||
EXPECT_EQ(static_cast<uint32_t>(-1), drmMock.passedContextDebugId);
|
||||
}
|
||||
|
||||
TEST(DrmTest, givenNotEnabledDebuggingOrContextDebugUnsupportedWhenCreatingContextThenCooperativeFlagIsNotPassedToCreateDrmContext) {
|
||||
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
|
||||
executionEnvironment->calculateMaxOsContextCount();
|
||||
executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
|
||||
|
||||
DrmMockNonFailing drmMock(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
|
||||
drmMock.contextDebugSupported = true;
|
||||
drmMock.callBaseCreateDrmContext = false;
|
||||
drmMock.capturedCooperativeContextRequest = true;
|
||||
|
||||
EXPECT_FALSE(executionEnvironment->isDebuggingEnabled());
|
||||
|
||||
OsContextLinux osContext(drmMock, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular}));
|
||||
osContext.ensureContextInitialized();
|
||||
|
||||
EXPECT_FALSE(drmMock.capturedCooperativeContextRequest);
|
||||
|
||||
executionEnvironment->setDebuggingEnabled();
|
||||
drmMock.contextDebugSupported = false;
|
||||
drmMock.callBaseCreateDrmContext = false;
|
||||
drmMock.capturedCooperativeContextRequest = true;
|
||||
|
||||
OsContextLinux osContext2(drmMock, 5u, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::Regular}));
|
||||
osContext2.ensureContextInitialized();
|
||||
|
||||
EXPECT_FALSE(drmMock.capturedCooperativeContextRequest);
|
||||
}
|
||||
|
||||
TEST(DrmTest, givenPrintIoctlDebugFlagSetWhenGettingTimestampFrequencyThenCaptureExpectedOutput) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.PrintIoctlEntries.set(true);
|
||||
|
Reference in New Issue
Block a user