Disable low priority BCS direct submission

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk 2021-05-19 09:44:30 +00:00 committed by Compute-Runtime-Automation
parent 1dd552d473
commit 529020c72c
4 changed files with 1 additions and 57 deletions

View File

@ -265,53 +265,6 @@ TEST(DrmTest, givenDrmPreemptionEnabledAndLowPriorityEngineWhenCreatingOsContext
EXPECT_EQ(0u, drmMock.receivedContextParamRequest.size);
}
TEST(DrmTest, givenDirectSubmissionEnabledOnBlitterWhenCreateBcsEngineThenLowPriorityIsSet) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
DrmMock drmMock(*executionEnvironment->rootDeviceEnvironments[0]);
OsContextLinux osContext(drmMock, 0u, 1, EngineTypeUsage{aub_stream::ENGINE_BCS, EngineUsage::Regular}, PreemptionMode::Disabled, false);
osContext.ensureContextInitialized();
EXPECT_EQ(1u, drmMock.receivedContextParamRequestCount);
DebugManagerStateRestore restorer;
DebugManager.flags.EnableDirectSubmission.set(1);
DebugManager.flags.DirectSubmissionOverrideBlitterSupport.set(1);
OsContextLinux osContext2(drmMock, 0u, 1, EngineTypeUsage{aub_stream::ENGINE_BCS, EngineUsage::Regular}, PreemptionMode::Disabled, false);
osContext2.ensureContextInitialized();
EXPECT_EQ(3u, drmMock.receivedContextParamRequestCount);
EXPECT_EQ(drmMock.receivedCreateContextId, drmMock.receivedContextParamRequest.ctx_id);
EXPECT_EQ(static_cast<uint64_t>(I915_CONTEXT_PARAM_PRIORITY), drmMock.receivedContextParamRequest.param);
EXPECT_EQ(static_cast<uint64_t>(-1023), drmMock.receivedContextParamRequest.value);
EXPECT_EQ(0u, drmMock.receivedContextParamRequest.size);
OsContextLinux osContext3(drmMock, 0u, 1, EngineTypeUsage{aub_stream::ENGINE_RCS, EngineUsage::Regular}, PreemptionMode::Disabled, false);
osContext3.ensureContextInitialized();
EXPECT_EQ(4u, drmMock.receivedContextParamRequestCount);
}
TEST(DrmTest, givenDirectSubmissionEnabledOnBlitterAndDirectSubmissionLowPriorityBlitterSetZeroWhenCreateBcsEngineThenLowPriorityIsNotSet) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
DrmMock drmMock(*executionEnvironment->rootDeviceEnvironments[0]);
OsContextLinux osContext(drmMock, 0u, 1, EngineTypeUsage{aub_stream::ENGINE_BCS, EngineUsage::Regular}, PreemptionMode::Disabled, false);
osContext.ensureContextInitialized();
EXPECT_EQ(1u, drmMock.receivedContextParamRequestCount);
DebugManagerStateRestore restorer;
DebugManager.flags.EnableDirectSubmission.set(1);
DebugManager.flags.DirectSubmissionOverrideBlitterSupport.set(1);
DebugManager.flags.DirectSubmissionLowPriorityBlitter.set(0);
OsContextLinux osContext2(drmMock, 0u, 1, EngineTypeUsage{aub_stream::ENGINE_BCS, EngineUsage::Regular}, PreemptionMode::Disabled, false);
osContext2.ensureContextInitialized();
EXPECT_EQ(2u, drmMock.receivedContextParamRequestCount);
}
TEST(DrmTest, WhenGettingExecSoftPinThenCorrectValueIsReturned) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);

View File

@ -200,7 +200,6 @@ LogWaitingForCompletion = 0
ForceUserptrAlignment = -1
UseExternalAllocatorForSshAndDsh = 0
DirectSubmissionDrmContext = -1
DirectSubmissionLowPriorityBlitter = -1
DirectSubmissionOverrideBlitterSupport = -1
DirectSubmissionOverrideRenderSupport = -1
DirectSubmissionOverrideComputeSupport = -1

View File

@ -165,7 +165,6 @@ DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionDisableCpuCacheFlush, -1, "-1: d
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionEnableDebugBuffer, 0, "0: diagnostic feature disabled - dispatch regular workload, 1: dispatch diagnostic buffer - mode 1 - single SDI command, 2: dispatch diagnostic buffer - mode 2 - no command")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionDiagnosticExecutionCount, 30, "Number of executions of EnableDebugBuffer modes within diagnostic run")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionDrmContext, -1, "Create special drm context: -1: default, when new residency model available, 0: disable, 1: enable")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionLowPriorityBlitter, -1, "Create low priority context for blitter: -1: default, when direct submission enabled on BCS, 0: disable, create normal drm context 1: enable, create low priority context for BCS")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionOverrideBlitterSupport, -1, "Overrides default blitter support: -1: do not override, 0: disable engine support, 1: enable engine support with init start, 2: enable engine support without init start")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionOverrideRenderSupport, -1, "Overrides default render support: -1: do not override, 0: disable engine support, 1: enable engine support with init start, 2: enable engine support without init start")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionOverrideComputeSupport, -1, "Overrides default compute support: -1: do not override, 0: disable engine support, 1: enable engine support with init start, 2: enable engine support without init start")

View File

@ -59,14 +59,7 @@ void OsContextLinux::initializeContext() {
drm.setContextDebugFlag(drmContextId);
}
auto lowPriorityDirectSubmissionBcs = this->isDirectSubmissionActive() && EngineHelpers::isBcs(engineType);
if (DebugManager.flags.DirectSubmissionLowPriorityBlitter.get() != -1) {
lowPriorityDirectSubmissionBcs = DebugManager.flags.DirectSubmissionLowPriorityBlitter.get();
}
if ((drm.isPreemptionSupported() && isLowPriority()) ||
lowPriorityDirectSubmissionBcs) {
if (drm.isPreemptionSupported() && isLowPriority()) {
drm.setLowPriorityContextParam(drmContextId);
}