Skip to content

Commit b33473e

Browse files
ULT renaming: DRM tests
Related-To: NEO-2236 Signed-off-by: Adam Cetnerowski <adam.cetnerowski@intel.com>
1 parent 4bad959 commit b33473e

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ using namespace NEO;
2323
class DrmCommandStreamMMTest : public ::testing::Test {
2424
};
2525

26-
HWTEST_F(DrmCommandStreamMMTest, MMwithPinBB) {
26+
HWTEST_F(DrmCommandStreamMMTest, GivenForcePinThenMemoryManagerCreatesPinBb) {
2727
DebugManagerStateRestore dbgRestorer;
2828
DebugManager.flags.EnableForcePin.set(true);
2929

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

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenFlushStampWhenWaitCalledThenWaitFo
6464
EXPECT_TRUE(memcmp(&expectedWait, &calledWait, sizeof(drm_i915_gem_wait)) == 0);
6565
}
6666

67-
HWTEST_TEMPLATED_F(DrmCommandStreamTest, makeResident) {
67+
HWTEST_TEMPLATED_F(DrmCommandStreamTest, WhenMakingResidentThenSucceeds) {
6868
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_USERPTR, ::testing::_))
6969
.Times(0);
7070
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_EXECBUFFER2, ::testing::_))
@@ -77,7 +77,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, makeResident) {
7777
csr->makeResident(graphicsAllocation);
7878
}
7979

80-
HWTEST_TEMPLATED_F(DrmCommandStreamTest, makeResidentTwiceTheSame) {
80+
HWTEST_TEMPLATED_F(DrmCommandStreamTest, WhenMakingResidentTwiceThenSucceeds) {
8181
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_USERPTR, ::testing::_))
8282
.Times(0);
8383
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_EXECBUFFER2, ::testing::_))
@@ -93,7 +93,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, makeResidentTwiceTheSame) {
9393
csr->makeResident(graphicsAllocation);
9494
}
9595

96-
HWTEST_TEMPLATED_F(DrmCommandStreamTest, makeResidentSizeZero) {
96+
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenSizeZeroWhenMakingResidentTwiceThenSucceeds) {
9797
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_USERPTR, ::testing::_))
9898
.Times(0);
9999
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_EXECBUFFER2, ::testing::_))
@@ -108,7 +108,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, makeResidentSizeZero) {
108108
csr->makeResident(graphicsAllocation);
109109
}
110110

111-
HWTEST_TEMPLATED_F(DrmCommandStreamTest, makeResidentResized) {
111+
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenResizedWhenMakingResidentTwiceThenSucceeds) {
112112
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_USERPTR, ::testing::_))
113113
.Times(0);
114114
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_EXECBUFFER2, ::testing::_))
@@ -147,7 +147,7 @@ MATCHER_P2(BoExecFlushContextEq, drmContextId, numExecs, "") {
147147
return allExecsWithTheSameId;
148148
}
149149

150-
HWTEST_TEMPLATED_F(DrmCommandStreamTest, Flush) {
150+
HWTEST_TEMPLATED_F(DrmCommandStreamTest, WhenFlushingThenAvailableSpaceDoesNotChange) {
151151
auto expectedSize = alignUp(8u, MemoryConstants::cacheLineSize); // bbEnd
152152
int boHandle = 123;
153153
auto setBoHandle = [&](unsigned long request, void *arg) {
@@ -249,7 +249,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDrmContextIdWhenFlushingThenSetIdT
249249
memoryManager->freeGraphicsMemory(allocation2);
250250
}
251251

252-
HWTEST_TEMPLATED_F(DrmCommandStreamTest, FlushWithLowPriorityContext) {
252+
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenLowPriorityContextWhenFlushingThenSucceeds) {
253253
auto expectedSize = alignUp(8u, MemoryConstants::cacheLineSize); // bbEnd
254254

255255
::testing::InSequence inSequence;
@@ -282,7 +282,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, FlushWithLowPriorityContext) {
282282
EXPECT_NE(cs.getCpuBase(), nullptr);
283283
}
284284

285-
HWTEST_TEMPLATED_F(DrmCommandStreamTest, FlushInvalidAddress) {
285+
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenInvalidAddressWhenFlushingThenSucceeds) {
286286
::testing::InSequence inSequence;
287287

288288
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_USERPTR, ::testing::_))
@@ -311,7 +311,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, FlushInvalidAddress) {
311311
delete[] commandBuffer;
312312
}
313313

