fix: setup ipVersion in linux paths

Get ipVersion from productHelper function on xe and upstream.
On prelim first try to query ipVersion from kmd,
if it fails, get ipVersion from productHelper function.

Related-To: NEO-7786
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2023-05-22 15:15:17 +00:00
committed by Compute-Runtime-Automation
parent 103ad120ec
commit 4be9b7e609
9 changed files with 82 additions and 14 deletions

View File

@@ -11,6 +11,7 @@
#include "shared/source/os_interface/linux/ioctl_helper.h"
#include "shared/source/os_interface/linux/memory_info.h"
#include "shared/source/os_interface/linux/xe/ioctl_helper_xe.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/libult/linux/drm_mock.h"
@@ -1135,3 +1136,16 @@ TEST(IoctlHelperXeTest, whenUserFenceFailsThenErrorIsPropagated) {
EXPECT_EQ(errorValue, xeIoctlHelper->vmBind(vmBindParams));
EXPECT_EQ(errorValue, xeIoctlHelper->vmUnbind(vmBindParams));
}
TEST(IoctlHelperXeTest, WhenSetupIpVersionIsCalledThenIpVersionIsCorrect) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
DrmMockXe drm{*executionEnvironment->rootDeviceEnvironments[0]};
auto xeIoctlHelper = std::make_unique<MockIoctlHelperXe>(drm);
auto &hwInfo = *executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo();
auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<ProductHelper>();
auto config = productHelper.getProductConfigFromHwInfo(hwInfo);
xeIoctlHelper->setupIpVersion();
EXPECT_EQ(config, hwInfo.ipVersion.value);
}