Add initial support for KernelArgsBuffer allocation

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2022-08-03 11:54:08 +00:00
committed by Compute-Runtime-Automation
parent d3796b2b2d
commit 98d776867f
42 changed files with 147 additions and 40 deletions

View File

@@ -31,6 +31,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
using BaseClass::blitterDirectSubmission;
using BaseClass::checkPlatformSupportsGpuIdleImplicitFlush;
using BaseClass::checkPlatformSupportsNewResourceImplicitFlush;
using BaseClass::createKernelArgsBufferAllocation;
using BaseClass::directSubmission;
using BaseClass::dshState;
using BaseClass::getCmdSizeForPrologue;
@@ -41,6 +42,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
using BaseClass::isBlitterDirectSubmissionEnabled;
using BaseClass::isDirectSubmissionEnabled;
using BaseClass::isPerDssBackedBufferSent;
using BaseClass::kernelArgsBufferAllocation;
using BaseClass::logicalStateHelper;
using BaseClass::makeResident;
using BaseClass::perDssBackedBuffer;

View File

@@ -64,6 +64,8 @@ class MockCommandStreamReceiver : public CommandStreamReceiver {
bool isMultiOsContextCapable() const override { return multiOsContextCapable; }
void createKernelArgsBufferAllocation() override {}
bool isGpuHangDetected() const override {
if (isGpuHangDetectedReturnValue.has_value()) {
return *isGpuHangDetectedReturnValue;
@@ -221,6 +223,7 @@ class MockCsrHw2 : public CommandStreamReceiverHw<GfxFamily> {
using CommandStreamReceiverHw<GfxFamily>::postInitFlagsSetup;
using CommandStreamReceiverHw<GfxFamily>::programL3;
using CommandStreamReceiverHw<GfxFamily>::programVFEState;
using CommandStreamReceiverHw<GfxFamily>::createKernelArgsBufferAllocation;
using CommandStreamReceiver::activePartitions;
using CommandStreamReceiver::activePartitionsConfig;
using CommandStreamReceiver::clearColorAllocation;

View File

@@ -92,6 +92,7 @@ void MockDevice::resetCommandStreamReceiver(CommandStreamReceiver *newCsr, uint3
commandStreamReceivers[engineIndex].reset(newCsr);
commandStreamReceivers[engineIndex]->initializeTagAllocation();
commandStreamReceivers[engineIndex]->createGlobalFenceAllocation();
commandStreamReceivers[engineIndex]->createKernelArgsBufferAllocation();
if (preemptionMode == PreemptionMode::MidThread || isDebuggerActive()) {
commandStreamReceivers[engineIndex]->createPreemptionAllocation();

View File

@@ -71,6 +71,7 @@ AllocationTypeTagTestCase allocationTypeTagValues[static_cast<int>(AllocationTyp
{AllocationType::INSTRUCTION_HEAP, "INSTHEAP"},
{AllocationType::INTERNAL_HEAP, "INTLHEAP"},
{AllocationType::INTERNAL_HOST_MEMORY, "INHSTMEM"},
{AllocationType::KERNEL_ARGS_BUFFER, "KARGBUF"},
{AllocationType::KERNEL_ISA, "KERNLISA"},
{AllocationType::KERNEL_ISA_INTERNAL, "KRLISAIN"},
{AllocationType::LINEAR_STREAM, "LINRSTRM"},

View File

@@ -69,8 +69,7 @@ HWTEST2_F(SBATest, WhenProgramStateBaseAddressParametersIsCalledThenSBACmdHasBin
true,
MemoryCompressionState::NotApplicable,
false,
1u,
nullptr);
1u);
EXPECT_EQ(ssh.getMaxAvailableSpace() / 64 - 1, cmd->getBindlessSurfaceStateSize());
EXPECT_EQ(ssh.getHeapGpuBase(), cmd->getBindlessSurfaceStateBaseAddress());
@@ -107,8 +106,8 @@ HWTEST2_F(SbaForBindlessTests, givenGlobalBindlessBaseAddressWhenProgramStateBas
true,
MemoryCompressionState::NotApplicable,
false,
1u,
nullptr);
1u);
EXPECT_TRUE(cmd->getBindlessSurfaceStateBaseAddressModifyEnable());
EXPECT_EQ(cmd->getBindlessSurfaceStateBaseAddress(), globalBindlessHeapsBaseAddress);
@@ -147,8 +146,7 @@ HWTEST2_F(SbaForBindlessTests, givenGlobalBindlessBaseAddressWhenPassingIndirect
true,
MemoryCompressionState::NotApplicable,
false,
1u,
nullptr);
1u);
EXPECT_EQ(cmd->getIndirectObjectBaseAddress(), indirectObjectBaseAddress);
}
@@ -206,8 +204,8 @@ HWTEST2_F(SBATest, givenGlobalBindlessBaseAddressWhenSshIsPassedThenBindlessSurf
true,
MemoryCompressionState::NotApplicable,
false,
1u,
nullptr);
1u);
EXPECT_EQ(cmd->getBindlessSurfaceStateBaseAddress(), globalBindlessHeapsBaseAddress);
}
HWTEST2_F(SBATest, givenSurfaceStateHeapWhenNotUsingGlobalHeapBaseThenBindlessSurfaceBaseIsSshBase, IsAtLeastSkl) {
@@ -238,8 +236,8 @@ HWTEST2_F(SBATest, givenSurfaceStateHeapWhenNotUsingGlobalHeapBaseThenBindlessSu
true,
MemoryCompressionState::NotApplicable,
false,
1u,
nullptr);
1u);
EXPECT_EQ(ssh.getHeapGpuBase(), cmd->getBindlessSurfaceStateBaseAddress());
}

View File

@@ -864,6 +864,7 @@ HWTEST_TEMPLATED_F(WddmCommandStreamMockGdiTest, givenRecordedCommandBufferWhenI
csrSurfaceCount = 2;
}
csrSurfaceCount += mockCsr->globalFenceAllocation ? 1 : 0;
csrSurfaceCount += mockCsr->getKernelArgsBufferAllocation() ? 1 : 0;
mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
mockCsr->useNewResourceImplicitFlush = false;