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