314-
HWTEST_TEMPLATED_F(DrmCommandStreamTest, FlushNotEmptyBB) {
314+
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenNotEmptyBbWhenFlushingThenSucceeds) {
315315
uint32_t bbUsed = 16 * sizeof(uint32_t);
316316
auto expectedSize = alignUp(bbUsed + 8, MemoryConstants::cacheLineSize); // bbUsed + bbEnd
317317

@@ -341,7 +341,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, FlushNotEmptyBB) {
341341
csr->flush(batchBuffer, csr->getResidencyAllocations());
342342
}
343343

344-
HWTEST_TEMPLATED_F(DrmCommandStreamTest, FlushNotEmptyNotPaddedBB) {
344+
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenNotEmptyNotPaddedBbWhenFlushingThenSucceeds) {
345345
uint32_t bbUsed = 15 * sizeof(uint32_t);
346346

347347
::testing::InSequence inSequence;
@@ -370,7 +370,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, FlushNotEmptyNotPaddedBB) {
370370
csr->flush(batchBuffer, csr->getResidencyAllocations());
371371
}
372372

373-
HWTEST_TEMPLATED_F(DrmCommandStreamTest, FlushNotAligned) {
373+
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenNotAlignedWhenFlushingThenSucceeds) {
374374
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_USERPTR, ::testing::_))
375375
.Times(1)
376376
.WillRepeatedly(::testing::Return(0));
@@ -423,7 +423,7 @@ MATCHER(BoExecFlushCheckFlags, "") {
423423
return true;
424424
}
425425

426-
HWTEST_TEMPLATED_F(DrmCommandStreamTest, FlushCheckFlags) {
426+
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenCheckFlagsWhenFlushingThenSucceeds) {
427427
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_USERPTR, ::testing::_))
428428
.WillRepeatedly(::testing::Return(0));
429429
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_GEM_CLOSE, ::testing::_))
@@ -449,7 +449,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, FlushCheckFlags) {
449449
csr->flush(batchBuffer, csr->getResidencyAllocations());
450450
}
451451

452-
HWTEST_TEMPLATED_F(DrmCommandStreamTest, CheckDrmFree) {
452+
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenCheckDrmFreeWhenFlushingThenSucceeds) {
453453
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_USERPTR, ::testing::_))
454454
.Times(1)
455455
.WillOnce(::testing::DoAll(UserptrSetHandle(17), ::testing::Return(0)));
@@ -482,15 +482,15 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, CheckDrmFree) {
482482
csr->flush(batchBuffer, csr->getResidencyAllocations());
483483
}
484484

485-
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GIVENCSRWHENgetDMTHENNotNull) {
485+
HWTEST_TEMPLATED_F(DrmCommandStreamTest, WhenGettingDrmThenNonNullPointerIsReturned) {
486486
Drm *pDrm = nullptr;
487487
if (csr->getOSInterface()) {
488488
pDrm = csr->getOSInterface()->getDriverModel()->as<Drm>();
489489
}
490490
ASSERT_NE(nullptr, pDrm);
491491
}
492492

493-
HWTEST_TEMPLATED_F(DrmCommandStreamTest, CheckDrmFreeCloseFailed) {
493+
HWTEST_TEMPLATED_F(DrmCommandStreamTest, GivenCheckDrmFreeCloseFailedWhenFlushingThenSucceeds) {
494494
EXPECT_CALL(*mock, ioctl(DRM_IOCTL_I915_GEM_USERPTR, ::testing::_))
495495
.Times(1)
496496
.WillOnce(::testing::DoAll(UserptrSetHandle(17), ::testing::Return(0)));
@@ -672,7 +672,7 @@ class DrmCommandStreamBatchingTests : public DrmCommandStreamEnhancedTest {
672672
}
673673
};
674674

675-
HWTEST_TEMPLATED_F(DrmCommandStreamBatchingTests, givenCSRWhenFlushIsCalledThenProperFlagsArePassed) {
675+
HWTEST_TEMPLATED_F(DrmCommandStreamBatchingTests, givenCsrWhenFlushIsCalledThenProperFlagsArePassed) {
676676
mock->reset();
677677
auto commandBuffer = mm->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize});
678678
auto dummyAllocation = mm->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize});
@@ -864,7 +864,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDrmAllocationWhenGetBuffer
864864
mm->freeGraphicsMemory(allocation);
865865
}
866866

