|
8 | 8 | #pragma once |
9 | 9 | #include "core/helpers/basic_math.h" |
10 | 10 | #include "core/os_interface/linux/engine_info.h" |
| 11 | +#include "core/os_interface/linux/hw_device_id.h" |
11 | 12 | #include "core/os_interface/linux/memory_info.h" |
12 | 13 | #include "core/utilities/api_intercept.h" |
13 | 14 |
|
@@ -65,7 +66,7 @@ class Drm { |
65 | 66 | bool isPreemptionSupported() const { return preemptionSupported; } |
66 | 67 |
|
67 | 68 | MOCKABLE_VIRTUAL void checkPreemptionSupport(); |
68 | | - int getFileDescriptor() const { return fd; } |
| 69 | + inline int getFileDescriptor() const { return hwDeviceId->getFileDescriptor(); } |
69 | 70 | uint32_t createDrmContext(); |
70 | 71 | void destroyDrmContext(uint32_t drmContextId); |
71 | 72 | void setLowPriorityContextParam(uint32_t drmContextId); |
@@ -99,12 +100,12 @@ class Drm { |
99 | 100 | drm_i915_gem_context_param_sseu sseu{}; |
100 | 101 | bool preemptionSupported = false; |
101 | 102 | bool nonPersistentContextsSupported = false; |
102 | | - int fd; |
| 103 | + std::unique_ptr<HwDeviceId> hwDeviceId; |
103 | 104 | int deviceId = 0; |
104 | 105 | int revisionId = 0; |
105 | 106 | GTTYPE eGtType = GTTYPE_UNDEFINED; |
106 | 107 | RootDeviceEnvironment &rootDeviceEnvironment; |
107 | | - Drm(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : fd(fd), rootDeviceEnvironment(rootDeviceEnvironment) {} |
| 108 | + Drm(std::unique_ptr<HwDeviceId> hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment) : hwDeviceId(std::move(hwDeviceIdIn)), rootDeviceEnvironment(rootDeviceEnvironment) {} |
108 | 109 | std::unique_ptr<EngineInfo> engineInfo; |
109 | 110 | std::unique_ptr<MemoryInfo> memoryInfo; |
110 | 111 |
|
|
0 commit comments