mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-18 22:08:53 +08:00
fix: Init wait utils after hwInfo init for both OS
Resolves: HSD-18041922513 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ead0842763
commit
b43b23b6ed
@@ -68,6 +68,10 @@ void RootDeviceEnvironment::initDebuggerL0(Device *neoDevice) {
|
||||
this->debugger = DebuggerL0::create(neoDevice);
|
||||
}
|
||||
|
||||
void RootDeviceEnvironment::initWaitUtils() {
|
||||
WaitUtils::init(WaitUtils::WaitpkgUse::tpause, *hwInfo);
|
||||
}
|
||||
|
||||
const HardwareInfo *RootDeviceEnvironment::getHardwareInfo() const {
|
||||
return hwInfo.get();
|
||||
}
|
||||
@@ -86,8 +90,6 @@ void RootDeviceEnvironment::setHwInfo(const HardwareInfo *hwInfo) {
|
||||
if (debugManager.flags.DisableSupportForL0Debugger.get() == 1) {
|
||||
this->hwInfo->capabilityTable.l0DebuggerSupported = false;
|
||||
}
|
||||
|
||||
WaitUtils::init(WaitUtils::WaitpkgUse::tpause, *hwInfo);
|
||||
}
|
||||
|
||||
bool RootDeviceEnvironment::isFullRangeSvm() const {
|
||||
@@ -178,6 +180,7 @@ void RootDeviceEnvironment::initHelpers() {
|
||||
initCompilerProductHelper();
|
||||
initReleaseHelper();
|
||||
initAilConfigurationHelper();
|
||||
initWaitUtils();
|
||||
}
|
||||
|
||||
void RootDeviceEnvironment::initializeGfxCoreHelperFromHwInfo() {
|
||||
|
||||
@@ -67,6 +67,7 @@ struct RootDeviceEnvironment : NonCopyableClass {
|
||||
void initOsTime();
|
||||
void initGmm();
|
||||
void initDebuggerL0(Device *neoDevice);
|
||||
void initWaitUtils();
|
||||
MOCKABLE_VIRTUAL void initDummyAllocation();
|
||||
void setDummyBlitProperties(uint32_t rootDeviceIndex);
|
||||
|
||||
|
||||
@@ -472,6 +472,7 @@ int Drm::setupHardwareInfo(const DeviceDescriptor *device, bool setupFeatureTabl
|
||||
rootDeviceEnvironment.initApiGfxCoreHelper();
|
||||
rootDeviceEnvironment.initCompilerProductHelper();
|
||||
rootDeviceEnvironment.initAilConfigurationHelper();
|
||||
rootDeviceEnvironment.initWaitUtils();
|
||||
auto result = rootDeviceEnvironment.initAilConfiguration();
|
||||
if (false == result) {
|
||||
PRINT_DEBUG_STRING(debugManager.flags.PrintDebugMessages.get(), stderr, "%s", "FATAL: AIL creation failed!\n");
|
||||
|
||||
@@ -130,6 +130,7 @@ bool Wddm::init() {
|
||||
if (productHelper.configureHwInfoWddm(hardwareInfo, hardwareInfo, rootDeviceEnvironment)) {
|
||||
return false;
|
||||
}
|
||||
rootDeviceEnvironment.initWaitUtils();
|
||||
setPlatformSupportEvictIfNecessaryFlag(productHelper);
|
||||
|
||||
auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*hardwareInfo);
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/os_interface/device_factory.h"
|
||||
#include "shared/source/utilities/wait_util.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
@@ -201,7 +203,7 @@ TEST_F(WaitPkgTest, givenEnabledWaitPkgSetToTpauseAndWaitpkgSupportTrueWhenWaitI
|
||||
EXPECT_EQ(defaultHwInfo->capabilityTable.isIntegratedDevice ? 12 : 28, WaitUtils::waitPkgThresholdInMicroSeconds);
|
||||
}
|
||||
|
||||
TEST_F(WaitPkgTest, givenWaitpkgSupportTrueWhenSetHwInfoThenWaitPkgEnabled) {
|
||||
TEST_F(WaitPkgTest, givenWaitpkgSupportTrueWhenCreateExecutionEnvironmentThenWaitPkgEnabled) {
|
||||
CpuInfo::cpuidFunc = mockCpuidEnableAll;
|
||||
|
||||
WaitUtils::waitpkgSupport = true;
|
||||
@@ -215,6 +217,38 @@ TEST_F(WaitPkgTest, givenWaitpkgSupportTrueWhenSetHwInfoThenWaitPkgEnabled) {
|
||||
EXPECT_EQ(defaultHwInfo->capabilityTable.isIntegratedDevice ? 12 : 28, WaitUtils::waitPkgThresholdInMicroSeconds);
|
||||
}
|
||||
|
||||
TEST_F(WaitPkgTest, givenWaitpkgSupportTrueWhenCreateDevicesThenWaitPkgEnabled) {
|
||||
CpuInfo::cpuidFunc = mockCpuidEnableAll;
|
||||
|
||||
WaitUtils::waitpkgSupport = true;
|
||||
|
||||
auto executionEnvironment = new NEO::ExecutionEnvironment;
|
||||
executionEnvironment->incRefInternal();
|
||||
NEO::DeviceFactory::createDevices(*executionEnvironment);
|
||||
executionEnvironment->decRefInternal();
|
||||
|
||||
EXPECT_EQ(1u, WaitUtils::waitCount);
|
||||
EXPECT_EQ(16000u, WaitUtils::waitpkgCounterValue);
|
||||
EXPECT_EQ(0u, WaitUtils::waitpkgControlValue);
|
||||
EXPECT_EQ(WaitUtils::waitpkgUse, WaitUtils::WaitpkgUse::tpause);
|
||||
EXPECT_EQ(defaultHwInfo->capabilityTable.isIntegratedDevice ? 12 : 28, WaitUtils::waitPkgThresholdInMicroSeconds);
|
||||
}
|
||||
|
||||
TEST_F(WaitPkgTest, givenWaitpkgSupportTrueWhenPrepareDeviceEnvironmentsThenWaitPkgEnabled) {
|
||||
CpuInfo::cpuidFunc = mockCpuidEnableAll;
|
||||
|
||||
WaitUtils::waitpkgSupport = true;
|
||||
|
||||
ExecutionEnvironment executionEnvironment;
|
||||
EXPECT_TRUE(NEO::DeviceFactory::prepareDeviceEnvironments(executionEnvironment));
|
||||
|
||||
EXPECT_EQ(1u, WaitUtils::waitCount);
|
||||
EXPECT_EQ(16000u, WaitUtils::waitpkgCounterValue);
|
||||
EXPECT_EQ(0u, WaitUtils::waitpkgControlValue);
|
||||
EXPECT_EQ(WaitUtils::waitpkgUse, WaitUtils::WaitpkgUse::tpause);
|
||||
EXPECT_EQ(defaultHwInfo->capabilityTable.isIntegratedDevice ? 12 : 28, WaitUtils::waitPkgThresholdInMicroSeconds);
|
||||
}
|
||||
|
||||
TEST_F(WaitPkgTest, givenEnabledWaitPkgSetToTpauseAndWaitpkgThresholdAndWaitpkgSupportTrueWhenWaitInitializedAndCpuSupportsOperandThenWaitPkgEnabled) {
|
||||
CpuInfo::cpuidFunc = mockCpuidEnableAll;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user