mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add debug flag to read back command buffer pointer
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
88c16542a1
commit
68351249d1
@ -169,6 +169,42 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenCommandStreamWithDuplicate
|
||||
mm->freeGraphicsMemory(commandBuffer);
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDebugFlagSetWhenFlushingThenReadBackCommandBufferPointerIfRequired) {
|
||||
auto commandBuffer = static_cast<DrmAllocation *>(mm->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize}));
|
||||
LinearStream cs(commandBuffer);
|
||||
|
||||
auto testedCsr = static_cast<TestedDrmCommandStreamReceiver<FamilyType> *>(csr);
|
||||
|
||||
CommandStreamReceiverHw<FamilyType>::addBatchBufferEnd(cs, nullptr);
|
||||
EncodeNoop<FamilyType>::alignToCacheLine(cs);
|
||||
|
||||
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(), &cs, nullptr, false};
|
||||
|
||||
{
|
||||
DebugManager.flags.ReadBackCommandBufferAllocation.set(1);
|
||||
|
||||
csr->flush(batchBuffer, csr->getResidencyAllocations());
|
||||
|
||||
if (commandBuffer->isAllocatedInLocalMemoryPool()) {
|
||||
EXPECT_EQ(commandBuffer->getUnderlyingBuffer(), testedCsr->latestReadBackAddress);
|
||||
} else {
|
||||
EXPECT_EQ(nullptr, testedCsr->latestReadBackAddress);
|
||||
}
|
||||
|
||||
testedCsr->latestReadBackAddress = nullptr;
|
||||
}
|
||||
|
||||
{
|
||||
DebugManager.flags.ReadBackCommandBufferAllocation.set(2);
|
||||
|
||||
csr->flush(batchBuffer, csr->getResidencyAllocations());
|
||||
|
||||
EXPECT_EQ(commandBuffer->getUnderlyingBuffer(), testedCsr->latestReadBackAddress);
|
||||
}
|
||||
|
||||
mm->freeGraphicsMemory(commandBuffer);
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDrmCsrCreatedWithInactiveGemCloseWorkerPolicyThenThreadIsNotCreated) {
|
||||
TestedDrmCommandStreamReceiver<FamilyType> testedCsr(gemCloseWorkerMode::gemCloseWorkerInactive,
|
||||
*this->executionEnvironment,
|
||||
|
Reference in New Issue
Block a user