refactor: remove not needed code

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2024-11-28 14:49:14 +00:00
committed by Compute-Runtime-Automation
parent c3794795ec
commit 2039b1c41b
8 changed files with 4 additions and 130 deletions

View File

@@ -303,34 +303,15 @@ struct GraphicsAllocationTests : public ::testing::Test {
}
void gfxAllocationSetToDefault() {
graphicsAllocation.storageInfo.readOnlyMultiStorage = false;
graphicsAllocation.storageInfo.memoryBanks = 0;
graphicsAllocation.overrideMemoryPool(MemoryPool::memoryNull);
}
void gfxAllocationEnableReadOnlyMultiStorage(uint32_t banks) {
graphicsAllocation.storageInfo.cloningOfPageTables = false;
graphicsAllocation.storageInfo.readOnlyMultiStorage = true;
graphicsAllocation.storageInfo.memoryBanks = banks;
graphicsAllocation.overrideMemoryPool(MemoryPool::localMemory);
}
MockExecutionEnvironment executionEnvironment;
std::unique_ptr<CommandStreamReceiver> aubCsr;
MockGraphicsAllocation graphicsAllocation;
};
HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationWhenIsAubWritableIsCalledThenTrueIsReturned) {
initializeCsr<FamilyType>();
auto &aubCsr = getAubCsr<FamilyType>();
gfxAllocationSetToDefault();
EXPECT_TRUE(aubCsr.isAubWritable(graphicsAllocation));
gfxAllocationEnableReadOnlyMultiStorage(0b1111);
EXPECT_TRUE(aubCsr.isAubWritable(graphicsAllocation));
}
HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationThatHasPageTablesCloningWhenWriteableFlagsAreUsedThenDefaultBankIsUsed) {
initializeCsr<FamilyType>();
auto &aubCsr = getAubCsr<FamilyType>();
@@ -361,93 +342,6 @@ HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationThatHasPageTablesClonin
EXPECT_FALSE(aubCsr.isTbxWritable(graphicsAllocation));
}
HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationWhenAubWritableIsSetToFalseThenAubWritableIsFalse) {
initializeCsr<FamilyType>();
auto &aubCsr = getAubCsr<FamilyType>();
gfxAllocationSetToDefault();
aubCsr.setAubWritable(false, graphicsAllocation);
EXPECT_FALSE(aubCsr.isAubWritable(graphicsAllocation));
gfxAllocationEnableReadOnlyMultiStorage(0b1111);
aubCsr.setAubWritable(false, graphicsAllocation);
EXPECT_FALSE(aubCsr.isAubWritable(graphicsAllocation));
}
HWTEST_F(GraphicsAllocationTests, givenMultiStorageGraphicsAllocationWhenAubWritableIsSetOnSpecificBanksThenCorrectValuesAreSet) {
initializeCsr<FamilyType>();
auto &aubCsr = getAubCsr<FamilyType>();
gfxAllocationEnableReadOnlyMultiStorage(0b1010);
aubCsr.setAubWritable(false, graphicsAllocation);
EXPECT_EQ(graphicsAllocation.aubInfo.aubWritable, maxNBitValue(32) & ~(0b1010));
EXPECT_FALSE(graphicsAllocation.isAubWritable(0b10));
EXPECT_FALSE(graphicsAllocation.isAubWritable(0b1000));
EXPECT_FALSE(graphicsAllocation.isAubWritable(0b1010));
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b1));
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b100));
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b101));
aubCsr.setAubWritable(true, graphicsAllocation);
EXPECT_EQ(graphicsAllocation.aubInfo.aubWritable, maxNBitValue(32));
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b1));
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b10));
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b100));
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b1000));
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b101));
EXPECT_TRUE(graphicsAllocation.isAubWritable(0b1010));
}
HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationWhenIsTbxWritableIsCalledThenTrueIsReturned) {
initializeCsr<FamilyType>();
auto &aubCsr = getAubCsr<FamilyType>();
gfxAllocationSetToDefault();
EXPECT_TRUE(aubCsr.isTbxWritable(graphicsAllocation));
gfxAllocationEnableReadOnlyMultiStorage(0b1111);
EXPECT_TRUE(aubCsr.isTbxWritable(graphicsAllocation));
};
HWTEST_F(GraphicsAllocationTests, givenGraphicsAllocationWhenTbxWritableIsSetToFalseThenTbxWritableIsFalse) {
initializeCsr<FamilyType>();
auto &aubCsr = getAubCsr<FamilyType>();
gfxAllocationSetToDefault();
aubCsr.setTbxWritable(false, graphicsAllocation);
EXPECT_FALSE(aubCsr.isTbxWritable(graphicsAllocation));
gfxAllocationEnableReadOnlyMultiStorage(0b1111);
aubCsr.setTbxWritable(false, graphicsAllocation);
EXPECT_FALSE(aubCsr.isTbxWritable(graphicsAllocation));
}
HWTEST_F(GraphicsAllocationTests, givenMultiStorageGraphicsAllocationWhenTbxWritableIsSetOnSpecificBanksThenCorrectValuesAreSet) {
initializeCsr<FamilyType>();
auto &aubCsr = getAubCsr<FamilyType>();
gfxAllocationEnableReadOnlyMultiStorage(0b1010);
aubCsr.setTbxWritable(false, graphicsAllocation);
EXPECT_EQ(graphicsAllocation.aubInfo.tbxWritable, maxNBitValue(32) & ~(0b1010));
EXPECT_FALSE(graphicsAllocation.isTbxWritable(0b10));
EXPECT_FALSE(graphicsAllocation.isTbxWritable(0b1000));
EXPECT_FALSE(graphicsAllocation.isTbxWritable(0b1010));
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b1));
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b100));
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b101));
aubCsr.setTbxWritable(true, graphicsAllocation);
EXPECT_EQ(graphicsAllocation.aubInfo.tbxWritable, maxNBitValue(32));
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b1));
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b10));
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b100));
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b1000));
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b101));
EXPECT_TRUE(graphicsAllocation.isTbxWritable(0b1010));
}
uint32_t MockGraphicsAllocationTaskCount::getTaskCountCalleedTimes = 0;
TEST(GraphicsAllocationTest, givenGraphicsAllocationWhenAssignedTaskCountEqualZeroThenPrepareForResidencyDoeNotCallGetTaskCount) {
@@ -637,4 +531,4 @@ TEST(GraphicsAllocationTest, givenGraphicsAllocationsWhenAllocationTypeIsRingBuf
graphicsAllocation.hasAllocationReadOnlyTypeCallBase = true;
graphicsAllocation.allocationType = AllocationType::ringBuffer;
EXPECT_TRUE(graphicsAllocation.hasAllocationReadOnlyType());
}
}

View File

@@ -423,16 +423,6 @@ TEST_F(MultiDeviceStorageInfoTest, givenReleaseWhichDoesNotAllowLocalOnlyWhenCre
EXPECT_FALSE(storageInfo.isLockable);
}
TEST_F(MultiDeviceStorageInfoTest, givenReadOnlyBufferToBeCopiedAcrossTilesWhenCreatingStorageInfoThenCorrectValuesAreSet) {
AllocationProperties properties{mockRootDeviceIndex, false, 1u, AllocationType::buffer, false, singleTileMask};
properties.flags.readOnlyMultiStorage = true;
auto storageInfo = memoryManager->createStorageInfoFromProperties(properties);
EXPECT_EQ(allTilesMask, storageInfo.memoryBanks);
EXPECT_FALSE(storageInfo.cloningOfPageTables);
EXPECT_TRUE(storageInfo.readOnlyMultiStorage);
EXPECT_TRUE(storageInfo.tileInstanced);
}
TEST_F(MultiDeviceStorageInfoTest, givenReadOnlyBufferToBeCopiedAcrossTilesWhenDebugVariableIsSetThenOnlyCertainBanksAreUsed) {
DebugManagerStateRestore restorer;
auto proposedTiles = allTilesMask;