Revert "Unify query ioctls"

This reverts commit 571199d048.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2022-05-31 20:11:40 +02:00
committed by Compute-Runtime-Automation
parent 65ca31d817
commit ce7de9d66e
11 changed files with 129 additions and 83 deletions

View File

@@ -274,7 +274,7 @@ bool DrmMockPrelimContext::handlePrelimQueryItem(void *arg) {
const auto numberOfCCS = gtSystemInfo.CCSInfo.IsValid && !disableCcsSupport ? gtSystemInfo.CCSInfo.NumberOfCCSEnabled : 0u;
switch (queryItem->queryId) {
case DRM_I915_QUERY_ENGINE_INFO: {
case PRELIM_DRM_I915_QUERY_ENGINE_INFO: {
auto numberOfTiles = gtSystemInfo.MultiTileArchInfo.IsValid ? gtSystemInfo.MultiTileArchInfo.TileCount : 1u;
uint32_t numberOfEngines = numberOfTiles * (4u + numberOfCCS + static_cast<uint32_t>(supportedCopyEnginesMask.count()));
int engineInfoSize = sizeof(prelim_drm_i915_query_engine_info) + numberOfEngines * sizeof(prelim_drm_i915_engine_info);
@@ -306,7 +306,7 @@ bool DrmMockPrelimContext::handlePrelimQueryItem(void *arg) {
break;
}
case DRM_I915_QUERY_MEMORY_REGIONS: {
case PRELIM_DRM_I915_QUERY_MEMORY_REGIONS: {
if (queryMemoryRegionInfoSuccessCount == 0) {
queryItem->length = -EINVAL;
return true;

View File

@@ -187,11 +187,11 @@ TEST_F(IoctlPrelimHelperTests, givenPrelimsWhenGetDirectSubmissionFlagThenCorrec
}
TEST_F(IoctlPrelimHelperTests, givenPrelimsWhenGetMemRegionsIoctlValThenCorrectValueReturned) {
EXPECT_EQ(static_cast<unsigned int>(DRM_I915_QUERY_MEMORY_REGIONS), getIoctlRequestValue(DrmIoctl::QueryMemoryRegions, &ioctlHelper));
EXPECT_EQ(PRELIM_DRM_I915_QUERY_MEMORY_REGIONS, ioctlHelper.getMemRegionsIoctlVal());
}
TEST_F(IoctlPrelimHelperTests, givenPrelimsWhenGetEngineInfoIoctlValThenCorrectValueReturned) {
EXPECT_EQ(static_cast<unsigned int>(DRM_I915_QUERY_ENGINE_INFO), getIoctlRequestValue(DrmIoctl::QueryEngineInfo, &ioctlHelper));
EXPECT_EQ(PRELIM_DRM_I915_QUERY_ENGINE_INFO, ioctlHelper.getEngineInfoIoctlVal());
}
TEST_F(IoctlPrelimHelperTests, givenPrelimsWhenTranslateToEngineCapsThenReturnSameData) {

View File

@@ -222,7 +222,7 @@ TEST(IoctlHelperTestsUpstream, givenUpstreamWhenGetMemRegionsIoctlValThenCorrect
executionEnvironment->prepareRootDeviceEnvironments(1);
auto drm = std::make_unique<DrmTipMock>(*executionEnvironment->rootDeviceEnvironments[0]);
EXPECT_EQ(static_cast<unsigned int>(DRM_I915_QUERY_MEMORY_REGIONS), getIoctlRequestValue(DrmIoctl::QueryMemoryRegions, drm->getIoctlHelper()));
EXPECT_EQ(DRM_I915_QUERY_MEMORY_REGIONS, drm->getIoctlHelper()->getMemRegionsIoctlVal());
}
TEST(IoctlHelperTestsUpstream, givenUpstreamWhenGetEngineInfoIoctlValThenCorrectValueReturned) {
@@ -230,7 +230,7 @@ TEST(IoctlHelperTestsUpstream, givenUpstreamWhenGetEngineInfoIoctlValThenCorrect
executionEnvironment->prepareRootDeviceEnvironments(1);
auto drm = std::make_unique<DrmTipMock>(*executionEnvironment->rootDeviceEnvironments[0]);
EXPECT_EQ(static_cast<unsigned int>(DRM_I915_QUERY_ENGINE_INFO), getIoctlRequestValue(DrmIoctl::QueryEngineInfo, drm->getIoctlHelper()));
EXPECT_EQ(DRM_I915_QUERY_ENGINE_INFO, drm->getIoctlHelper()->getEngineInfoIoctlVal());
}
TEST(IoctlHelperTestsUpstream, givenUpstreamWhenQueryDistancesThenReturnEinval) {

View File

@@ -65,7 +65,7 @@ int handlePrelimRequests(DrmIoctl request, void *arg, int ioctlRetVal, int query
}
auto distance = reinterpret_cast<prelim_drm_i915_query_distance_info *>(queryItemPtr->dataPtr);
distance->distance = (distance->engine.engine_instance == distance->region.memory_instance) ? 0 : 100;
} else if (queryItemPtr->queryId == DRM_I915_QUERY_ENGINE_INFO) {
} else if (queryItemPtr->queryId == PRELIM_DRM_I915_QUERY_ENGINE_INFO) {
auto numberOfTiles = 2u;
uint32_t numberOfEngines = numberOfTiles * 6u;
int engineInfoSize = sizeof(prelim_drm_i915_query_engine_info) + numberOfEngines * sizeof(prelim_drm_i915_engine_info);