From d32a7ee7d075c1ac172c1459b2929c3acebb864f Mon Sep 17 00:00:00 2001 From: Lukasz Jobczyk Date: Fri, 20 Jan 2023 06:22:35 +0000 Subject: [PATCH] Revert "Always init device with first submission" This reverts commit 08f17761b4ee49d98df0b71041ba956faff3b960. Signed-off-by: Lukasz Jobczyk --- opencl/test/unit_test/linux/main_linux_dll.cpp | 4 ---- shared/source/device/device.cpp | 3 +-- shared/source/device/device.h | 1 - shared/source/dll/device_dll.cpp | 4 ---- shared/test/common/base_ult_config_listener.cpp | 2 +- shared/test/common/helpers/ult_hw_config.h | 1 - shared/test/common/mocks/device_ult.cpp | 4 ---- shared/test/unit_test/device/neo_device_tests.cpp | 10 ++-------- 8 files changed, 4 insertions(+), 25 deletions(-) diff --git a/opencl/test/unit_test/linux/main_linux_dll.cpp b/opencl/test/unit_test/linux/main_linux_dll.cpp index 265b96f63d..d6bcd46b5d 100644 --- a/opencl/test/unit_test/linux/main_linux_dll.cpp +++ b/opencl/test/unit_test/linux/main_linux_dll.cpp @@ -884,10 +884,6 @@ TEST(DeviceTest, whenCheckBlitSplitEnabledThenReturnsTrue) { EXPECT_TRUE(Device::isBlitSplitEnabled()); } -TEST(DeviceTest, whenCheckIsInitDeviceWithFirstSubmissionEnabledThenReturnsTrue) { - EXPECT_TRUE(Device::isInitDeviceWithFirstSubmissionEnabled()); -} - TEST(PlatformsDestructor, whenGlobalPlatformsDestructorIsCalledThenGlobalPlatformsAreDestroyed) { EXPECT_NE(nullptr, platformsImpl); platformsDestructor(); diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index f28d356ecb..3b6ff1c035 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -388,7 +388,7 @@ bool Device::createEngine(uint32_t deviceCsrIndex, EngineTypeUsage engineTypeUsa if (!defaultEngineAlreadySet) { defaultEngineIndex = deviceCsrIndex; - if (Device::isInitDeviceWithFirstSubmissionEnabled()) { + if (osContext->isDebuggableContext()) { if (SubmissionStatus::SUCCESS != commandStreamReceiver->initializeDeviceWithFirstSubmission()) { return false; } @@ -405,7 +405,6 @@ bool Device::createEngine(uint32_t deviceCsrIndex, EngineTypeUsage engineTypeUsa if (engineUsage == EngineUsage::Regular) { addEngineToEngineGroup(engine); } - commandStreamReceivers.push_back(std::move(commandStreamReceiver)); return true; diff --git a/shared/source/device/device.h b/shared/source/device/device.h index 3593571d64..1a6c2e35ad 100644 --- a/shared/source/device/device.h +++ b/shared/source/device/device.h @@ -107,7 +107,6 @@ class Device : public ReferenceTrackedObject { RootDeviceEnvironment &getRootDeviceEnvironmentRef() const; bool isFullRangeSvm() const; static bool isBlitSplitEnabled(); - static bool isInitDeviceWithFirstSubmissionEnabled(); bool isBcsSplitSupported(); bool areSharedSystemAllocationsAllowed() const; template diff --git a/shared/source/dll/device_dll.cpp b/shared/source/dll/device_dll.cpp index ab2e883a56..8dd274da89 100644 --- a/shared/source/dll/device_dll.cpp +++ b/shared/source/dll/device_dll.cpp @@ -13,8 +13,4 @@ bool Device::isBlitSplitEnabled() { return true; } -bool Device::isInitDeviceWithFirstSubmissionEnabled() { - return true; -} - } // namespace NEO diff --git a/shared/test/common/base_ult_config_listener.cpp b/shared/test/common/base_ult_config_listener.cpp index 9bd2cba169..ac4ed7413e 100644 --- a/shared/test/common/base_ult_config_listener.cpp +++ b/shared/test/common/base_ult_config_listener.cpp @@ -36,7 +36,7 @@ void NEO::BaseUltConfigListener::OnTestEnd(const ::testing::TestInfo &) { // Ensure that global state is restored UltHwConfig expectedState{}; - static_assert(sizeof(UltHwConfig) == 14 * sizeof(bool), ""); // Ensure that there is no internal padding + static_assert(sizeof(UltHwConfig) == 13 * sizeof(bool), ""); // Ensure that there is no internal padding EXPECT_EQ(0, memcmp(&expectedState, &ultHwConfig, sizeof(UltHwConfig))); EXPECT_EQ(0, memcmp(&referencedHwInfo.platform, &defaultHwInfo->platform, sizeof(PLATFORM))); diff --git a/shared/test/common/helpers/ult_hw_config.h b/shared/test/common/helpers/ult_hw_config.h index 60790d3b58..2316cc9f82 100644 --- a/shared/test/common/helpers/ult_hw_config.h +++ b/shared/test/common/helpers/ult_hw_config.h @@ -14,7 +14,6 @@ struct UltHwConfig { bool forceOsAgnosticMemoryManager = true; bool useWaitForTimestamps = false; bool useBlitSplit = false; - bool useFirstSubmissionInitDevice = false; bool csrFailInitDirectSubmission = false; bool csrBaseCallDirectSubmissionAvailable = false; diff --git a/shared/test/common/mocks/device_ult.cpp b/shared/test/common/mocks/device_ult.cpp index 74ac0e6e16..bee5e6820c 100644 --- a/shared/test/common/mocks/device_ult.cpp +++ b/shared/test/common/mocks/device_ult.cpp @@ -14,8 +14,4 @@ bool Device::isBlitSplitEnabled() { return ultHwConfig.useBlitSplit; } -bool Device::isInitDeviceWithFirstSubmissionEnabled() { - return ultHwConfig.useFirstSubmissionInitDevice; -} - } // namespace NEO diff --git a/shared/test/unit_test/device/neo_device_tests.cpp b/shared/test/unit_test/device/neo_device_tests.cpp index dc75f399e8..b8411df2c5 100644 --- a/shared/test/unit_test/device/neo_device_tests.cpp +++ b/shared/test/unit_test/device/neo_device_tests.cpp @@ -673,9 +673,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZexNumberOfCssEnvVariableSetAmbig } HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenDebuggableOsContextWhenDeviceCreatesEnginesThenDeviceIsInitializedWithFirstSubmission) { - VariableBackup backup(&ultHwConfig); - ultHwConfig.useFirstSubmissionInitDevice = true; - auto hwInfo = *defaultHwInfo; hardwareInfoSetup[hwInfo.platform.eProductFamily](&hwInfo, true, 0); @@ -690,10 +687,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenDebuggableOsContextWhenDeviceCrea EXPECT_EQ(1u, csr->peekLatestSentTaskCount()); } -HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, whenDeviceCreatesEnginesThenDeviceIsInitializedWithFirstSubmission) { - VariableBackup backup(&ultHwConfig); - ultHwConfig.useFirstSubmissionInitDevice = true; - +HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenNonDebuggableOsContextWhenDeviceCreatesEnginesThenDeviceIsNotInitializedWithFirstSubmission) { auto hwInfo = *defaultHwInfo; hardwareInfoSetup[hwInfo.platform.eProductFamily](&hwInfo, true, 0); @@ -704,7 +698,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, whenDeviceCreatesEnginesThenDeviceIsIn auto device = deviceFactory.rootDevices[0]; auto csr = device->allEngines[device->defaultEngineIndex].commandStreamReceiver; - EXPECT_EQ(1u, csr->peekLatestSentTaskCount()); + EXPECT_EQ(0u, csr->peekLatestSentTaskCount()); } TEST(FailDeviceTest, GivenFailedDeviceWhenCreatingDeviceThenNullIsReturned) {