refactor: rename IoctlHelper::get to IoctlHelper::getI915Helper

remove drm version parameter as i915 is always expected

Related-To: NEO-7578
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-01-09 11:24:53 +00:00
committed by Compute-Runtime-Automation
parent 77b88f19a1
commit 1fd8b26499
5 changed files with 8 additions and 9 deletions

View File

@ -1082,8 +1082,7 @@ void Drm::setupIoctlHelper(const PRODUCT_FAMILY productFamily) {
if (!this->ioctlHelper) {
std::string prelimVersion = "";
getPrelimVersion(prelimVersion);
auto drmVersion = Drm::getDrmVersion(getFileDescriptor());
this->ioctlHelper = IoctlHelper::get(productFamily, prelimVersion, drmVersion, *this);
this->ioctlHelper = IoctlHelper::getI915Helper(productFamily, prelimVersion, *this);
this->ioctlHelper->initialize();
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2022 Intel Corporation
* Copyright (C) 2021-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -67,7 +67,7 @@ class IoctlHelper {
public:
IoctlHelper(Drm &drmArg) : drm(drmArg){};
virtual ~IoctlHelper() {}
static std::unique_ptr<IoctlHelper> get(const PRODUCT_FAMILY productFamily, const std::string &prelimVersion, const std::string &drmVersion, Drm &drm);
static std::unique_ptr<IoctlHelper> getI915Helper(const PRODUCT_FAMILY productFamily, const std::string &prelimVersion, Drm &drm);
virtual uint32_t ioctl(DrmIoctl request, void *arg);
virtual bool initialize() = 0;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2022 Intel Corporation
* Copyright (C) 2021-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -17,7 +17,7 @@ namespace NEO {
std::optional<std::function<std::unique_ptr<IoctlHelper>(Drm &drm)>> ioctlHelperFactory[IGFX_MAX_PRODUCT] = {};
std::unique_ptr<IoctlHelper> IoctlHelper::get(const PRODUCT_FAMILY productFamily, const std::string &prelimVersion, const std::string &drmVersion, Drm &drm) {
std::unique_ptr<IoctlHelper> IoctlHelper::getI915Helper(const PRODUCT_FAMILY productFamily, const std::string &prelimVersion, Drm &drm) {
auto productSpecificIoctlHelperCreator = ioctlHelperFactory[productFamily];
if (productSpecificIoctlHelperCreator) {
return productSpecificIoctlHelperCreator.value()(drm);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Intel Corporation
* Copyright (C) 2022-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -14,7 +14,7 @@
namespace NEO {
std::optional<std::function<std::unique_ptr<IoctlHelper>(Drm &drm)>> ioctlHelperFactory[IGFX_MAX_PRODUCT] = {};
std::unique_ptr<IoctlHelper> IoctlHelper::get(const PRODUCT_FAMILY productFamily, const std::string &prelimVersion, const std::string &drmVersion, Drm &drm) {
std::unique_ptr<IoctlHelper> IoctlHelper::getI915Helper(const PRODUCT_FAMILY productFamily, const std::string &prelimVersion, Drm &drm) {
auto productSpecificIoctlHelperCreator = ioctlHelperFactory[productFamily];
if (productSpecificIoctlHelperCreator) {
return productSpecificIoctlHelperCreator.value()(drm);

View File

@ -1191,7 +1191,7 @@ TEST(DrmTest, givenInvalidUapiPrelimVersionThenFallbackToBasePrelim) {
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
const auto productFamily = defaultHwInfo->platform.eProductFamily;
std::unique_ptr<IoctlHelper> ioctlHelper(IoctlHelper::get(productFamily, "-1", "unk", drm));
std::unique_ptr<IoctlHelper> ioctlHelper(IoctlHelper::getI915Helper(productFamily, "-1", drm));
EXPECT_NE(nullptr, ioctlHelper.get());
}