2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2023-01-27 20:45:12 +08:00
|
|
|
* Copyright (C) 2020-2023 Intel Corporation
|
2019-03-26 18:59:46 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-03-27 20:28:54 +08:00
|
|
|
#include "shared/source/os_interface/linux/driver_info_linux.h"
|
|
|
|
|
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2021-05-21 07:17:57 +08:00
|
|
|
#include "shared/source/os_interface/os_interface.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-11-05 20:40:03 +08:00
|
|
|
DriverInfo *DriverInfo::create(const HardwareInfo *hwInfo, const OSInterface *osInterface) {
|
2022-05-10 01:40:30 +08:00
|
|
|
PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue);
|
2020-11-05 20:40:03 +08:00
|
|
|
if (osInterface) {
|
2021-05-26 00:42:36 +08:00
|
|
|
pciBusInfo = osInterface->getDriverModel()->getPciBusInfo();
|
2020-11-05 20:40:03 +08:00
|
|
|
}
|
2020-03-27 20:28:54 +08:00
|
|
|
if (hwInfo) {
|
|
|
|
auto imageSupport = hwInfo->capabilityTable.supportsImages;
|
2020-11-05 20:40:03 +08:00
|
|
|
return new DriverInfoLinux(imageSupport, pciBusInfo);
|
2020-03-27 20:28:54 +08:00
|
|
|
}
|
|
|
|
return nullptr;
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
2020-03-27 20:28:54 +08:00
|
|
|
|
2020-11-05 20:40:03 +08:00
|
|
|
DriverInfoLinux::DriverInfoLinux(bool imageSupport, const PhysicalDevicePciBusInfo &pciBusInfo)
|
2022-08-04 19:29:25 +08:00
|
|
|
: DriverInfo(DriverInfoType::LINUX), imageSupport(imageSupport) {
|
2020-11-05 20:40:03 +08:00
|
|
|
this->pciBusInfo = pciBusInfo;
|
|
|
|
}
|
2020-03-27 20:28:54 +08:00
|
|
|
|
2022-08-04 19:29:25 +08:00
|
|
|
bool DriverInfoLinux::getMediaSharingSupport() { return imageSupport; }
|
2020-03-27 20:28:54 +08:00
|
|
|
|
2020-03-06 01:13:32 +08:00
|
|
|
} // namespace NEO
|