Skip to content

Commit 571199d

Browse files
Unify query ioctls
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
1 parent 58ec879 commit 571199d

File tree

11 files changed

+83
-129
lines changed

11 files changed

+83
-129
lines changed

shared/source/os_interface/linux/drm_neo.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ std::string getIoctlString(DrmIoctl ioctlRequest) {
142142
return "DRM_IOCTL_I915_GEM_VM_CREATE";
143143
case DrmIoctl::GemVmDestroy:
144144
return "DRM_IOCTL_I915_GEM_VM_DESTROY";
145+
case DrmIoctl::QueryEngineInfo:
146+
return "DRM_I915_QUERY_ENGINE_INFO";
147+
case DrmIoctl::QueryMemoryRegions:
148+
return "DRM_I915_QUERY_MEMORY_REGIONS";
145149
}
146150
UNRECOVERABLE_IF(true);
147151
return "";
@@ -977,7 +981,7 @@ bool Drm::querySystemInfo() {
977981
}
978982

979983
std::vector<uint8_t> Drm::getMemoryRegions() {
980-
return this->query(ioctlHelper->getMemRegionsIoctlVal(), 0);
984+
return this->query(ioctlHelper->getIoctlRequestValue(DrmIoctl::QueryMemoryRegions), 0);
981985
}
982986

