2020-02-06 00:43:02 +08:00
|
|
|
/*
|
2023-01-10 01:14:18 +08:00
|
|
|
* Copyright (C) 2020-2023 Intel Corporation
|
2020-02-06 00:43:02 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2023-01-10 01:14:18 +08:00
|
|
|
#include "shared/source/helpers/driver_model_type.h"
|
2021-05-25 01:34:55 +08:00
|
|
|
#include "shared/source/os_interface/os_interface.h"
|
2020-02-06 00:43:02 +08:00
|
|
|
|
2020-04-09 00:14:19 +08:00
|
|
|
#include <string>
|
2020-02-06 00:43:02 +08:00
|
|
|
namespace NEO {
|
|
|
|
|
2021-05-25 01:34:55 +08:00
|
|
|
class HwDeviceIdDrm : public HwDeviceId {
|
2020-02-06 00:43:02 +08:00
|
|
|
public:
|
2023-12-14 00:09:52 +08:00
|
|
|
static constexpr DriverModelType driverModelType = DriverModelType::drm;
|
2021-05-25 01:34:55 +08:00
|
|
|
|
|
|
|
HwDeviceIdDrm(int fileDescriptorIn, const char *pciPathIn)
|
2023-12-14 00:09:52 +08:00
|
|
|
: HwDeviceId(DriverModelType::drm),
|
2021-05-25 01:34:55 +08:00
|
|
|
fileDescriptor(fileDescriptorIn), pciPath(pciPathIn) {}
|
2023-03-01 17:29:12 +08:00
|
|
|
HwDeviceIdDrm(int fileDescriptorIn, const char *pciPathIn, const char *devNodePathIn)
|
2023-12-14 00:09:52 +08:00
|
|
|
: HwDeviceId(DriverModelType::drm),
|
2023-03-01 17:29:12 +08:00
|
|
|
fileDescriptor(fileDescriptorIn), pciPath(pciPathIn), devNodePath(devNodePathIn) {}
|
2021-05-25 01:34:55 +08:00
|
|
|
~HwDeviceIdDrm() override;
|
2020-02-10 14:56:54 +08:00
|
|
|
int getFileDescriptor() const { return fileDescriptor; }
|
2020-04-09 00:14:19 +08:00
|
|
|
const char *getPciPath() const { return pciPath.c_str(); }
|
2023-03-01 17:29:12 +08:00
|
|
|
const char *getDeviceNode() const { return devNodePath.c_str(); }
|
2020-02-06 00:43:02 +08:00
|
|
|
|
|
|
|
protected:
|
2023-02-14 23:03:52 +08:00
|
|
|
int fileDescriptor;
|
2020-04-09 00:14:19 +08:00
|
|
|
const std::string pciPath;
|
2023-03-01 17:29:12 +08:00
|
|
|
const std::string devNodePath;
|
2020-02-06 00:43:02 +08:00
|
|
|
};
|
|
|
|
} // namespace NEO
|