Skip to content

Commit b72fcad

Browse files
Drm: call ioctl using ioctl helper if possible
Related-To: NEO-6999 Signed-off-by: Mateusz Jablonski <[email protected]>
1 parent a8e2bd3 commit b72fcad

File tree

6 files changed

+64
-43
lines changed

6 files changed

+64
-43
lines changed

level_zero/tools/source/debug/linux/prelim/drm_helper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace L0 {
1515

1616
int DrmHelper::ioctl(Device *device, NEO::DrmIoctl request, void *arg) {
1717
auto drm = device->getOsInterface().getDriverModel()->as<NEO::Drm>();
18-
return drm->ioctl(request, arg);
18+
return drm->getIoctlHelper()->ioctl(drm, request, arg);
1919
}
2020

2121
int DrmHelper::getErrno(Device *device) {

shared/source/os_interface/linux/device_time_drm.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ void DeviceTimeDrm::timestampTypeDetect() {
3131
return;
3232

3333
reg.offset = (REG_GLOBAL_TIMESTAMP_LDW | 1);
34-
err = pDrm->ioctl(DrmIoctl::RegRead, &reg);
34+
auto ioctlHelper = pDrm->getIoctlHelper();
35+
err = ioctlHelper->ioctl(pDrm, DrmIoctl::RegRead, &reg);
3536
if (err) {
3637
reg.offset = REG_GLOBAL_TIMESTAMP_UN;
37-
err = pDrm->ioctl(DrmIoctl::RegRead, &reg);
38+
err = ioctlHelper->ioctl(pDrm, DrmIoctl::RegRead, &reg);
3839
if (err) {
3940
getGpuTime = &DeviceTimeDrm::getGpuTime32;
4041
} else {
@@ -50,7 +51,8 @@ bool DeviceTimeDrm::getGpuTime32(uint64_t *timestamp) {
5051

5152
reg.offset = REG_GLOBAL_TIMESTAMP_LDW;
5253

53-
if (pDrm->ioctl(DrmIoctl::RegRead, &reg)) {
54+
auto ioctlHelper = pDrm->getIoctlHelper();
55+
if (ioctlHelper->ioctl(pDrm, DrmIoctl::RegRead, &reg)) {
5456
return false;
5557
}
5658
*timestamp = reg.value >> 32;
@@ -62,7 +64,8 @@ bool DeviceTimeDrm::getGpuTime36(uint64_t *timestamp) {
6264

6365
reg.offset = REG_GLOBAL_TIMESTAMP_LDW | 1;
6466

65-
if (pDrm->ioctl(DrmIoctl::RegRead, &reg)) {
67+
auto ioctlHelper = pDrm->getIoctlHelper();
68+
if (ioctlHelper->ioctl(pDrm, DrmIoctl::RegRead, &reg)) {
6669
return false;
6770
}
6871
*timestamp = reg.value;
@@ -78,11 +81,12 @@ bool DeviceTimeDrm::getGpuTimeSplitted(uint64_t *timestamp) {
7881
regHi.offset = REG_GLOBAL_TIMESTAMP_UN;
7982
regLo.offset = REG_GLOBAL_TIMESTAMP_LDW;
8083

81-
err += pDrm->ioctl(DrmIoctl::RegRead, &regHi);
84+
auto ioctlHelper = pDrm->getIoctlHelper();
85+
err += ioctlHelper->ioctl(pDrm, DrmIoctl::RegRead, &regHi);
8286
do {
8387
tmpHi = regHi.value;
84-
err += pDrm->ioctl(DrmIoctl::RegRead, &regLo);
85-
err += pDrm->ioctl(DrmIoctl::RegRead, &regHi);
88+
err += ioctlHelper->ioctl(pDrm, DrmIoctl::RegRead, &regLo);
89+
err += ioctlHelper->ioctl(pDrm, DrmIoctl::RegRead, &regHi);
8690
} while (err == 0 && regHi.value != tmpHi && --loop);
8791

8892
if (err) {

shared/source/os_interface/linux/drm_buffer_object.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ bool BufferObject::close() {
6868

6969
PRINT_DEBUG_STRING(DebugManager.flags.PrintBOCreateDestroyResult.get(), stdout, "Calling gem close on handle: BO-%d\n", this->handle);
7070

71-
int ret = this->drm->ioctl(DrmIoctl::GemClose, &close);
71+
auto ioctlHelper = this->drm->getIoctlHelper();
72+
int ret = ioctlHelper->ioctl(drm, DrmIoctl::GemClose, &close);
7273
if (ret != 0) {
7374
int err = errno;
7475
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "ioctl(GEM_CLOSE) failed with %d. errno=%d(%s)\n", ret, err, strerror(err));
@@ -101,8 +102,9 @@ bool BufferObject::setTiling(uint32_t mode, uint32_t stride) {
101102
setTiling.handle = this->handle;
102103
setTiling.tilingMode = mode;
103104
setTiling.stride = stride;
105+
auto ioctlHelper = this->drm->getIoctlHelper();
104106

105-
if (this->drm->ioctl(DrmIoctl::GemSetTiling, &setTiling) != 0) {
107+
if (ioctlHelper->ioctl(drm, DrmIoctl::GemSetTiling, &setTiling) != 0) {
106108
return false;
107109
}
108110

shared/source/os_interface/linux/drm_memory_manager.cpp

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,9 @@ NEO::BufferObject *DrmMemoryManager::allocUserptr(uintptr_t address, size_t size
246246
userptr.userSize = size;
247247

248248
auto &drm = this->getDrm(rootDeviceIndex);
249+
auto ioctlHelper = drm.getIoctlHelper();
249250

250-
if (drm.ioctl(DrmIoctl::GemUserptr, &userptr) != 0) {
251+
if (ioctlHelper->ioctl(&drm, DrmIoctl::GemUserptr, &userptr) != 0) {
251252
return nullptr;
252253
}
253254

@@ -520,8 +521,9 @@ GraphicsAllocation *DrmMemoryManager::allocateMemoryByKMD(const AllocationData &
520521
create.size = bufferSize;
521522

522523
auto &drm = getDrm(allocationData.rootDeviceIndex);
524+
auto ioctlHelper = drm.getIoctlHelper();
523525

524-
[[maybe_unused]] auto ret = drm.ioctl(DrmIoctl::GemCreate, &create);
526+
[[maybe_unused]] auto ret = ioctlHelper->ioctl(&drm, DrmIoctl::GemCreate, &create);
525527
DEBUG_BREAK_IF(ret != 0);
526528

527529
auto patIndex = drm.getPatIndex(gmm.get(), allocationData.type, CacheRegion::Default, CachePolicy::WriteBack, false);
@@ -553,8 +555,9 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryForImageImpl(const A
553555
create.size = allocationData.imgInfo->size;
554556

555557
auto &drm = this->getDrm(allocationData.rootDeviceIndex);
558+
auto ioctlHelper = drm.getIoctlHelper();
556559

557-
[[maybe_unused]] auto ret = drm.ioctl(DrmIoctl::GemCreate, &create);
560+
[[maybe_unused]] auto ret = ioctlHelper->ioctl(&drm, DrmIoctl::GemCreate, &create);
558561
DEBUG_BREAK_IF(ret != 0);
559562

560563
auto patIndex = drm.getPatIndex(gmm.get(), allocationData.type, CacheRegion::Default, CachePolicy::WriteBack, false);
@@ -565,7 +568,6 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryForImageImpl(const A
565568
}
566569
bo->setAddress(gpuRange);
567570

568-
auto ioctlHelper = drm.getIoctlHelper();
569571
[[maybe_unused]] auto ret2 = bo->setTiling(ioctlHelper->getDrmParamValue(DrmParam::TilingY), static_cast<uint32_t>(allocationData.imgInfo->rowPitch));
570572
DEBUG_BREAK_IF(ret2 != true);
571573

@@ -682,12 +684,13 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromMultipleShared
682684
auto &drm = this->getDrm(properties.rootDeviceIndex);
683685

684686
bool areBosSharedObjects = true;
687+
auto ioctlHelper = drm.getIoctlHelper();
685688

686689
for (auto handle : handles) {
687690
PrimeHandle openFd = {0, 0, 0};
688691
openFd.fileDescriptor = handle;
689692

690-
auto ret = this->getDrm(properties.rootDeviceIndex).ioctl(DrmIoctl::PrimeFdToHandle, &openFd);
693+
auto ret = ioctlHelper->ioctl(&drm, DrmIoctl::PrimeFdToHandle, &openFd);
691694

692695
if (ret != 0) {
693696
[[maybe_unused]] int err = errno;
@@ -772,8 +775,9 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o
772775
openFd.fileDescriptor = handle;
773776

774777
auto &drm = this->getDrm(properties.rootDeviceIndex);
778+
auto ioctlHelper = drm.getIoctlHelper();
775779

776-
auto ret = drm.ioctl(DrmIoctl::PrimeFdToHandle, &openFd);
780+
auto ret = ioctlHelper->ioctl(&drm, DrmIoctl::PrimeFdToHandle, &openFd);
777781

778782
if (ret != 0) {
779783
[[maybe_unused]] int err = errno;
@@ -825,7 +829,8 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o
825829
if (properties.imgInfo) {
826830
GemGetTiling getTiling{};
827831
getTiling.handle = boHandle;
828-
ret = drm.ioctl(DrmIoctl::GemGetTiling, &getTiling);
832+
auto ioctlHelper = drm.getIoctlHelper();
833+
ret = ioctlHelper->ioctl(&drm, DrmIoctl::GemGetTiling, &getTiling);
829834

830835
if (ret == 0) {
831836
auto ioctlHelper = drm.getIoctlHelper();
@@ -1045,7 +1050,9 @@ bool DrmMemoryManager::setDomainCpu(GraphicsAllocation &graphicsAllocation, bool
10451050
setDomain.readDomains = I915_GEM_DOMAIN_CPU;
10461051
setDomain.writeDomain = writeEnable ? I915_GEM_DOMAIN_CPU : 0;
10471052

1048-
return getDrm(graphicsAllocation.getRootDeviceIndex()).ioctl(DrmIoctl::GemSetDomain, &setDomain) == 0;
1053+
auto &drm = this->getDrm(graphicsAllocation.getRootDeviceIndex());
1054+
auto ioctlHelper = drm.getIoctlHelper();
1055+
return ioctlHelper->ioctl(&drm, DrmIoctl::GemSetDomain, &setDomain) == 0;
10491056
}
10501057

10511058
void *DrmMemoryManager::lockResourceImpl(GraphicsAllocation &graphicsAllocation) {
@@ -1076,13 +1083,15 @@ void DrmMemoryManager::unlockResourceImpl(GraphicsAllocation &graphicsAllocation
10761083
return unlockBufferObject(static_cast<DrmAllocation &>(graphicsAllocation).getBO());
10771084
}
10781085

1079-
int DrmMemoryManager::obtainFdFromHandle(int boHandle, uint32_t rootDeviceindex) {
1086+
int DrmMemoryManager::obtainFdFromHandle(int boHandle, uint32_t rootDeviceIndex) {
10801087
PrimeHandle openFd{};
10811088

10821089
openFd.flags = DRM_CLOEXEC | DRM_RDWR;
10831090
openFd.handle = boHandle;
10841091

1085-
getDrm(rootDeviceindex).ioctl(DrmIoctl::PrimeHandleToFd, &openFd);
1092+
auto &drm = this->getDrm(rootDeviceIndex);
1093+
auto ioctlHelper = drm.getIoctlHelper();
1094+
ioctlHelper->ioctl(&drm, DrmIoctl::PrimeHandleToFd, &openFd);
10861095

10871096
return openFd.fileDescriptor;
10881097
}
@@ -1568,11 +1577,12 @@ bool DrmMemoryManager::retrieveMmapOffsetForBufferObject(uint32_t rootDeviceInde
15681577
GemMmapOffset mmapOffset = {};
15691578
mmapOffset.handle = bo.peekHandle();
15701579
mmapOffset.flags = isLocalMemorySupported(rootDeviceIndex) ? mmapOffsetFixed : flags;
1571-
auto &drm = getDrm(rootDeviceIndex);
1572-
auto ret = drm.ioctl(DrmIoctl::GemMmapOffset, &mmapOffset);
1580+
auto &drm = this->getDrm(rootDeviceIndex);
1581+
auto ioctlHelper = drm.getIoctlHelper();
1582+
auto ret = ioctlHelper->ioctl(&drm, DrmIoctl::GemMmapOffset, &mmapOffset);
15731583
if (ret != 0 && isLocalMemorySupported(rootDeviceIndex)) {
15741584
mmapOffset.flags = flags;
1575-
ret = drm.ioctl(DrmIoctl::GemMmapOffset, &mmapOffset);
1585+
ret = ioctlHelper->ioctl(&drm, DrmIoctl::GemMmapOffset, &mmapOffset);
15761586
}
15771587
if (ret != 0) {
15781588
int err = drm.getErrno();
@@ -1818,8 +1828,9 @@ DrmAllocation *DrmMemoryManager::createUSMHostAllocationFromSharedHandle(osHandl
18181828

18191829
auto &drm = this->getDrm(properties.rootDeviceIndex);
18201830
auto patIndex = drm.getPatIndex(nullptr, properties.allocationType, CacheRegion::Default, CachePolicy::WriteBack, false);
1831+
auto ioctlHelper = drm.getIoctlHelper();
18211832

1822-
auto ret = drm.ioctl(DrmIoctl::PrimeFdToHandle, &openFd);
1833+
auto ret = ioctlHelper->ioctl(&drm, DrmIoctl::PrimeFdToHandle, &openFd);
18231834
if (ret != 0) {
18241835
int err = drm.getErrno();
18251836
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "ioctl(PRIME_FD_TO_HANDLE) failed with %d. errno=%d(%s)\n", ret, err, strerror(err));

shared/source/os_interface/linux/drm_neo.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ int Drm::getParamIoctl(DrmParam param, int *dstValue) {
119119
getParam.param = getDrmParamValue(param, ioctlHelper.get());
120120
getParam.value = dstValue;
121121

122-
int retVal = ioctl(DrmIoctl::Getparam, &getParam);
122+
int retVal = ioctlHelper ? ioctlHelper->ioctl(this, DrmIoctl::Getparam, &getParam) : ioctl(DrmIoctl::Getparam, &getParam);
123123
if (DebugManager.flags.PrintIoctlEntries.get()) {
124124
printf("DRM_IOCTL_I915_GETPARAM: param: %s, output value: %d, retCode:% d\n",
125125
getDrmParamString(param).c_str(),
@@ -152,7 +152,7 @@ int Drm::enableTurboBoost() {
152152

153153
contextParam.param = I915_CONTEXT_PRIVATE_PARAM_BOOST;
154154
contextParam.value = 1;
155-
return ioctl(DrmIoctl::GemContextSetparam, &contextParam);
155+
return ioctlHelper->ioctl(this, DrmIoctl::GemContextSetparam, &contextParam);
156156
}
157157

158158
int Drm::getEnabledPooledEu(int &enabled) {
@@ -175,7 +175,7 @@ int Drm::queryGttSize(uint64_t &gttSizeOutput) {
175175
GemContextParam contextParam = {0};
176176
contextParam.param = I915_CONTEXT_PARAM_GTT_SIZE;
177177

178-
int ret = ioctl(DrmIoctl::GemContextGetparam, &contextParam);
178+
int ret = ioctlHelper->ioctl(this, DrmIoctl::GemContextGetparam, &contextParam);
179179
if (ret == 0) {
180180
gttSizeOutput = contextParam.value;
181181
}
@@ -191,7 +191,7 @@ bool Drm::isGpuHangDetected(OsContext &osContext) {
191191
ResetStats resetStats{};
192192
resetStats.contextId = drmContextId;
193193

194-
const auto retVal{ioctl(DrmIoctl::GetResetStats, &resetStats)};
194+
const auto retVal{ioctlHelper->ioctl(this, DrmIoctl::GetResetStats, &resetStats)};
195195
UNRECOVERABLE_IF(retVal != 0);
196196

197197
if (resetStats.batchActive > 0 || resetStats.batchPending > 0) {
@@ -219,7 +219,7 @@ void Drm::setLowPriorityContextParam(uint32_t drmContextId) {
219219
gcp.param = I915_CONTEXT_PARAM_PRIORITY;
220220
gcp.value = -1023;
221221

222-
auto retVal = ioctl(DrmIoctl::GemContextSetparam, &gcp);
222+
auto retVal = ioctlHelper->ioctl(this, DrmIoctl::GemContextSetparam, &gcp);
223223
UNRECOVERABLE_IF(retVal != 0);
224224
}
225225

@@ -231,7 +231,7 @@ int Drm::getQueueSliceCount(GemContextParamSseu *sseu) {
231231
contextParam.value = reinterpret_cast<uint64_t>(sseu);
232232
contextParam.size = sizeof(struct GemContextParamSseu);
233233

234-
return ioctl(DrmIoctl::GemContextGetparam, &contextParam);
234+
return ioctlHelper->ioctl(this, DrmIoctl::GemContextGetparam, &contextParam);
235235
}
236236

237237
uint64_t Drm::getSliceMask(uint64_t sliceCount) {
@@ -246,7 +246,7 @@ bool Drm::setQueueSliceCount(uint64_t sliceCount) {
246246
contextParam.contextId = 0;
247247
contextParam.value = reinterpret_cast<uint64_t>(&sseu);
248248
contextParam.size = sizeof(struct GemContextParamSseu);
249-
int retVal = ioctl(DrmIoctl::GemContextSetparam, &contextParam);
249+
int retVal = ioctlHelper->ioctl(this, DrmIoctl::GemContextSetparam, &contextParam);
250250
if (retVal == 0) {
251251
return true;
252252
}
@@ -258,7 +258,7 @@ void Drm::checkNonPersistentContextsSupport() {
258258
GemContextParam contextParam = {};
259259
contextParam.param = I915_CONTEXT_PARAM_PERSISTENCE;
260260

261-
auto retVal = ioctl(DrmIoctl::GemContextGetparam, &contextParam);
261+
auto retVal = ioctlHelper->ioctl(this, DrmIoctl::GemContextGetparam, &contextParam);
262262
if (retVal == 0 && contextParam.value == 1) {
263263
nonPersistentContextsSupported = true;
264264
} else {
@@ -271,7 +271,7 @@ void Drm::setNonPersistentContext(uint32_t drmContextId) {
271271
contextParam.contextId = drmContextId;
272272
contextParam.param = I915_CONTEXT_PARAM_PERSISTENCE;
273273

274-
ioctl(DrmIoctl::GemContextSetparam, &contextParam);
274+
ioctlHelper->ioctl(this, DrmIoctl::GemContextSetparam, &contextParam);
275275
}
276276

277277
void Drm::setUnrecoverableContext(uint32_t drmContextId) {
@@ -281,7 +281,7 @@ void Drm::setUnrecoverableContext(uint32_t drmContextId) {
281281
contextParam.value = 0;
282282
contextParam.size = 0;
283283

284-
ioctl(DrmIoctl::GemContextSetparam, &contextParam);
284+
ioctlHelper->ioctl(this, DrmIoctl::GemContextSetparam, &contextParam);
285285
}
286286

287287
uint32_t Drm::createDrmContext(uint32_t drmVmId, bool isDirectSubmissionRequested, bool isCooperativeContextRequested) {
@@ -314,7 +314,7 @@ uint32_t Drm::createDrmContext(uint32_t drmVmId, bool isDirectSubmissionRequeste
314314
if (isCooperativeContextRequested) {
315315
return ioctlHelper->createCooperativeContext(this, gcc);
316316
}
317-
auto ioctlResult = ioctl(DrmIoctl::GemContextCreateExt, &gcc);
317+
auto ioctlResult = ioctlHelper->ioctl(this, DrmIoctl::GemContextCreateExt, &gcc);
318318

319319
UNRECOVERABLE_IF(ioctlResult != 0);
320320
return gcc.contextId;
@@ -323,7 +323,7 @@ uint32_t Drm::createDrmContext(uint32_t drmVmId, bool isDirectSubmissionRequeste
323323
void Drm::destroyDrmContext(uint32_t drmContextId) {
324324
GemContextDestroy destroy{};
325325
destroy.contextId = drmContextId;
326-
auto retVal = ioctl(DrmIoctl::GemContextDestroy, &destroy);
326+
auto retVal = ioctlHelper->ioctl(this, DrmIoctl::GemContextDestroy, &destroy);
327327
UNRECOVERABLE_IF(retVal != 0);
328328
}
329329

@@ -339,7 +339,7 @@ int Drm::queryVmId(uint32_t drmContextId, uint32_t &vmId) {
339339
param.contextId = drmContextId;
340340
param.value = 0;
341341
param.param = I915_CONTEXT_PARAM_VM;
342-
auto retVal = this->ioctl(DrmIoctl::GemContextGetparam, &param);
342+
auto retVal = ioctlHelper->ioctl(this, DrmIoctl::GemContextGetparam, &param);
343343

344344
vmId = static_cast<uint32_t>(param.value);
345345

@@ -538,15 +538,15 @@ std::vector<uint8_t> Drm::query(uint32_t queryId, uint32_t queryItemFlags) {
538538
query.itemsPtr = reinterpret_cast<uint64_t>(&queryItem);
539539
query.numItems = 1;
540540

541-
auto ret = this->ioctl(DrmIoctl::Query, &query);
541+
auto ret = ioctlHelper->ioctl(this, DrmIoctl::Query, &query);
542542
if (ret != 0 || queryItem.length <= 0) {
543543
return {};
544544
}
545545

546546
auto data = std::vector<uint8_t>(queryItem.length, 0);
547547
queryItem.dataPtr = castToUint64(data.data());
548548

549-
ret = this->ioctl(DrmIoctl::Query, &query);
549+
ret = ioctlHelper->ioctl(this, DrmIoctl::Query, &query);
550550
if (ret != 0 || queryItem.length <= 0) {
551551
return {};
552552
}
@@ -734,7 +734,7 @@ int Drm::waitHandle(uint32_t waitHandle, int64_t timeout) {
734734
wait.boHandle = waitHandle;
735735
wait.timeoutNs = timeout;
736736

737-
int ret = ioctl(DrmIoctl::GemWait, &wait);
737+
int ret = ioctlHelper->ioctl(this, DrmIoctl::GemWait, &wait);
738738
if (ret != 0) {
739739
int err = errno;
740740
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "ioctl(I915_GEM_WAIT) failed with %d. errno=%d(%s)\n", ret, err, strerror(err));
@@ -1178,7 +1178,7 @@ unsigned int Drm::bindDrmContext(uint32_t drmContextId, uint32_t deviceIndex, au
11781178
param.param = I915_CONTEXT_PARAM_ENGINES;
11791179
param.value = castToUint64(&contextEngines);
11801180

1181-
auto ioctlValue = ioctl(DrmIoctl::GemContextSetparam, &param);
1181+
auto ioctlValue = ioctlHelper->ioctl(this, DrmIoctl::GemContextSetparam, &param);
11821182
UNRECOVERABLE_IF(ioctlValue != 0);
11831183

11841184
retVal = static_cast<unsigned int>(ioctlHelper->getDrmParamValue(DrmParam::ExecDefault));

shared/test/common/os_interface/linux/device_command_stream_fixture.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,18 @@ class Ioctls {
6161
class DrmMockSuccess : public Drm {
6262
public:
6363
using Drm::setupIoctlHelper;
64-
DrmMockSuccess(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(fd, mockPciPath), rootDeviceEnvironment) {}
64+
DrmMockSuccess(int fd, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(fd, mockPciPath), rootDeviceEnvironment) {
65+
setupIoctlHelper(NEO::defaultHwInfo->platform.eProductFamily);
66+
}
6567

6668
int ioctl(DrmIoctl request, void *arg) override { return 0; };
6769
};
6870

6971
class DrmMockFail : public Drm {
7072
public:
71-
DrmMockFail(RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(mockFd, mockPciPath), rootDeviceEnvironment) {}
73+
DrmMockFail(RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(mockFd, mockPciPath), rootDeviceEnvironment) {
74+
setupIoctlHelper(NEO::defaultHwInfo->platform.eProductFamily);
75+
}
7276

7377
int ioctl(DrmIoctl request, void *arg) override { return -1; };
7478
};

0 commit comments

Comments
 (0)