867-
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, makeResident) {
867+
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, WhenMakingResidentThenSucceeds) {
868868
auto buffer = this->createBO(1024);
869869
auto allocation = new DrmAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, buffer, nullptr, buffer->peekSize(), (osHandle)0u, MemoryPool::MemoryNull);
870870
EXPECT_EQ(nullptr, allocation->getUnderlyingBuffer());
@@ -881,7 +881,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, makeResident) {
881881
mm->freeGraphicsMemory(allocation);
882882
}
883883

884-
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, makeResidentOnly) {
884+
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenMultipleAllocationsWhenMakingResidentThenEachSucceeds) {
885885
BufferObject *buffer1 = this->createBO(4096);
886886
BufferObject *buffer2 = this->createBO(4096);
887887
auto allocation1 = new DrmAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, buffer1, nullptr, buffer1->peekSize(), (osHandle)0u, MemoryPool::MemoryNull);
@@ -906,7 +906,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, makeResidentOnly) {
906906
mm->freeGraphicsMemory(allocation2);
907907
}
908908

909-
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, makeResidentTwice) {
909+
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, WhenMakingResidentTwiceThenRefCountIsOne) {
910910
auto buffer = this->createBO(1024);
911911
auto allocation = new DrmAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, buffer, nullptr, buffer->peekSize(), (osHandle)0u, MemoryPool::MemoryNull);
912912

@@ -929,7 +929,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, makeResidentTwice) {
929929
mm->freeGraphicsMemory(allocation);
930930
}
931931

932-
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, makeResidentTwiceWhenFragmentStorage) {
932+
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenFragmentStorageWhenMakingResidentTwiceThenRefCountIsOne) {
933933
auto ptr = (void *)0x1001;
934934
auto size = MemoryConstants::pageSize * 10;
935935
auto reqs = MockHostPtrManager::getAllocationRequirements(csr->getRootDeviceIndex(), ptr, size);
@@ -1132,7 +1132,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenTwoAllocationsWhenBackingS
11321132
csr->getResidencyAllocations().clear();
11331133
}
11341134

1135-
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, Flush) {
1135+
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, WhenFlushingThenSucceeds) {
11361136
auto &cs = csr->getCS();
11371137
auto commandBuffer = static_cast<DrmAllocation *>(cs.getGraphicsAllocation());
11381138
ASSERT_EQ(0u, reinterpret_cast<uintptr_t>(commandBuffer->getUnderlyingBuffer()) & 0xFFF);
@@ -1145,7 +1145,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, Flush) {
11451145
EXPECT_NE(cs.getGraphicsAllocation(), nullptr);
11461146
}
11471147

1148-
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, ClearResidencyWhenFlushNotCalled) {
1148+
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, WhenFlushNotCalledThenClearResidency) {
11491149
auto allocation1 = static_cast<DrmAllocation *>(mm->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize}));
11501150
auto allocation2 = static_cast<DrmAllocation *>(mm->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize}));
11511151
ASSERT_NE(nullptr, allocation1);
@@ -1220,7 +1220,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenPrintBOsForSubmitWhenPrint
12201220
mm->freeGraphicsMemory(buffer);
12211221
}
12221222

1223-
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, FlushMultipleTimes) {
1223+
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenFlushMultipleTimesThenSucceeds) {
12241224
auto &cs = csr->getCS();
12251225
auto commandBuffer = static_cast<DrmAllocation *>(cs.getGraphicsAllocation());
12261226

@@ -1269,7 +1269,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, FlushMultipleTimes) {
12691269
csr->flush(batchBuffer4, csr->getResidencyAllocations());
12701270
}
12711271

