mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Remove handleId from DrmCommandStreamReceiver
pass it as a function argument Resolves: NEO-3856 Change-Id: I796ca1236ead97d179aefa0684c1234452c94744 Signed-off-by: Jablonski, Mateusz <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
124a598677
commit
5de70b9416
@@ -122,7 +122,7 @@ class DrmCommandStreamEnhancedTest : public ::testing::Test {
|
||||
|
||||
template <typename GfxFamily>
|
||||
void makeResidentBufferObjects(const DrmAllocation *drmAllocation) {
|
||||
static_cast<TestedDrmCommandStreamReceiver<GfxFamily> *>(csr)->makeResidentBufferObjects(drmAllocation);
|
||||
static_cast<TestedDrmCommandStreamReceiver<GfxFamily> *>(csr)->makeResidentBufferObjects(drmAllocation, 0u);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
@@ -565,7 +565,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenGemCloseWorkerInactiveMode
|
||||
csr->makeResident(*dummyAllocation);
|
||||
EXPECT_EQ(1u, bo->getRefCount());
|
||||
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
|
||||
csr->makeNonResident(*dummyAllocation);
|
||||
EXPECT_EQ(1u, bo->getRefCount());
|
||||
@@ -585,7 +585,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenTwoAllocationsWhenBackingS
|
||||
EXPECT_TRUE(allocation->isResident(osContextId));
|
||||
EXPECT_TRUE(allocation2->isResident(osContextId));
|
||||
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
|
||||
EXPECT_TRUE(allocation->isResident(osContextId));
|
||||
EXPECT_TRUE(allocation2->isResident(osContextId));
|
||||
@@ -840,7 +840,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, makeResident) {
|
||||
EXPECT_EQ(nullptr, allocation->getUnderlyingBuffer());
|
||||
|
||||
csr->makeResident(*allocation);
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
|
||||
EXPECT_TRUE(isResident<FamilyType>(buffer));
|
||||
EXPECT_EQ(1u, buffer->getRefCount());
|
||||
@@ -861,7 +861,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, makeResidentOnly) {
|
||||
|
||||
csr->makeResident(*allocation1);
|
||||
csr->makeResident(*allocation2);
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
|
||||
EXPECT_TRUE(isResident<FamilyType>(buffer1));
|
||||
EXPECT_TRUE(isResident<FamilyType>(buffer2));
|
||||
@@ -881,14 +881,14 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, makeResidentTwice) {
|
||||
auto allocation = new DrmAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, buffer, nullptr, buffer->peekSize(), (osHandle)0u, MemoryPool::MemoryNull);
|
||||
|
||||
csr->makeResident(*allocation);
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
|
||||
EXPECT_TRUE(isResident<FamilyType>(buffer));
|
||||
EXPECT_EQ(1u, buffer->getRefCount());
|
||||
|
||||
csr->getResidencyAllocations().clear();
|
||||
csr->makeResident(*allocation);
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
|
||||
EXPECT_TRUE(isResident<FamilyType>(buffer));
|
||||
EXPECT_EQ(1u, buffer->getRefCount());
|
||||
@@ -910,7 +910,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, makeResidentTwiceWhenFragmentSt
|
||||
csr->makeResident(*allocation);
|
||||
csr->makeResident(*allocation);
|
||||
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
for (int i = 0; i < maxFragmentsCount; i++) {
|
||||
ASSERT_EQ(allocation->fragmentsStorage.fragmentStorageData[i].cpuPtr,
|
||||
reqs.allocationFragments[i].allocationPtr);
|
||||
@@ -946,7 +946,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenFragmentedAllocationsWithR
|
||||
csr->makeResident(*graphicsAllocation);
|
||||
csr->makeResident(*graphicsAllocation2);
|
||||
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
|
||||
auto &osContext = csr->getOsContext();
|
||||
|
||||
@@ -972,7 +972,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenFragmentedAllocationsWithR
|
||||
csr->makeResident(*graphicsAllocation);
|
||||
csr->makeResident(*graphicsAllocation2);
|
||||
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
|
||||
EXPECT_TRUE(graphicsAllocation->fragmentsStorage.fragmentStorageData[0].residency->resident[osContext.getContextId()]);
|
||||
EXPECT_TRUE(graphicsAllocation->fragmentsStorage.fragmentStorageData[1].residency->resident[osContext.getContextId()]);
|
||||
@@ -1005,7 +1005,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenAllocationCreatedFromThree
|
||||
ASSERT_EQ(3u, allocation->fragmentsStorage.fragmentCount);
|
||||
|
||||
csr->makeResident(*allocation);
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
|
||||
for (int i = 0; i < maxFragmentsCount; i++) {
|
||||
ASSERT_EQ(allocation->fragmentsStorage.fragmentStorageData[i].cpuPtr,
|
||||
@@ -1036,7 +1036,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenAllocationsContainingDiffe
|
||||
ASSERT_EQ(2u, reqs.requiredFragmentsCount);
|
||||
|
||||
csr->makeResident(*allocation);
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
|
||||
for (unsigned int i = 0; i < reqs.requiredFragmentsCount; i++) {
|
||||
ASSERT_EQ(allocation->fragmentsStorage.fragmentStorageData[i].cpuPtr,
|
||||
@@ -1061,7 +1061,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenAllocationsContainingDiffe
|
||||
ASSERT_EQ(1u, reqs.requiredFragmentsCount);
|
||||
|
||||
csr->makeResident(*allocation2);
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
|
||||
for (unsigned int i = 0; i < reqs.requiredFragmentsCount; i++) {
|
||||
ASSERT_EQ(allocation2->fragmentsStorage.fragmentStorageData[i].cpuPtr,
|
||||
@@ -1090,7 +1090,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenTwoAllocationsWhenBackingS
|
||||
csr->makeResident(*allocation);
|
||||
csr->makeResident(*allocation2);
|
||||
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
|
||||
EXPECT_EQ(getResidencyVector<FamilyType>().size(), 1u);
|
||||
|
||||
@@ -1124,7 +1124,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, ClearResidencyWhenFlushNotCalle
|
||||
EXPECT_EQ(getResidencyVector<FamilyType>().size(), 0u);
|
||||
csr->makeResident(*allocation1);
|
||||
csr->makeResident(*allocation2);
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
|
||||
EXPECT_TRUE(isResident<FamilyType>(allocation1->getBO()));
|
||||
EXPECT_TRUE(isResident<FamilyType>(allocation2->getBO()));
|
||||
@@ -1266,7 +1266,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, MakeResidentClearResidencyAlloc
|
||||
csr->makeResident(*allocation2);
|
||||
EXPECT_NE(0u, csr->getResidencyAllocations().size());
|
||||
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
csr->makeSurfacePackNonResident(csr->getResidencyAllocations());
|
||||
EXPECT_EQ(0u, csr->getResidencyAllocations().size());
|
||||
|
||||
@@ -1284,7 +1284,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenMultipleMakeResidentWhenMa
|
||||
|
||||
EXPECT_NE(0u, csr->getResidencyAllocations().size());
|
||||
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
csr->makeSurfacePackNonResident(csr->getResidencyAllocations());
|
||||
|
||||
EXPECT_EQ(0u, csr->getResidencyAllocations().size());
|
||||
@@ -1349,7 +1349,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, BufferResidency) {
|
||||
//make it resident 8 times
|
||||
for (int c = 0; c < 8; c++) {
|
||||
csr->makeResident(*buffer->getGraphicsAllocation());
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
EXPECT_TRUE(buffer->getGraphicsAllocation()->isResident(osContextId));
|
||||
EXPECT_EQ(buffer->getGraphicsAllocation()->getResidencyTaskCount(osContextId), csr->peekTaskCount() + 1);
|
||||
}
|
||||
|
||||
@@ -1948,7 +1948,7 @@ TEST_F(DrmMemoryManagerTest, givenTwoGraphicsAllocationsThatShareTheSameBufferOb
|
||||
testedCsr->makeResident(*graphicsAllocation2);
|
||||
EXPECT_EQ(2u, testedCsr->getResidencyAllocations().size());
|
||||
|
||||
testedCsr->processResidency(testedCsr->getResidencyAllocations());
|
||||
testedCsr->processResidency(testedCsr->getResidencyAllocations(), 0u);
|
||||
|
||||
EXPECT_EQ(1u, testedCsr->residency.size());
|
||||
|
||||
@@ -1976,7 +1976,7 @@ TEST_F(DrmMemoryManagerTest, givenTwoGraphicsAllocationsThatDoesnShareTheSameBuf
|
||||
testedCsr->makeResident(*graphicsAllocation2);
|
||||
EXPECT_EQ(2u, testedCsr->getResidencyAllocations().size());
|
||||
|
||||
testedCsr->processResidency(testedCsr->getResidencyAllocations());
|
||||
testedCsr->processResidency(testedCsr->getResidencyAllocations(), 0u);
|
||||
|
||||
EXPECT_EQ(2u, testedCsr->residency.size());
|
||||
|
||||
|
||||
@@ -715,7 +715,7 @@ TEST_F(WddmCommandStreamMockGdiTest, makeResidentClearsResidencyAllocations) {
|
||||
|
||||
EXPECT_EQ(trimListUnusedPosition, static_cast<WddmAllocation *>(commandBuffer)->getTrimCandidateListPosition(csr->getOsContext().getContextId()));
|
||||
|
||||
csr->processResidency(csr->getResidencyAllocations());
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
|
||||
csr->makeSurfacePackNonResident(csr->getResidencyAllocations());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user