983987
bool Drm::queryMemoryInfo() {
@@ -991,7 +995,7 @@ bool Drm::queryMemoryInfo() {
991995
}
992996

993997
bool Drm::queryEngineInfo(bool isSysmanEnabled) {
994-
auto enginesQuery = this->query(ioctlHelper->getEngineInfoIoctlVal(), 0);
998+
auto enginesQuery = this->query(ioctlHelper->getIoctlRequestValue(DrmIoctl::QueryEngineInfo), 0);
995999
if (enginesQuery.empty()) {
9961000
return false;
9971001
}

shared/source/os_interface/linux/drm_wrappers.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ enum class DrmIoctl {
214214
GemContextGetparam,
215215
GemContextSetparam,
216216
Query,
217+
QueryEngineInfo,
218+
QueryMemoryRegions,
217219
GemMmap,
218220
GemMmapOffset,
219221
GemVmCreate,

shared/source/os_interface/linux/ioctl_helper.cpp

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,60 @@ void IoctlHelper::logExecBuffer(const ExecBuffer &execBuffer, std::stringstream
8282
<< " }\n";
8383
}
8484

85+
unsigned int IoctlHelper::getIoctlRequestValueBase(DrmIoctl ioctlRequest) const {
86+
switch (ioctlRequest) {
87+
case DrmIoctl::GemExecbuffer2:
88+
return DRM_IOCTL_I915_GEM_EXECBUFFER2;
89+
case DrmIoctl::GemWait:
90+
return DRM_IOCTL_I915_GEM_WAIT;
91+
case DrmIoctl::GemClose:
92+
return DRM_IOCTL_GEM_CLOSE;
93+
case DrmIoctl::GemUserptr:
94+
return DRM_IOCTL_I915_GEM_USERPTR;
95+
case DrmIoctl::GemCreate:
96+
return DRM_IOCTL_I915_GEM_CREATE;
97+
case DrmIoctl::GemSetDomain:
98+
return DRM_IOCTL_I915_GEM_SET_DOMAIN;
99+
case DrmIoctl::GemSetTiling:
100+
return DRM_IOCTL_I915_GEM_SET_TILING;
101+
case DrmIoctl::GemGetTiling:
102+
return DRM_IOCTL_I915_GEM_GET_TILING;
103+
case DrmIoctl::GemContextCreateExt:
104+
return DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT;
105+
case DrmIoctl::GemContextDestroy:
106+
return DRM_IOCTL_I915_GEM_CONTEXT_DESTROY;
107+
case DrmIoctl::RegRead:
108+
return DRM_IOCTL_I915_REG_READ;
109+
case DrmIoctl::GetResetStats:
110+
return DRM_IOCTL_I915_GET_RESET_STATS;
111+
case DrmIoctl::GemContextGetparam:
112+
return DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM;
113+
case DrmIoctl::GemContextSetparam:
114+
return DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM;
115+
case DrmIoctl::Query:
116+
return DRM_IOCTL_I915_QUERY;
117+
case DrmIoctl::GemMmap:
118+
return DRM_IOCTL_I915_GEM_MMAP;
119+
case DrmIoctl::PrimeFdToHandle:
120+
return DRM_IOCTL_PRIME_FD_TO_HANDLE;
121+
case DrmIoctl::PrimeHandleToFd:
122+
return DRM_IOCTL_PRIME_HANDLE_TO_FD;
123+
case DrmIoctl::GemMmapOffset:
124+
return DRM_IOCTL_I915_GEM_MMAP_OFFSET;
125+
case DrmIoctl::GemVmCreate:
126+
return DRM_IOCTL_I915_GEM_VM_CREATE;
127+
case DrmIoctl::GemVmDestroy:
128+
return DRM_IOCTL_I915_GEM_VM_DESTROY;
129+
case DrmIoctl::QueryEngineInfo:
130+
return DRM_I915_QUERY_ENGINE_INFO;
131+
case DrmIoctl::QueryMemoryRegions:
132+
return DRM_I915_QUERY_MEMORY_REGIONS;
133+
default:
134+
UNRECOVERABLE_IF(true);
135+
return 0;
136+
}
137+
}
138+
85139
uint32_t IoctlHelper::createDrmContext(Drm &drm, const OsContext &osContext, uint32_t drmVmId) {
86140

87141
const auto numberOfCCS = drm.getRootDeviceEnvironment().getHardwareInfo()->gtSystemInfo.CCSInfo.NumberOfCCSEnabled;

shared/source/os_interface/linux/ioctl_helper.h

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ class IoctlHelper {
8484
virtual bool setVmBoAdvise(Drm *drm, int32_t handle, uint32_t attribute, void *region) = 0;
8585
virtual bool setVmPrefetch(Drm *drm, uint64_t start, uint64_t length, uint32_t region) = 0;
8686
virtual uint32_t getDirectSubmissionFlag() = 0;
87-
virtual int32_t getMemRegionsIoctlVal() = 0;
88-
virtual int32_t getEngineInfoIoctlVal() = 0;
8987
virtual uint32_t getComputeSlicesIoctlVal() = 0;
9088
virtual std::unique_ptr<uint8_t[]> prepareVmBindExt(const StackVec<uint32_t, 2> &bindExtHandles) = 0;
9189
virtual uint64_t getFlagsForVmBind(bool bindCapture, bool bindImmediate, bool bindMakeResident) = 0;
@@ -115,7 +113,7 @@ class IoctlHelper {
115113
virtual bool isContextDebugSupported(Drm *drm) = 0;
116114
virtual int setContextDebugFlag(Drm *drm, uint32_t drmContextId) = 0;
117115
virtual bool isDebugAttachAvailable() = 0;
118-
virtual unsigned int getIoctlRequestValue(DrmIoctl ioctlRequest) = 0;
116+
virtual unsigned int getIoctlRequestValue(DrmIoctl ioctlRequest) const = 0;
119117

120118
uint32_t createDrmContext(Drm &drm, const OsContext &osContext, uint32_t drmVmId);
121119

@@ -124,6 +122,9 @@ class IoctlHelper {
124122

125123
void fillExecBuffer(ExecBuffer &execBuffer, uintptr_t buffersPtr, uint32_t bufferCount, uint32_t startOffset, uint32_t size, uint64_t flags, uint32_t drmContextId);
126124
void logExecBuffer(const ExecBuffer &execBuffer, std::stringstream &logger);
125+
126+
protected:
127+
unsigned int getIoctlRequestValueBase(DrmIoctl ioctlRequest) const;
127128
};
128129

129130
class IoctlHelperUpstream : public IoctlHelper {
@@ -144,8 +145,6 @@ class IoctlHelperUpstream : public IoctlHelper {
144145
bool setVmBoAdvise(Drm *drm, int32_t handle, uint32_t attribute, void *region) override;
145146
bool setVmPrefetch(Drm *drm, uint64_t start, uint64_t length, uint32_t region) override;
146147
uint32_t getDirectSubmissionFlag() override;
147-
int32_t getMemRegionsIoctlVal() override;
148-
int32_t getEngineInfoIoctlVal() override;
149148
uint32_t getComputeSlicesIoctlVal() override;
150149
std::unique_ptr<uint8_t[]> prepareVmBindExt(const StackVec<uint32_t, 2> &bindExtHandles) override;
151150
uint64_t getFlagsForVmBind(bool bindCapture, bool bindImmediate, bool bindMakeResident) override;
@@ -175,7 +174,7 @@ class IoctlHelperUpstream : public IoctlHelper {
175174
bool isContextDebugSupported(Drm *drm) override;
176175
int setContextDebugFlag(Drm *drm, uint32_t drmContextId) override;
177176
bool isDebugAttachAvailable() override;
178-
unsigned int getIoctlRequestValue(DrmIoctl ioctlRequest) override;
177+
unsigned int getIoctlRequestValue(DrmIoctl ioctlRequest) const override;
179178
};
180179

181180
template <PRODUCT_FAMILY gfxProduct>
@@ -189,7 +188,7 @@ class IoctlHelperImpl : public IoctlHelperUpstream {
189188

190189
uint32_t createGemExt(Drm *drm, const MemRegionsVec &memClassInstances, size_t allocSize, uint32_t &handle, uint32_t vmId) override;
191190
std::vector<MemoryRegion> translateToMemoryRegions(const std::vector<uint8_t> &regionInfo) override;
192-
unsigned int getIoctlRequestValue(DrmIoctl ioctlRequest) override;
191+
unsigned int getIoctlRequestValue(DrmIoctl ioctlRequest) const override;
193192
};
194193

195194
class IoctlHelperPrelim20 : public IoctlHelper {
@@ -210,8 +209,6 @@ class IoctlHelperPrelim20 : public IoctlHelper {
210209
bool setVmBoAdvise(Drm *drm, int32_t handle, uint32_t attribute, void *region) override;
211210
bool setVmPrefetch(Drm *drm, uint64_t start, uint64_t length, uint32_t region) override;
212211
uint32_t getDirectSubmissionFlag() override;
213-
int32_t getMemRegionsIoctlVal() override;
214-
int32_t getEngineInfoIoctlVal() override;
215212
uint32_t getComputeSlicesIoctlVal() override;
216213
std::unique_ptr<uint8_t[]> prepareVmBindExt(const StackVec<uint32_t, 2> &bindExtHandles) override;
217214
uint64_t getFlagsForVmBind(bool bindCapture, bool bindImmediate, bool bindMakeResident) override;
@@ -241,7 +238,7 @@ class IoctlHelperPrelim20 : public IoctlHelper {
241238
bool isContextDebugSupported(Drm *drm) override;
242239
int setContextDebugFlag(Drm *drm, uint32_t drmContextId) override;
243240
bool isDebugAttachAvailable() override;
244-
unsigned int getIoctlRequestValue(DrmIoctl ioctlRequest) override;
241+
unsigned int getIoctlRequestValue(DrmIoctl ioctlRequest) const override;
245242
};
246243

247244
} // namespace NEO

shared/source/os_interface/linux/ioctl_helper_prelim.cpp

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,6 @@ uint32_t IoctlHelperPrelim20::getDirectSubmissionFlag() {
227227
return PRELIM_I915_CONTEXT_CREATE_FLAGS_LONG_RUNNING;
228228
}
229229

230-
int32_t IoctlHelperPrelim20::getMemRegionsIoctlVal() {
231-
return PRELIM_DRM_I915_QUERY_MEMORY_REGIONS;
232-
}
233-
234-
int32_t IoctlHelperPrelim20::getEngineInfoIoctlVal() {
235-
return PRELIM_DRM_I915_QUERY_ENGINE_INFO;
236-
}
237-
238230
uint32_t IoctlHelperPrelim20::getComputeSlicesIoctlVal() {
239231
return PRELIM_DRM_I915_QUERY_COMPUTE_SLICES;
240232
}
@@ -562,44 +554,8 @@ bool IoctlHelperPrelim20::isDebugAttachAvailable() {
562554
return true;
563555
}
564556

565-
unsigned int IoctlHelperPrelim20::getIoctlRequestValue(DrmIoctl ioctlRequest) {
557+
unsigned int IoctlHelperPrelim20::getIoctlRequestValue(DrmIoctl ioctlRequest) const {
566558
switch (ioctlRequest) {
567-
case DrmIoctl::GemExecbuffer2:
568-
return DRM_IOCTL_I915_GEM_EXECBUFFER2;
569-
case DrmIoctl::GemWait:
570-
return DRM_IOCTL_I915_GEM_WAIT;
571-
case DrmIoctl::GemClose:
572-
return DRM_IOCTL_GEM_CLOSE;
573-
case DrmIoctl::GemUserptr:
574-
return DRM_IOCTL_I915_GEM_USERPTR;
575-
case DrmIoctl::GemCreate:
576-
return DRM_IOCTL_I915_GEM_CREATE;
577-
case DrmIoctl::GemSetDomain:
578-
return DRM_IOCTL_I915_GEM_SET_DOMAIN;
579-
case DrmIoctl::GemSetTiling:
580-
return DRM_IOCTL_I915_GEM_SET_TILING;
581-
case DrmIoctl::GemGetTiling:
582-
return DRM_IOCTL_I915_GEM_GET_TILING;
583-
case DrmIoctl::GemContextCreateExt:
584-
return DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT;
585-
case DrmIoctl::GemContextDestroy:
586-
return DRM_IOCTL_I915_GEM_CONTEXT_DESTROY;
587-
case DrmIoctl::RegRead:
588-
return DRM_IOCTL_I915_REG_READ;
589-
case DrmIoctl::GetResetStats:
590-
return DRM_IOCTL_I915_GET_RESET_STATS;
591-
case DrmIoctl::GemContextGetparam:
592-
return DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM;
593-
case DrmIoctl::GemContextSetparam:
594-
return DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM;
595-
case DrmIoctl::Query:
596-
return DRM_IOCTL_I915_QUERY;
597-
case DrmIoctl::GemMmap:
598-
return DRM_IOCTL_I915_GEM_MMAP;
599-
case DrmIoctl::PrimeFdToHandle:
600-
return DRM_IOCTL_PRIME_FD_TO_HANDLE;
601-
case DrmIoctl::PrimeHandleToFd:
602-
return DRM_IOCTL_PRIME_HANDLE_TO_FD;
603559
case DrmIoctl::GemVmBind:
604560
return PRELIM_DRM_IOCTL_I915_GEM_VM_BIND;
605561
case DrmIoctl::GemVmUnbind:
@@ -624,15 +580,8 @@ unsigned int IoctlHelperPrelim20::getIoctlRequestValue(DrmIoctl ioctlRequest) {
624580
return PRELIM_DRM_IOCTL_I915_GEM_CLOS_FREE;
625581
case DrmIoctl::GemCacheReserve:
626582
return PRELIM_DRM_IOCTL_I915_GEM_CACHE_RESERVE;
627-
case DrmIoctl::GemMmapOffset:
628-
return DRM_IOCTL_I915_GEM_MMAP_OFFSET;
629-
case DrmIoctl::GemVmCreate:
630-
return DRM_IOCTL_I915_GEM_VM_CREATE;
631-
case DrmIoctl::GemVmDestroy:
632-
return DRM_IOCTL_I915_GEM_VM_DESTROY;
633583
default:
634-
UNRECOVERABLE_IF(true);
635-
return 0u;
584+
return getIoctlRequestValueBase(ioctlRequest);
636585
}
637586
}
638587

shared/source/os_interface/linux/ioctl_helper_upstream.cpp

Lines changed: 4 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,6 @@ uint32_t IoctlHelperUpstream::getDirectSubmissionFlag() {
111111
return 0u;
112112
}
113113

114-
int32_t IoctlHelperUpstream::getMemRegionsIoctlVal() {
115-
return DRM_I915_QUERY_MEMORY_REGIONS;
116-
}
117-
118-
int32_t IoctlHelperUpstream::getEngineInfoIoctlVal() {
119-
return DRM_I915_QUERY_ENGINE_INFO;
120-
}
121-
122114
uint32_t IoctlHelperUpstream::getComputeSlicesIoctlVal() {
123115
return 0;
124116
}
@@ -244,55 +236,11 @@ bool IoctlHelperUpstream::isDebugAttachAvailable() {
244236
return false;
245237
}
246238

247-
unsigned int IoctlHelperUpstream::getIoctlRequestValue(DrmIoctl ioctlRequest) {
248-
switch (ioctlRequest) {
249-
case DrmIoctl::GemExecbuffer2:
250-
return DRM_IOCTL_I915_GEM_EXECBUFFER2;
251-
case DrmIoctl::GemWait:
252-
return DRM_IOCTL_I915_GEM_WAIT;
253-
case DrmIoctl::GemClose:
254-
return DRM_IOCTL_GEM_CLOSE;
255-
case DrmIoctl::GemUserptr:
256-
return DRM_IOCTL_I915_GEM_USERPTR;
257-
case DrmIoctl::GemCreate:
258-
return DRM_IOCTL_I915_GEM_CREATE;
259-
case DrmIoctl::GemCreateExt:
239+
unsigned int IoctlHelperUpstream::getIoctlRequestValue(DrmIoctl ioctlRequest) const {
240+
if (ioctlRequest == DrmIoctl::GemCreateExt) {
260241
return DRM_IOCTL_I915_GEM_CREATE_EXT;
261-
case DrmIoctl::GemSetDomain:
262-
return DRM_IOCTL_I915_GEM_SET_DOMAIN;
263-
case DrmIoctl::GemSetTiling:
264-
return DRM_IOCTL_I915_GEM_SET_TILING;
265-
case DrmIoctl::GemGetTiling:
266-
return DRM_IOCTL_I915_GEM_GET_TILING;
267-
case DrmIoctl::GemContextCreateExt:
268-
return DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT;
269-
case DrmIoctl::GemContextDestroy:
270-
return DRM_IOCTL_I915_GEM_CONTEXT_DESTROY;
271-
case DrmIoctl::RegRead:
272-
return DRM_IOCTL_I915_REG_READ;
273-
case DrmIoctl::GetResetStats:
274-
return DRM_IOCTL_I915_GET_RESET_STATS;
275-
case DrmIoctl::GemContextGetparam:
276-
return DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM;
277-
case DrmIoctl::GemContextSetparam:
278-
return DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM;
279-
case DrmIoctl::Query:
280-
return DRM_IOCTL_I915_QUERY;
281-
case DrmIoctl::GemMmap:
282-
return DRM_IOCTL_I915_GEM_MMAP;
283-
case DrmIoctl::PrimeFdToHandle:
284-
return DRM_IOCTL_PRIME_FD_TO_HANDLE;
285-
case DrmIoctl::PrimeHandleToFd:
286-
return DRM_IOCTL_PRIME_HANDLE_TO_FD;
287-
case DrmIoctl::GemMmapOffset:
288-
return DRM_IOCTL_I915_GEM_MMAP_OFFSET;
289-
case DrmIoctl::GemVmCreate:
290-
return DRM_IOCTL_I915_GEM_VM_CREATE;
291-
case DrmIoctl::GemVmDestroy:
292-
return DRM_IOCTL_I915_GEM_VM_DESTROY;
293-
default:
294-
UNRECOVERABLE_IF(true);
295-
return 0u;
296242
}
243+
244+
return getIoctlRequestValueBase(ioctlRequest);
297245
}
298246
} // namespace NEO

shared/source/os_interface/linux/local/dg1/ioctl_helper_dg1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ std::vector<MemoryRegion> IoctlHelperImpl<gfxProduct>::translateToMemoryRegions(
6767
}
6868

6969
template <>
70-
unsigned int IoctlHelperImpl<gfxProduct>::getIoctlRequestValue(DrmIoctl ioctlRequest) {
70+
unsigned int IoctlHelperImpl<gfxProduct>::getIoctlRequestValue(DrmIoctl ioctlRequest) const {
7171
switch (ioctlRequest) {
7272
case DrmIoctl::DG1GemCreateExt:
7373
return DRM_IOCTL_I915_GEM_CREATE_EXT;

shared/test/common/libult/linux/drm_mock_prelim_context.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ bool DrmMockPrelimContext::handlePrelimQueryItem(void *arg) {
274274
const auto numberOfCCS = gtSystemInfo.CCSInfo.IsValid && !disableCcsSupport ? gtSystemInfo.CCSInfo.NumberOfCCSEnabled : 0u;
275275

276276
switch (queryItem->queryId) {
277-
case PRELIM_DRM_I915_QUERY_ENGINE_INFO: {
277+
case DRM_I915_QUERY_ENGINE_INFO: {
278278
auto numberOfTiles = gtSystemInfo.MultiTileArchInfo.IsValid ? gtSystemInfo.MultiTileArchInfo.TileCount : 1u;
279279
uint32_t numberOfEngines = numberOfTiles * (4u + numberOfCCS + static_cast<uint32_t>(supportedCopyEnginesMask.count()));
280280
int engineInfoSize = sizeof(prelim_drm_i915_query_engine_info) + numberOfEngines * sizeof(prelim_drm_i915_engine_info);
@@ -306,7 +306,7 @@ bool DrmMockPrelimContext::handlePrelimQueryItem(void *arg) {
306306
break;
307307
}
308308

309-
case PRELIM_DRM_I915_QUERY_MEMORY_REGIONS: {
309+
case DRM_I915_QUERY_MEMORY_REGIONS: {
310310
if (queryMemoryRegionInfoSuccessCount == 0) {
311311
queryItem->length = -EINVAL;
312312
return true;

shared/test/unit_test/os_interface/linux/ioctl_helper_tests_prelim.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ TEST_F(IoctlPrelimHelperTests, givenPrelimsWhenGetDirectSubmissionFlagThenCorrec
187187
}
188188

189189
TEST_F(IoctlPrelimHelperTests, givenPrelimsWhenGetMemRegionsIoctlValThenCorrectValueReturned) {
190-
EXPECT_EQ(PRELIM_DRM_I915_QUERY_MEMORY_REGIONS, ioctlHelper.getMemRegionsIoctlVal());
190+
EXPECT_EQ(static_cast<unsigned int>(DRM_I915_QUERY_MEMORY_REGIONS), getIoctlRequestValue(DrmIoctl::QueryMemoryRegions, &ioctlHelper));
191191
}
192192

193193
TEST_F(IoctlPrelimHelperTests, givenPrelimsWhenGetEngineInfoIoctlValThenCorrectValueReturned) {
194-
EXPECT_EQ(PRELIM_DRM_I915_QUERY_ENGINE_INFO, ioctlHelper.getEngineInfoIoctlVal());
194+
EXPECT_EQ(static_cast<unsigned int>(DRM_I915_QUERY_ENGINE_INFO), getIoctlRequestValue(DrmIoctl::QueryEngineInfo, &ioctlHelper));
195195
}
196196

197197
TEST_F(IoctlPrelimHelperTests, givenPrelimsWhenTranslateToEngineCapsThenReturnSameData) {

shared/test/unit_test/os_interface/linux/ioctl_helper_tests_upstream.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,15 @@ TEST(IoctlHelperTestsUpstream, givenUpstreamWhenGetMemRegionsIoctlValThenCorrect
222222
executionEnvironment->prepareRootDeviceEnvironments(1);
223223
auto drm = std::make_unique<DrmTipMock>(*executionEnvironment->rootDeviceEnvironments[0]);
224224

225-
EXPECT_EQ(DRM_I915_QUERY_MEMORY_REGIONS, drm->getIoctlHelper()->getMemRegionsIoctlVal());
225+
EXPECT_EQ(static_cast<unsigned int>(DRM_I915_QUERY_MEMORY_REGIONS), getIoctlRequestValue(DrmIoctl::QueryMemoryRegions, drm->getIoctlHelper()));
226226
}
227227

228228
TEST(IoctlHelperTestsUpstream, givenUpstreamWhenGetEngineInfoIoctlValThenCorrectValueReturned) {
229229
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
230230
executionEnvironment->prepareRootDeviceEnvironments(1);
231231
auto drm = std::make_unique<DrmTipMock>(*executionEnvironment->rootDeviceEnvironments[0]);
232232

233-
EXPECT_EQ(DRM_I915_QUERY_ENGINE_INFO, drm->getIoctlHelper()->getEngineInfoIoctlVal());
233+
EXPECT_EQ(static_cast<unsigned int>(DRM_I915_QUERY_ENGINE_INFO), getIoctlRequestValue(DrmIoctl::QueryEngineInfo, drm->getIoctlHelper()));
234234
}
235235

236236
TEST(IoctlHelperTestsUpstream, givenUpstreamWhenQueryDistancesThenReturnEinval) {

0 commit comments

Comments
 (0)