Fix redundant state base address dispatch

This fix handles scenario when regular command list uses context first,
then immediate command list is used for the first time.

Related-To: NEO-5055

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2023-02-28 19:46:30 +00:00
committed by Compute-Runtime-Automation
parent ce1a56e406
commit 42b8a536db
4 changed files with 37 additions and 3 deletions

View File

@@ -2285,7 +2285,7 @@ HWTEST_F(CommandStreamReceiverTest, givenSshDirtyStateWhenUpdatingStateWithNewHe
check = dirtyStateCopy.updateAndCheck(&dummyHeap);
EXPECT_FALSE(check);
auto dirtyState = static_cast<CommandStreamReceiverHw<FamilyType> *>(commandStreamReceiver)->getSshState();
auto &dirtyState = static_cast<CommandStreamReceiverHw<FamilyType> *>(commandStreamReceiver)->getSshState();
check = dirtyState.updateAndCheck(&dummyHeap);
EXPECT_TRUE(check);
@@ -2309,7 +2309,31 @@ HWTEST_F(CommandStreamReceiverTest, givenDshDirtyStateWhenUpdatingStateWithNewHe
check = dirtyStateCopy.updateAndCheck(&dummyHeap);
EXPECT_FALSE(check);
auto dirtyState = static_cast<CommandStreamReceiverHw<FamilyType> *>(commandStreamReceiver)->getDshState();
auto &dirtyState = static_cast<CommandStreamReceiverHw<FamilyType> *>(commandStreamReceiver)->getDshState();
check = dirtyState.updateAndCheck(&dummyHeap);
EXPECT_TRUE(check);
check = dirtyState.updateAndCheck(&dummyHeap);
EXPECT_FALSE(check);
}
HWTEST_F(CommandStreamReceiverTest, givenIohDirtyStateWhenUpdatingStateWithNewHeapThenExpectDirtyStateTrue) {
MockGraphicsAllocation allocation{};
allocation.gpuAddress = 0xABC000;
allocation.size = 0x1000;
IndirectHeap dummyHeap(&allocation, false);
auto dirtyStateCopy = static_cast<CommandStreamReceiverHw<FamilyType> *>(commandStreamReceiver)->getIohState();
bool check = dirtyStateCopy.updateAndCheck(&dummyHeap);
EXPECT_TRUE(check);
check = dirtyStateCopy.updateAndCheck(&dummyHeap);
EXPECT_FALSE(check);
auto &dirtyState = static_cast<CommandStreamReceiverHw<FamilyType> *>(commandStreamReceiver)->getIohState();
check = dirtyState.updateAndCheck(&dummyHeap);
EXPECT_TRUE(check);