mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
refactor: remove not needed check for exec softpin
Related-To: NEO-10496 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9aa81bae75
commit
d94be09020
@@ -63,20 +63,6 @@ Drm *Drm::create(std::unique_ptr<HwDeviceIdDrm> &&hwDeviceId, RootDeviceEnvironm
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Detect device parameters
|
||||
int hasExecSoftPin = 0;
|
||||
ret = drm->getExecSoftPin(hasExecSoftPin);
|
||||
if (ret != 0) {
|
||||
printDebugString(debugManager.flags.PrintDebugMessages.get(), stderr, "%s", "FATAL: Cannot query Soft Pin parameter!\n");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!hasExecSoftPin) {
|
||||
printDebugString(debugManager.flags.PrintDebugMessages.get(), stderr, "%s",
|
||||
"FATAL: Device doesn't support Soft-Pin but this is required.\n");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Activate the Turbo Boost Frequency feature
|
||||
ret = drm->enableTurboBoost();
|
||||
if (ret != 0) {
|
||||
|
||||
@@ -166,10 +166,6 @@ int Drm::getParamIoctl(DrmParam param, int *dstValue) {
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int Drm::getExecSoftPin(int &execSoftPin) {
|
||||
return getParamIoctl(DrmParam::paramHasExecSoftpin, &execSoftPin);
|
||||
}
|
||||
|
||||
bool Drm::queryI915DeviceIdAndRevision() {
|
||||
HardwareInfo *hwInfo = rootDeviceEnvironment.getMutableHardwareInfo();
|
||||
int deviceId = hwInfo->platform.usDeviceID;
|
||||
|
||||
@@ -82,7 +82,6 @@ class Drm : public DriverModel {
|
||||
return 0;
|
||||
}
|
||||
PhysicalDevicePciSpeedInfo getPciSpeedInfo() const override;
|
||||
int getExecSoftPin(int &execSoftPin);
|
||||
int enableTurboBoost();
|
||||
int getEuTotal(int &euTotal);
|
||||
int getSubsliceTotal(int &subsliceTotal);
|
||||
|
||||
@@ -300,7 +300,6 @@ enum class DrmParam {
|
||||
mmapOffsetWc,
|
||||
paramChipsetId,
|
||||
paramRevision,
|
||||
paramHasExecSoftpin,
|
||||
paramHasPooledEu,
|
||||
paramHasScheduler,
|
||||
paramEuTotal,
|
||||
|
||||
@@ -136,8 +136,6 @@ int IoctlHelperI915::getDrmParamValueBase(DrmParam drmParam) const {
|
||||
return I915_PARAM_CHIPSET_ID;
|
||||
case DrmParam::paramRevision:
|
||||
return I915_PARAM_REVISION;
|
||||
case DrmParam::paramHasExecSoftpin:
|
||||
return I915_PARAM_HAS_EXEC_SOFTPIN;
|
||||
case DrmParam::paramHasPooledEu:
|
||||
return I915_PARAM_HAS_POOLED_EU;
|
||||
case DrmParam::paramHasScheduler:
|
||||
@@ -339,8 +337,6 @@ std::string IoctlHelperI915::getDrmParamString(DrmParam drmParam) const {
|
||||
return "I915_PARAM_CHIPSET_ID";
|
||||
case DrmParam::paramRevision:
|
||||
return "I915_PARAM_REVISION";
|
||||
case DrmParam::paramHasExecSoftpin:
|
||||
return "I915_PARAM_HAS_EXEC_SOFTPIN";
|
||||
case DrmParam::paramHasPooledEu:
|
||||
return "I915_PARAM_HAS_POOLED_EU";
|
||||
case DrmParam::paramHasScheduler:
|
||||
|
||||
@@ -929,9 +929,6 @@ int IoctlHelperXe::ioctl(DrmIoctl request, void *arg) {
|
||||
case static_cast<int>(DrmParam::paramHasPageFault):
|
||||
*d->value = 0;
|
||||
break;
|
||||
case static_cast<int>(DrmParam::paramHasExecSoftpin):
|
||||
*d->value = 1;
|
||||
break;
|
||||
case static_cast<int>(DrmParam::paramHasScheduler):
|
||||
*d->value = static_cast<int>(0x80000037);
|
||||
break;
|
||||
@@ -1351,8 +1348,6 @@ std::string IoctlHelperXe::getDrmParamString(DrmParam drmParam) const {
|
||||
return "ParamChipsetId";
|
||||
case DrmParam::paramRevision:
|
||||
return "ParamRevision";
|
||||
case DrmParam::paramHasExecSoftpin:
|
||||
return "ParamHasExecSoftpin";
|
||||
case DrmParam::paramHasPooledEu:
|
||||
return "ParamHasPooledEu";
|
||||
case DrmParam::paramHasScheduler:
|
||||
|
||||
@@ -94,10 +94,6 @@ int DrmMock::ioctl(DrmIoctl request, void *arg) {
|
||||
*gp->value = this->storedPreemptionSupport;
|
||||
return this->storedRetVal;
|
||||
}
|
||||
if (gp->param == I915_PARAM_HAS_EXEC_SOFTPIN) {
|
||||
*gp->value = this->storedExecSoftPin;
|
||||
return this->storedRetVal;
|
||||
}
|
||||
if (gp->param == I915_PARAM_CS_TIMESTAMP_FREQUENCY) {
|
||||
*gp->value = this->storedCsTimestampFrequency;
|
||||
return this->storedRetVal;
|
||||
|
||||
@@ -205,7 +205,6 @@ class DrmMock : public Drm {
|
||||
int storedRetValForPersistant = 0;
|
||||
int storedRetValForVmCreate = 0;
|
||||
int storedPreemptionSupport = 0;
|
||||
int storedExecSoftPin = 0;
|
||||
int storedRetValForVmId = 1;
|
||||
int storedCsTimestampFrequency = 1000;
|
||||
int storedOaTimestampFrequency = 123456;
|
||||
|
||||
@@ -481,23 +481,6 @@ TEST(DrmTest, givenDrmPreemptionEnabledAndLowPriorityEngineWhenCreatingOsContext
|
||||
EXPECT_EQ(0u, drmMock.receivedContextParamRequest.size);
|
||||
}
|
||||
|
||||
TEST(DrmTest, WhenGettingExecSoftPinThenCorrectValueIsReturned) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
DrmMock *pDrm = new DrmMock(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
int execSoftPin = 0;
|
||||
|
||||
int ret = pDrm->getExecSoftPin(execSoftPin);
|
||||
EXPECT_EQ(0, ret);
|
||||
EXPECT_EQ(0, execSoftPin);
|
||||
|
||||
pDrm->storedExecSoftPin = 1;
|
||||
ret = pDrm->getExecSoftPin(execSoftPin);
|
||||
EXPECT_EQ(0, ret);
|
||||
EXPECT_EQ(1, execSoftPin);
|
||||
|
||||
delete pDrm;
|
||||
}
|
||||
|
||||
TEST(DrmTest, WhenEnablingTurboBoostThenSucceeds) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
DrmMock *pDrm = new DrmMock(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
@@ -1594,7 +1577,6 @@ TEST(DrmWrapperTest, WhenGettingDrmParamValueStringThenProperStringIsReturned) {
|
||||
|
||||
MockIoctlHelper ioctlHelper{drm};
|
||||
std::map<DrmParam, const char *> ioctlCodeStringMap = {
|
||||
{DrmParam::paramHasExecSoftpin, "I915_PARAM_HAS_EXEC_SOFTPIN"},
|
||||
{DrmParam::paramHasPooledEu, "I915_PARAM_HAS_POOLED_EU"},
|
||||
{DrmParam::paramHasScheduler, "I915_PARAM_HAS_SCHEDULER"},
|
||||
{DrmParam::paramEuTotal, "I915_PARAM_EU_TOTAL"},
|
||||
|
||||
@@ -163,7 +163,6 @@ DG1TEST_F(IoctlHelperTestsDg1, whenGettingDrmParamStringThenProperStringIsReturn
|
||||
auto &ioctlHelper = *drm->getIoctlHelper();
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramChipsetId).c_str(), "I915_PARAM_CHIPSET_ID");
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramRevision).c_str(), "I915_PARAM_REVISION");
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramHasExecSoftpin).c_str(), "I915_PARAM_HAS_EXEC_SOFTPIN");
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramHasPooledEu).c_str(), "I915_PARAM_HAS_POOLED_EU");
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramHasScheduler).c_str(), "I915_PARAM_HAS_SCHEDULER");
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramEuTotal).c_str(), "I915_PARAM_EU_TOTAL");
|
||||
|
||||
@@ -96,7 +96,6 @@ TEST_F(IoctlPrelimHelperTests, whenGettingIoctlRequestValueThenPropertValueIsRet
|
||||
TEST_F(IoctlPrelimHelperTests, whenGettingDrmParamStringThenProperStringIsReturned) {
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramChipsetId).c_str(), "I915_PARAM_CHIPSET_ID");
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramRevision).c_str(), "I915_PARAM_REVISION");
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramHasExecSoftpin).c_str(), "I915_PARAM_HAS_EXEC_SOFTPIN");
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramHasPooledEu).c_str(), "I915_PARAM_HAS_POOLED_EU");
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramHasScheduler).c_str(), "I915_PARAM_HAS_SCHEDULER");
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramEuTotal).c_str(), "I915_PARAM_EU_TOTAL");
|
||||
@@ -177,7 +176,6 @@ TEST_F(IoctlPrelimHelperTests, whenGettingDrmParamValueThenPropertValueIsReturne
|
||||
EXPECT_EQ(ioctlHelper.getDrmParamValue(DrmParam::mmapOffsetWc), static_cast<int>(I915_MMAP_OFFSET_WC));
|
||||
EXPECT_EQ(ioctlHelper.getDrmParamValue(DrmParam::paramChipsetId), static_cast<int>(I915_PARAM_CHIPSET_ID));
|
||||
EXPECT_EQ(ioctlHelper.getDrmParamValue(DrmParam::paramRevision), static_cast<int>(I915_PARAM_REVISION));
|
||||
EXPECT_EQ(ioctlHelper.getDrmParamValue(DrmParam::paramHasExecSoftpin), static_cast<int>(I915_PARAM_HAS_EXEC_SOFTPIN));
|
||||
EXPECT_EQ(ioctlHelper.getDrmParamValue(DrmParam::paramHasPooledEu), static_cast<int>(I915_PARAM_HAS_POOLED_EU));
|
||||
EXPECT_EQ(ioctlHelper.getDrmParamValue(DrmParam::paramHasScheduler), static_cast<int>(I915_PARAM_HAS_SCHEDULER));
|
||||
EXPECT_EQ(ioctlHelper.getDrmParamValue(DrmParam::paramEuTotal), static_cast<int>(I915_PARAM_EU_TOTAL));
|
||||
|
||||
@@ -228,7 +228,6 @@ TEST(IoctlHelperUpstreamTest, whenGettingDrmParamStringThenProperStringIsReturne
|
||||
IoctlHelperUpstream ioctlHelper{*drm};
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramChipsetId).c_str(), "I915_PARAM_CHIPSET_ID");
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramRevision).c_str(), "I915_PARAM_REVISION");
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramHasExecSoftpin).c_str(), "I915_PARAM_HAS_EXEC_SOFTPIN");
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramHasPooledEu).c_str(), "I915_PARAM_HAS_POOLED_EU");
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramHasScheduler).c_str(), "I915_PARAM_HAS_SCHEDULER");
|
||||
EXPECT_STREQ(ioctlHelper.getDrmParamString(DrmParam::paramEuTotal).c_str(), "I915_PARAM_EU_TOTAL");
|
||||
@@ -268,7 +267,6 @@ TEST(IoctlHelperUpstreamTest, whenGettingDrmParamValueThenPropertValueIsReturned
|
||||
EXPECT_EQ(ioctlHelper.getDrmParamValue(DrmParam::mmapOffsetWc), static_cast<int>(I915_MMAP_OFFSET_WC));
|
||||
EXPECT_EQ(ioctlHelper.getDrmParamValue(DrmParam::paramChipsetId), static_cast<int>(I915_PARAM_CHIPSET_ID));
|
||||
EXPECT_EQ(ioctlHelper.getDrmParamValue(DrmParam::paramRevision), static_cast<int>(I915_PARAM_REVISION));
|
||||
EXPECT_EQ(ioctlHelper.getDrmParamValue(DrmParam::paramHasExecSoftpin), static_cast<int>(I915_PARAM_HAS_EXEC_SOFTPIN));
|
||||
EXPECT_EQ(ioctlHelper.getDrmParamValue(DrmParam::paramHasPooledEu), static_cast<int>(I915_PARAM_HAS_POOLED_EU));
|
||||
EXPECT_EQ(ioctlHelper.getDrmParamValue(DrmParam::paramHasScheduler), static_cast<int>(I915_PARAM_HAS_SCHEDULER));
|
||||
EXPECT_EQ(ioctlHelper.getDrmParamValue(DrmParam::paramEuTotal), static_cast<int>(I915_PARAM_EU_TOTAL));
|
||||
|
||||
@@ -362,7 +362,6 @@ TEST(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingAnyMethodThenDummyValueIsRe
|
||||
verifyDrmParamString("MmapOffsetWc", DrmParam::mmapOffsetWc);
|
||||
verifyDrmParamString("ParamChipsetId", DrmParam::paramChipsetId);
|
||||
verifyDrmParamString("ParamRevision", DrmParam::paramRevision);
|
||||
verifyDrmParamString("ParamHasExecSoftpin", DrmParam::paramHasExecSoftpin);
|
||||
verifyDrmParamString("ParamHasPooledEu", DrmParam::paramHasPooledEu);
|
||||
verifyDrmParamString("ParamHasScheduler", DrmParam::paramHasScheduler);
|
||||
verifyDrmParamString("ParamEuTotal", DrmParam::paramEuTotal);
|
||||
@@ -667,10 +666,6 @@ TEST(IoctlHelperXeTest, whenCallingIoctlThenProperValueIsReturned) {
|
||||
ret = mockXeIoctlHelper->ioctl(DrmIoctl::getparam, &test);
|
||||
EXPECT_EQ(0, ret);
|
||||
EXPECT_EQ(dstvalue, 0);
|
||||
test.param = static_cast<int>(DrmParam::paramHasExecSoftpin);
|
||||
ret = mockXeIoctlHelper->ioctl(DrmIoctl::getparam, &test);
|
||||
EXPECT_EQ(0, ret);
|
||||
EXPECT_EQ(dstvalue, 1);
|
||||
test.param = static_cast<int>(DrmParam::paramHasScheduler);
|
||||
ret = mockXeIoctlHelper->ioctl(DrmIoctl::getparam, &test);
|
||||
EXPECT_EQ(0, ret);
|
||||
|
||||
Reference in New Issue
Block a user