mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
refactor: Split waitpkg params for ulls light and default
Related-To: NEO-14866 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
df2c776aab
commit
5cd5bbafc5
@@ -1452,6 +1452,7 @@ inline bool CommandStreamReceiverHw<GfxFamily>::initDirectSubmission() {
|
||||
if (this->osContext->isDirectSubmissionLightActive()) {
|
||||
this->pushAllocationsForMakeResident = false;
|
||||
WaitUtils::init(WaitUtils::WaitpkgUse::tpause, *this->peekExecutionEnvironment().rootDeviceEnvironments[this->getRootDeviceIndex()]->getHardwareInfo());
|
||||
WaitUtils::adjustWaitpkgParamsForUllsLight();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,10 @@ void init(WaitpkgUse inputWaitpkgUse, const HardwareInfo &hwInfo) {
|
||||
waitCount = 0u;
|
||||
}
|
||||
|
||||
overrideWaitpkgParams();
|
||||
}
|
||||
|
||||
void overrideWaitpkgParams() {
|
||||
if (debugManager.flags.WaitpkgCounterValue.get() != -1) {
|
||||
waitpkgCounterValue = debugManager.flags.WaitpkgCounterValue.get();
|
||||
}
|
||||
@@ -69,6 +73,12 @@ void init(WaitpkgUse inputWaitpkgUse, const HardwareInfo &hwInfo) {
|
||||
}
|
||||
}
|
||||
|
||||
void adjustWaitpkgParamsForUllsLight() {
|
||||
waitPkgThresholdInMicroSeconds = defaultWaitPkgThresholdForUllsLightInMicroSeconds;
|
||||
waitpkgCounterValue = defaultCounterValueForUllsLight;
|
||||
overrideWaitpkgParams();
|
||||
}
|
||||
|
||||
} // namespace WaitUtils
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -32,6 +32,9 @@ constexpr uint64_t defaultCounterValue = 16000;
|
||||
constexpr uint32_t defaultControlValue = 0;
|
||||
constexpr uint32_t defaultWaitCount = 1u;
|
||||
|
||||
constexpr int64_t defaultWaitPkgThresholdForUllsLightInMicroSeconds = 1;
|
||||
constexpr uint64_t defaultCounterValueForUllsLight = 16000;
|
||||
|
||||
extern WaitpkgUse waitpkgUse;
|
||||
extern int64_t waitPkgThresholdInMicroSeconds;
|
||||
extern uint64_t waitpkgCounterValue;
|
||||
@@ -81,6 +84,9 @@ inline bool waitFunction(volatile TagAddressType *pollAddress, TaskCountType exp
|
||||
}
|
||||
|
||||
void init(WaitpkgUse inputWaitpkgUse, const HardwareInfo &hwInfo);
|
||||
void overrideWaitpkgParams();
|
||||
void adjustWaitpkgParamsForUllsLight();
|
||||
|
||||
} // namespace WaitUtils
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -33,6 +33,36 @@ HWTEST_TEMPLATED_F(DrmCommandStreamDirectSubmissionTest, givenDirectSubmissionLi
|
||||
csr->initDirectSubmission();
|
||||
|
||||
EXPECT_EQ(WaitUtils::waitpkgUse, WaitUtils::WaitpkgUse::tpause);
|
||||
EXPECT_EQ(WaitUtils::waitpkgCounterValue, WaitUtils::defaultCounterValueForUllsLight);
|
||||
EXPECT_EQ(WaitUtils::waitPkgThresholdInMicroSeconds, WaitUtils::defaultWaitPkgThresholdForUllsLightInMicroSeconds);
|
||||
|
||||
CpuInfo::cpuidFunc = savedCpuIdFunc;
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(DrmCommandStreamDirectSubmissionTest, givenWaitpkgParamsSetByDebugVariablesAndDirectSubmissionLightWhenInitThenUseTpauseWaitpkg) {
|
||||
using CpuIdFuncT = void (*)(int *, int);
|
||||
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.WaitpkgThreshold.set(35);
|
||||
debugManager.flags.WaitpkgCounterValue.set(1000);
|
||||
|
||||
auto mockCpuInfo = getMockCpuInfo(CpuInfo::getInstance());
|
||||
VariableBackup<MockCpuInfo> cpuInfoBackup(mockCpuInfo);
|
||||
mockCpuInfo->features = CpuInfo::featureNone;
|
||||
|
||||
CpuIdFuncT savedCpuIdFunc = CpuInfo::cpuidFunc;
|
||||
CpuInfo::cpuidFunc = mockCpuidEnableAll;
|
||||
|
||||
VariableBackup<bool> backupWaitpkgSupport(&WaitUtils::waitpkgSupport, true);
|
||||
|
||||
auto testedCsr = static_cast<TestedDrmCommandStreamReceiver<FamilyType> *>(csr);
|
||||
testedCsr->directSubmission.reset();
|
||||
|
||||
csr->initDirectSubmission();
|
||||
|
||||
EXPECT_EQ(WaitUtils::waitpkgUse, WaitUtils::WaitpkgUse::tpause);
|
||||
EXPECT_EQ(WaitUtils::waitpkgCounterValue, 1000u);
|
||||
EXPECT_EQ(WaitUtils::waitPkgThresholdInMicroSeconds, 35);
|
||||
|
||||
CpuInfo::cpuidFunc = savedCpuIdFunc;
|
||||
}
|
||||
Reference in New Issue
Block a user