mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-28 16:48:45 +08:00
Related-To: NEO-6575 This is needed to fix accessing IoctlHelper after driver detach. This way we are also reducing accessing sysfs file in Drm::getPrelimVersion Signed-off-by: Szymon Morek <szymon.morek@intel.com>
25 lines
606 B
C++
25 lines
606 B
C++
/*
|
|
* Copyright (C) 2022 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "shared/source/os_interface/linux/ioctl_helper.h"
|
|
|
|
#include <memory>
|
|
|
|
namespace NEO {
|
|
IoctlHelper *ioctlHelperFactory[IGFX_MAX_PRODUCT] = {};
|
|
|
|
IoctlHelper *IoctlHelper::get(const HardwareInfo *hwInfo, const std::string &prelimVersion) {
|
|
auto product = hwInfo->platform.eProductFamily;
|
|
|
|
auto productSpecificIoctlHelper = ioctlHelperFactory[product];
|
|
if (productSpecificIoctlHelper) {
|
|
return productSpecificIoctlHelper->clone();
|
|
}
|
|
return new IoctlHelperUpstream{};
|
|
|
|
} // namespace NEO
|