1272-
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, FlushNotEmptyBB) {
1272+
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenNotEmptyBbWhenFlushingThenSucceeds) {
12731273
int bbUsed = 16 * sizeof(uint32_t);
12741274

12751275
auto &cs = csr->getCS();
@@ -1282,7 +1282,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, FlushNotEmptyBB) {
12821282
csr->flush(batchBuffer, csr->getResidencyAllocations());
12831283
}
12841284

1285-
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, FlushNotEmptyNotPaddedBB) {
1285+
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenNotEmptyNotPaddedBbWhenFlushingThenSucceeds) {
12861286
int bbUsed = 15 * sizeof(uint32_t);
12871287

12881288
auto &cs = csr->getCS();
@@ -1295,7 +1295,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, FlushNotEmptyNotPaddedBB) {
12951295
csr->flush(batchBuffer, csr->getResidencyAllocations());
12961296
}
12971297

1298-
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, FlushNotAligned) {
1298+
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenNotAlignedWhenFlushingThenSucceeds) {
12991299
auto &cs = csr->getCS();
13001300
auto commandBuffer = static_cast<DrmAllocation *>(cs.getGraphicsAllocation());
13011301

@@ -1442,7 +1442,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamBlitterDirectSubmissionTest, givenEnabledDire
14421442
EXPECT_EQ(nullptr, static_cast<TestedDrmCommandStreamReceiver<FamilyType> *>(csr)->directSubmission.get());
14431443
}
14441444

1445-
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, CheckDrmFree) {
1445+
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenCheckDrmFreeWhenFlushingThenSucceeds) {
14461446
auto &cs = csr->getCS();
14471447
auto commandBuffer = static_cast<DrmAllocation *>(cs.getGraphicsAllocation());
14481448

@@ -1461,7 +1461,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, CheckDrmFree) {
14611461
mm->freeGraphicsMemory(allocation);
14621462
}
14631463

1464-
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, MakeResidentClearResidencyAllocationsInCommandStreamReceiver) {
1464+
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, WhenMakingResidentThenClearResidencyAllocationsInCommandStreamReceiver) {
14651465
auto allocation1 = mm->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize});
14661466
auto allocation2 = mm->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize});
14671467

@@ -1499,7 +1499,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenMultipleMakeResidentWhenMa
14991499
mm->freeGraphicsMemory(allocation1);
15001500
}
15011501

1502-
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, makeNonResidentOnMemObjectCallsDrmCSMakeNonResidentWithGraphicsAllocation) {
1502+
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenMemObjectCallsDrmCsrWhenMakingNonResidentThenMakeNonResidentWithGraphicsAllocation) {
15031503
auto allocation1 = mm->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), 0x1000});
15041504
ASSERT_NE(nullptr, allocation1);
15051505

@@ -1550,7 +1550,7 @@ class DrmMockBuffer : public MockBufferStorage, public Buffer {
15501550
DrmAllocation *gfxAllocation;
15511551
};
15521552

1553-
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, BufferResidency) {
1553+
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenMultipleResidencyRequestsWhenMakingNonResidentThenAllocationIsNotResident) {
15541554
std::unique_ptr<Buffer> buffer(DrmMockBuffer::create());
15551555

15561556
auto osContextId = csr->getOsContext().getContextId();
@@ -1596,7 +1596,7 @@ struct MockDrmCsr : public DrmCommandStreamReceiver<GfxFamily> {
15961596
using DrmCommandStreamReceiver<GfxFamily>::dispatchMode;
15971597
};
15981598

1599-
HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDrmCommandStreamReceiverWhenCreatePageTableMngrIsCalledThenCreatePageTableManager) {
1599+
HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDrmCommandStreamReceiverWhenCreatePageTableManagerIsCalledThenCreatePageTableManager) {
16001600
executionEnvironment.prepareRootDeviceEnvironments(2);
16011601
executionEnvironment.rootDeviceEnvironments[1]->setHwInfo(defaultHwInfo.get());
16021602
executionEnvironment.rootDeviceEnvironments[1]->initGmm();

0 commit comments

Comments
 (0)