Skip to content

Commit 06fa316

Browse files
Assign pat_index to BO during creation
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
1 parent 5911515 commit 06fa316

31 files changed

+376
-256
lines changed

level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ TEST_F(L0DebuggerLinuxTest, whenRegisterElfisCalledThenItRegistersBindExtHandles
140140
debugData.vIsa = "01234567890";
141141
debugData.vIsaSize = 10;
142142
MockDrmAllocation isaAllocation(AllocationType::KERNEL_ISA, MemoryPool::System4KBPages);
143-
MockBufferObject bo(drmMock, 0, 0, 1);
143+
MockBufferObject bo(drmMock, 3, 0, 0, 1);
144144
isaAllocation.bufferObjects[0] = &bo;
145145
device->getL0Debugger()->registerElf(&debugData, &isaAllocation);
146146

@@ -181,11 +181,11 @@ TEST_F(L0DebuggerLinuxTest, givenNoOSInterfaceThenRegisterElfDoesNothing) {
181181

182182
TEST_F(L0DebuggerLinuxTest, givenAllocationsWhenAttachingZebinModuleThenAllAllocationsHaveRegisteredHandle) {
183183
MockDrmAllocation isaAllocation(AllocationType::KERNEL_ISA, MemoryPool::System4KBPages);
184-
MockBufferObject bo(drmMock, 0, 0, 1);
184+
MockBufferObject bo(drmMock, 3, 0, 0, 1);
185185
isaAllocation.bufferObjects[0] = &bo;
186186

187187
MockDrmAllocation isaAllocation2(AllocationType::KERNEL_ISA, MemoryPool::System4KBPages);
188-
MockBufferObject bo2(drmMock, 0, 0, 1);
188+
MockBufferObject bo2(drmMock, 3, 0, 0, 1);
189189
isaAllocation2.bufferObjects[0] = &bo2;
190190

191191
uint32_t handle = 0;

opencl/test/unit_test/linux/main_linux_dll.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,12 +666,16 @@ TEST(AllocatorHelper, givenExpectedSizeToReserveWhenGetSizeToReserveCalledThenEx
666666
}
667667

668668
TEST(DrmMemoryManagerCreate, whenCallCreateMemoryManagerThenDrmMemoryManagerIsCreated) {
669+
DebugManagerStateRestore restorer;
670+
DebugManager.flags.OverridePatIndex.set(0);
671+
669672
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
670673
auto drm = new DrmMockSuccess(fakeFd, *executionEnvironment.rootDeviceEnvironments[0]);
671674

672675
drm->setupIoctlHelper(defaultHwInfo->platform.eProductFamily);
673676
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
674677
executionEnvironment.rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(drm));
678+
675679
auto drmMemoryManager = MemoryManager::createMemoryManager(executionEnvironment);
676680
EXPECT_NE(nullptr, drmMemoryManager.get());
677681
executionEnvironment.memoryManager = std::move(drmMemoryManager);
@@ -681,6 +685,7 @@ TEST(DrmMemoryManagerCreate, givenEnableHostPtrValidationSetToZeroWhenCreateDrmM
681685
DebugManagerStateRestore restorer;
682686
DebugManager.flags.EnableHostPtrValidation.set(0);
683687
DebugManager.flags.EnableGemCloseWorker.set(0);
688+
DebugManager.flags.OverridePatIndex.set(0);
684689

685690
VariableBackup<UltHwConfig> backup(&ultHwConfig);
686691
ultHwConfig.forceOsAgnosticMemoryManager = false;
@@ -691,6 +696,7 @@ TEST(DrmMemoryManagerCreate, givenEnableHostPtrValidationSetToZeroWhenCreateDrmM
691696
drm->setupIoctlHelper(defaultHwInfo->platform.eProductFamily);
692697
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
693698
executionEnvironment.rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(drm));
699+
694700
auto drmMemoryManager = MemoryManager::createMemoryManager(executionEnvironment);
695701
EXPECT_NE(nullptr, drmMemoryManager.get());
696702
EXPECT_FALSE(static_cast<DrmMemoryManager *>(drmMemoryManager.get())->isValidateHostMemoryEnabled());

opencl/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ TEST(DrmBufferObjectSimpleTest, givenInvalidBoWhenPinIsCalledThenErrorIsReturned
244244
TEST(DrmBufferObjectSimpleTest, givenBufferObjectWhenConstructedWithASizeThenTheSizeIsInitialized) {
245245
MockExecutionEnvironment executionEnvironment;
246246
std::unique_ptr<DrmMockCustom> drmMock(new DrmMockCustom(*executionEnvironment.rootDeviceEnvironments[0]));
247-
std::unique_ptr<BufferObject> bo(new BufferObject(drmMock.get(), 1, 0x1000, 1));
247+
std::unique_ptr<BufferObject> bo(new BufferObject(drmMock.get(), 3, 1, 0x1000, 1));
248248

249249
EXPECT_EQ(0x1000u, bo->peekSize());
250250
}
@@ -322,7 +322,7 @@ TEST_F(DrmBufferObjectTest, givenDeleterWhenBufferObjectIsCreatedAndDeletedThenC
322322
mock->ioctl_expected.reset();
323323

324324
{
325-
std::unique_ptr<BufferObject, BufferObject::Deleter> bo(new BufferObject(mock.get(), 1, 0x1000, 1));
325+
std::unique_ptr<BufferObject, BufferObject::Deleter> bo(new BufferObject(mock.get(), 3, 1, 0x1000, 1));
326326
}
327327

328328
EXPECT_EQ(1, mock->ioctl_cnt.gemClose);
@@ -337,7 +337,7 @@ TEST(DrmBufferObject, givenPerContextVmRequiredWhenBoCreatedThenBindInfoIsInitia
337337
DrmMock drm(*(device->getExecutionEnvironment()->rootDeviceEnvironments[0].get()));
338338
EXPECT_TRUE(drm.isPerContextVMRequired());
339339
auto osContextCount = device->getExecutionEnvironment()->memoryManager->getRegisteredEnginesCount();
340-
MockBufferObject bo(&drm, 0, 0, osContextCount);
340+
MockBufferObject bo(&drm, 3, 0, 0, osContextCount);
341341

342342
EXPECT_EQ(osContextCount, bo.bindInfo.size());
343343

@@ -364,7 +364,7 @@ TEST(DrmBufferObject, givenDrmIoctlReturnsErrorNotSupportedThenBufferObjectRetur
364364
std::unique_ptr<Device> device(MockDevice::createWithExecutionEnvironment<MockDevice>(defaultHwInfo.get(), executionEnvironment, 0));
365365

366366
auto osContextCount = device->getExecutionEnvironment()->memoryManager->getRegisteredEnginesCount();
367-
MockBufferObject bo(drm, 0, 0, osContextCount);
367+
MockBufferObject bo(drm, 3, 0, 0, osContextCount);
368368

369369
std::unique_ptr<OsContextLinux> osContext;
370370
osContext.reset(new OsContextLinux(*drm, 0u, EngineDescriptorHelper::getDefaultDescriptor()));
@@ -391,7 +391,7 @@ TEST(DrmBufferObject, givenPerContextVmRequiredWhenBoBoundAndUnboundThenCorrectB
391391
std::unique_ptr<Device> device(MockDevice::createWithExecutionEnvironment<MockDevice>(defaultHwInfo.get(), executionEnvironment, 0));
392392

393393
auto osContextCount = device->getExecutionEnvironment()->memoryManager->getRegisteredEnginesCount();
394-
MockBufferObject bo(drm, 0, 0, osContextCount);
394+
MockBufferObject bo(drm, 3, 0, 0, osContextCount);
395395

396396
EXPECT_EQ(osContextCount, bo.bindInfo.size());
397397

@@ -432,7 +432,7 @@ TEST(DrmBufferObject, givenPrintBOBindingResultWhenBOBindAndUnbindSucceedsThenPr
432432
std::unique_ptr<Device> device(MockDevice::createWithExecutionEnvironment<MockDevice>(defaultHwInfo.get(), executionEnvironment, 0));
433433

434434
auto osContextCount = device->getExecutionEnvironment()->memoryManager->getRegisteredEnginesCount();
435-
MockBufferObject bo(drm, 0, 0, osContextCount);
435+
MockBufferObject bo(drm, 3, 0, 0, osContextCount);
436436

437437
EXPECT_EQ(osContextCount, bo.bindInfo.size());
438438

@@ -484,7 +484,7 @@ TEST(DrmBufferObject, givenPrintBOBindingResultWhenBOBindAndUnbindFailsThenPrint
484484
std::unique_ptr<Device> device(MockDevice::createWithExecutionEnvironment<MockDevice>(defaultHwInfo.get(), executionEnvironment, 0));
485485

486486
auto osContextCount = device->getExecutionEnvironment()->memoryManager->getRegisteredEnginesCount();
487-
MockBufferObject bo(drm, 0, 0, osContextCount);
487+
MockBufferObject bo(drm, 3, 0, 0, osContextCount);
488488

489489
EXPECT_EQ(osContextCount, bo.bindInfo.size());
490490

@@ -515,7 +515,7 @@ TEST(DrmBufferObject, whenBindExtHandleAddedThenItIsStored) {
515515
executionEnvironment->prepareRootDeviceEnvironments(1);
516516
DrmMockResources drm(*executionEnvironment->rootDeviceEnvironments[0]);
517517

518-
MockBufferObject bo(&drm, 0, 0, 1);
518+
MockBufferObject bo(&drm, 3, 0, 0, 1);
519519
bo.addBindExtHandle(4);
520520

521521
EXPECT_EQ(1u, bo.bindExtHandles.size());
@@ -530,7 +530,7 @@ TEST(DrmBufferObject, whenMarkForCapturedCalledThenIsMarkedForCaptureReturnsTrue
530530
executionEnvironment->prepareRootDeviceEnvironments(1);
531531
DrmMockResources drm(*executionEnvironment->rootDeviceEnvironments[0]);
532532

533-
MockBufferObject bo(&drm, 0, 0, 1);
533+
MockBufferObject bo(&drm, 3, 0, 0, 1);
534534
EXPECT_FALSE(bo.isMarkedForCapture());
535535

536536
bo.markForCapture();
@@ -570,21 +570,21 @@ TEST_F(DrmBufferObjectTest, given47bitAddressWhenSetThenIsAddressNotCanonized) {
570570

571571
uint64_t address = maxNBitValue(47) - maxNBitValue(5);
572572

573-
MockBufferObject bo(&drm, 0, 0, 1);
573+
MockBufferObject bo(&drm, 3, 0, 0, 1);
574574
bo.setAddress(address);
575575
auto boAddress = bo.peekAddress();
576576
EXPECT_EQ(boAddress, address);
577577
}
578578
TEST_F(DrmBufferObjectTest, given48bitAddressWhenSetThenAddressIsCanonized) {
579-
VariableBackup<uint32_t> backup(&MockGmmHelper::addressWidth, 48);
580-
581579
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
582580
DrmMock drm(*(executionEnvironment.rootDeviceEnvironments[0].get()));
583581

582+
VariableBackup<uint32_t> backup(&MockGmmHelper::addressWidth, 48);
583+
584584
uint64_t address = maxNBitValue(48) - maxNBitValue(5);
585585
uint64_t expectedAddress = std::numeric_limits<uint64_t>::max() - maxNBitValue(5);
586586

587-
MockBufferObject bo(&drm, 0, 0, 1);
587+
MockBufferObject bo(&drm, 3, 0, 0, 1);
588588
bo.setAddress(address);
589589
auto boAddress = bo.peekAddress();
590590
EXPECT_EQ(boAddress, expectedAddress);
@@ -596,15 +596,15 @@ TEST_F(DrmBufferObjectTest, givenBoIsCreatedWhenPageFaultIsSupportedThenExplicit
596596

597597
for (auto isPageFaultSupported : {false, true}) {
598598
drm.pageFaultSupported = isPageFaultSupported;
599-
MockBufferObject bo(&drm, 0, 0, 1);
599+
MockBufferObject bo(&drm, 3, 0, 0, 1);
600600
EXPECT_EQ(isPageFaultSupported, bo.isExplicitResidencyRequired());
601601
}
602602
}
603603

604604
TEST_F(DrmBufferObjectTest, whenBoRequiresExplicitResidencyThenTheCorrespondingQueryReturnsCorrectValue) {
605605
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
606606
DrmMock drm(*(executionEnvironment.rootDeviceEnvironments[0].get()));
607-
MockBufferObject bo(&drm, 0, 0, 1);
607+
MockBufferObject bo(&drm, 3, 0, 0, 1);
608608

609609
for (auto required : {false, true}) {
610610
bo.requireExplicitResidency(required);

opencl/test/unit_test/os_interface/linux/drm_command_stream_mm_tests.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ HWTEST_F(DrmCommandStreamMMTest, GivenForcePinThenMemoryManagerCreatesPinBb) {
4545
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
4646
executionEnvironment.rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(drm));
4747
executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drm, 0u);
48+
executionEnvironment.rootDeviceEnvironments[0]->initGmm();
4849

4950
DrmCommandStreamReceiver<FamilyType> csr(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive);
5051

@@ -64,6 +65,7 @@ HWTEST_F(DrmCommandStreamMMTest, givenForcePinDisabledWhenMemoryManagerIsCreated
6465

6566
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
6667
executionEnvironment.rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(drm));
68+
executionEnvironment.rootDeviceEnvironments[0]->initGmm();
6769

6870
DrmCommandStreamReceiver<FamilyType> csr(executionEnvironment, 0, 1, gemCloseWorkerMode::gemCloseWorkerInactive);
6971
auto memoryManager = new TestedDrmMemoryManager(false, true, false, executionEnvironment);
@@ -83,6 +85,7 @@ HWTEST_F(DrmCommandStreamMMTest, givenExecutionEnvironmentWithMoreThanOneRootDev
8385
auto drm = new DrmMockCustom(*executionEnvironment.rootDeviceEnvironments[0]);
8486
executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(drm));
8587
executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drm, 0u);
88+
executionEnvironment.rootDeviceEnvironments[0]->initGmm();
8689
}
8790

8891
auto memoryManager = new TestedDrmMemoryManager(false, true, false, executionEnvironment);

opencl/test/unit_test/os_interface/linux/drm_command_stream_xehp_and_later_prelim_tests.cpp

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ class DrmCommandStreamForceTileTest : public ::testing::Test {
292292
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
293293
executionEnvironment.rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(mock));
294294
executionEnvironment.rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*mock, 0u);
295+
executionEnvironment.rootDeviceEnvironments[0]->initGmm();
295296

296297
mock->createVirtualMemoryAddressSpace(HwHelper::getSubDevicesCount(hwInfo));
297298
osContext = std::make_unique<OsContextLinux>(*mock, rootDeviceIndex,
@@ -401,9 +402,11 @@ struct DrmImplicitScalingCommandStreamTest : ::testing::Test {
401402
drm = new DrmMock(mockFd, *executionEnvironment->rootDeviceEnvironments[0]);
402403
drm->setupIoctlHelper(hwInfo->platform.eProductFamily);
403404
drm->createVirtualMemoryAddressSpace(HwHelper::getSubDevicesCount(hwInfo.get()));
405+
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(hwInfo.get());
404406
executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
405407
executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<DriverModel>(drm));
406408
executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drm, 0u);
409+
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
407410

408411
osContext = std::make_unique<OsContextLinux>(*drm, 0u,
409412
EngineDescriptorHelper::getDefaultDescriptor(HwHelper::get(hwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0],
@@ -439,15 +442,15 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenTwoTilesW
439442
auto csr = createCsr<FamilyType>();
440443

441444
auto size = 1024u;
442-
auto multiStorageBo0 = new BufferObject(drm, 30, 0, 1);
443-
auto multiStorageBo1 = new BufferObject(drm, 31, 0, 1);
445+
auto multiStorageBo0 = new BufferObject(drm, 3, 30, 0, 1);
446+
auto multiStorageBo1 = new BufferObject(drm, 3, 31, 0, 1);
444447
BufferObjects multiStorageBos{multiStorageBo0, multiStorageBo1};
445448
auto multiStorageAllocation = new DrmAllocation(0, AllocationType::UNKNOWN, multiStorageBos, nullptr, 0u, size, MemoryPool::LocalMemory);
446449
multiStorageAllocation->storageInfo.memoryBanks = 0b11;
447450
csr->CommandStreamReceiver::makeResident(*multiStorageAllocation);
448451

449-
auto tileInstancedBo0 = new BufferObject(drm, 40, 0, 1);
450-
auto tileInstancedBo1 = new BufferObject(drm, 41, 0, 1);
452+
auto tileInstancedBo0 = new BufferObject(drm, 3, 40, 0, 1);
453+
auto tileInstancedBo1 = new BufferObject(drm, 3, 41, 0, 1);
451454
BufferObjects tileInstancedBos{tileInstancedBo0, tileInstancedBo1};
452455
auto tileInstancedAllocation = new DrmAllocation(0, AllocationType::UNKNOWN, tileInstancedBos, nullptr, 0u, size, MemoryPool::LocalMemory);
453456
tileInstancedAllocation->storageInfo.memoryBanks = 0b11;
@@ -510,10 +513,10 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, whenForceExecu
510513
gemCloseWorkerMode::gemCloseWorkerActive);
511514
csr->setupContext(*osContext);
512515

513-
auto tileInstancedBo0 = new BufferObject(drm, 40, 0, 1);
514-
auto tileInstancedBo1 = new BufferObject(drm, 41, 0, 1);
515-
auto tileInstancedBo2 = new BufferObject(drm, 42, 0, 1);
516-
auto tileInstancedBo3 = new BufferObject(drm, 43, 0, 1);
516+
auto tileInstancedBo0 = new BufferObject(drm, 3, 40, 0, 1);
517+
auto tileInstancedBo1 = new BufferObject(drm, 3, 41, 0, 1);
518+
auto tileInstancedBo2 = new BufferObject(drm, 3, 42, 0, 1);
519+
auto tileInstancedBo3 = new BufferObject(drm, 3, 43, 0, 1);
517520
BufferObjects tileInstancedBos{tileInstancedBo0, tileInstancedBo1, tileInstancedBo2, tileInstancedBo3};
518521
auto tileInstancedAllocation = new DrmAllocation(0, AllocationType::UNKNOWN, tileInstancedBos, nullptr, 0u, 1024u, MemoryPool::LocalMemory);
519522
tileInstancedAllocation->storageInfo.memoryBanks = 0b11;
@@ -553,10 +556,10 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, whenForceExecu
553556
gemCloseWorkerMode::gemCloseWorkerActive);
554557
csr->setupContext(*osContext);
555558

556-
auto tileInstancedBo0 = new BufferObject(drm, 40, 0, 1);
557-
auto tileInstancedBo1 = new BufferObject(drm, 41, 0, 1);
558-
auto tileInstancedBo2 = new BufferObject(drm, 42, 0, 1);
559-
auto tileInstancedBo3 = new BufferObject(drm, 43, 0, 1);
559+
auto tileInstancedBo0 = new BufferObject(drm, 3, 40, 0, 1);
560+
auto tileInstancedBo1 = new BufferObject(drm, 3, 41, 0, 1);
561+
auto tileInstancedBo2 = new BufferObject(drm, 3, 42, 0, 1);
562+
auto tileInstancedBo3 = new BufferObject(drm, 3, 43, 0, 1);
560563
BufferObjects tileInstancedBos{tileInstancedBo0, tileInstancedBo1, tileInstancedBo2, tileInstancedBo3};
561564
auto tileInstancedAllocation = new DrmAllocation(0, AllocationType::UNKNOWN, tileInstancedBos, nullptr, 0u, 1024u, MemoryPool::LocalMemory);
562565
tileInstancedAllocation->storageInfo.memoryBanks = 0b11;
@@ -598,7 +601,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenUseSingle
598601
csr->setupContext(*osContext);
599602

600603
const auto size = 1024u;
601-
BufferObject *bufferObject = new BufferObject(drm, 30, 0, 1);
604+
BufferObject *bufferObject = new BufferObject(drm, 3, 30, 0, 1);
602605
BufferObjects bufferObjects{bufferObject};
603606
auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, bufferObjects, nullptr, 0u, size, MemoryPool::LocalMemory);
604607
csr->CommandStreamReceiver::makeResident(*allocation);
@@ -638,7 +641,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenDisabledI
638641
csr->setupContext(*osContext);
639642

640643
const auto size = 1024u;
641-
BufferObject *bufferObject = new BufferObject(drm, 30, 0, 1);
644+
BufferObject *bufferObject = new BufferObject(drm, 3, 30, 0, 1);
642645
BufferObjects bufferObjects{bufferObject};
643646
auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, bufferObjects, nullptr, 0u, size, MemoryPool::LocalMemory);
644647
csr->CommandStreamReceiver::makeResident(*allocation);
@@ -671,7 +674,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DrmImplicitScalingCommandStreamTest, givenMultiTile
671674
csr->setupContext(*osContext);
672675

673676
const auto size = 1024u;
674-
BufferObject *bufferObject = new BufferObject(drm, 30, 0, 1);
677+
BufferObject *bufferObject = new BufferObject(drm, 3, 30, 0, 1);
675678
BufferObjects bufferObjects{bufferObject};
676679
auto allocation = new DrmAllocation(0, AllocationType::UNKNOWN, bufferObjects, nullptr, 0u, size, MemoryPool::LocalMemory);
677680
csr->CommandStreamReceiver::makeResident(*allocation);

opencl/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ TEST_F(DrmGemCloseWorkerTests, WhenClosingGemThenSucceeds) {
108108
this->drmMock->gem_close_expected = 1;
109109

110110
auto worker = new DrmGemCloseWorker(*mm);
111-
auto bo = new BufferObject(this->drmMock, 1, 0, 1);
111+
auto bo = new BufferObject(this->drmMock, 3, 1, 0, 1);
112112

113113
worker->push(bo);
114114

@@ -119,7 +119,7 @@ TEST_F(DrmGemCloseWorkerTests, GivenMultipleThreadsWhenClosingGemThenSucceeds) {
119119
this->drmMock->gem_close_expected = -1;
120120

121121
auto worker = new DrmGemCloseWorker(*mm);
122-
auto bo = new BufferObject(this->drmMock, 1, 0, 1);
122+
auto bo = new BufferObject(this->drmMock, 3, 1, 0, 1);
123123

124124
worker->push(bo);
125125

@@ -139,7 +139,7 @@ TEST_F(DrmGemCloseWorkerTests, GivenMultipleThreadsAndCloseFalseWhenClosingGemTh
139139
this->drmMock->gem_close_expected = -1;
140140

141141
auto worker = new DrmGemCloseWorker(*mm);
142-
auto bo = new BufferObject(this->drmMock, 1, 0, 1);
142+
auto bo = new BufferObject(this->drmMock, 3, 1, 0, 1);
143143

144144
worker->push(bo);
145145
worker->close(false);
@@ -157,7 +157,7 @@ TEST_F(DrmGemCloseWorkerTests, givenAllocationWhenAskedForUnreferenceWithForceFl
157157
this->drmMock->gem_close_expected = 1;
158158

159159
auto worker = new DrmGemCloseWorker(*mm);
160-
auto bo = new BufferObject(this->drmMock, 1, 0, 1);
160+
auto bo = new BufferObject(this->drmMock, 3, 1, 0, 1);
161161

162162
bo->reference();
163163
worker->push(bo);

0 commit comments

Comments
 (0)