2023-02-14 23:03:52 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2023 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "shared/source/execution_environment/execution_environment.h"
|
|
|
|
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
|
|
|
|
2023-03-01 17:29:12 +08:00
|
|
|
#include "level_zero/sysman/source/linux/hw_device_id_linux.h"
|
2023-02-14 23:03:52 +08:00
|
|
|
#include "level_zero/sysman/source/os_sysman.h"
|
|
|
|
#include "level_zero/sysman/source/sysman_device_imp.h"
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
2023-03-01 17:29:12 +08:00
|
|
|
namespace NEO {
|
|
|
|
class Drm;
|
|
|
|
} // namespace NEO
|
|
|
|
|
2023-02-14 23:03:52 +08:00
|
|
|
namespace L0 {
|
|
|
|
namespace Sysman {
|
|
|
|
class PlatformMonitoringTech;
|
2023-03-08 18:35:11 +08:00
|
|
|
class PmuInterface;
|
2023-02-14 23:03:52 +08:00
|
|
|
class FsAccess;
|
|
|
|
class ProcfsAccess;
|
|
|
|
class SysfsAccess;
|
2023-03-08 18:35:11 +08:00
|
|
|
class FirmwareUtil;
|
2023-02-14 23:03:52 +08:00
|
|
|
|
|
|
|
class LinuxSysmanImp : public OsSysman, NEO::NonCopyableOrMovableClass {
|
|
|
|
public:
|
|
|
|
LinuxSysmanImp(SysmanDeviceImp *pParentSysmanDeviceImp);
|
|
|
|
~LinuxSysmanImp() override;
|
|
|
|
|
|
|
|
ze_result_t init() override;
|
|
|
|
|
2023-03-08 18:35:11 +08:00
|
|
|
FirmwareUtil *getFwUtilInterface();
|
|
|
|
PmuInterface *getPmuInterface() { return pPmuInterface; }
|
2023-02-14 23:03:52 +08:00
|
|
|
FsAccess &getFsAccess();
|
|
|
|
ProcfsAccess &getProcfsAccess();
|
|
|
|
SysfsAccess &getSysfsAccess();
|
|
|
|
SysmanDeviceImp *getSysmanDeviceImp();
|
|
|
|
uint32_t getSubDeviceCount() override;
|
|
|
|
std::string getPciCardBusDirectoryPath(std::string realPciPath);
|
|
|
|
PlatformMonitoringTech *getPlatformMonitoringTechAccess(uint32_t subDeviceId);
|
|
|
|
PRODUCT_FAMILY getProductFamily() const { return pParentSysmanDeviceImp->getProductFamily(); }
|
2023-03-01 17:29:12 +08:00
|
|
|
SysmanHwDeviceIdDrm *getSysmanHwDeviceId();
|
|
|
|
NEO::Drm *getDrm();
|
2023-02-14 23:03:52 +08:00
|
|
|
void releasePmtObject();
|
|
|
|
ze_result_t createPmtHandles();
|
2023-03-08 18:35:11 +08:00
|
|
|
|
2023-02-14 23:03:52 +08:00
|
|
|
std::string devicePciBdf = "";
|
|
|
|
NEO::ExecutionEnvironment *executionEnvironment = nullptr;
|
|
|
|
uint32_t rootDeviceIndex;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
FsAccess *pFsAccess = nullptr;
|
|
|
|
ProcfsAccess *pProcfsAccess = nullptr;
|
|
|
|
SysfsAccess *pSysfsAccess = nullptr;
|
|
|
|
std::map<uint32_t, L0::Sysman::PlatformMonitoringTech *> mapOfSubDeviceIdToPmtObject;
|
|
|
|
uint32_t subDeviceCount = 0;
|
2023-03-08 18:35:11 +08:00
|
|
|
FirmwareUtil *pFwUtilInterface = nullptr;
|
|
|
|
PmuInterface *pPmuInterface = nullptr;
|
|
|
|
void releaseFwUtilInterface();
|
2023-02-14 23:03:52 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
LinuxSysmanImp() = delete;
|
|
|
|
SysmanDeviceImp *pParentSysmanDeviceImp = nullptr;
|
|
|
|
static const std::string deviceDir;
|
2023-03-08 18:35:11 +08:00
|
|
|
void createFwUtilInterface();
|
2023-02-14 23:03:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Sysman
|
|
|
|
} // namespace L0
|