mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
[32/n] Internal 4GB allacator.
- Ensure that heaps passed as IndirectHeap to flushTask Change-Id: Ib633e3d3027e142a1fdb51e78b970fb1bd1b9b0c
This commit is contained in:

committed by
sys_ocldev

parent
9dda0ed149
commit
59df78cc18
@ -35,6 +35,7 @@ namespace OCLRT {
|
||||
class Device;
|
||||
class EventBuilder;
|
||||
class LinearStream;
|
||||
class IndirectHeap;
|
||||
class MemoryManager;
|
||||
class OSInterface;
|
||||
class GraphicsAllocation;
|
||||
@ -60,7 +61,7 @@ class CommandStreamReceiver {
|
||||
virtual FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer *allocationsForResidency) = 0;
|
||||
|
||||
virtual CompletionStamp flushTask(LinearStream &commandStream, size_t commandStreamStart,
|
||||
const LinearStream &dsh, const LinearStream &ioh, const LinearStream &ssh,
|
||||
const IndirectHeap &dsh, const IndirectHeap &ioh, const IndirectHeap &ssh,
|
||||
uint32_t taskLevel, DispatchFlags &dispatchFlags) = 0;
|
||||
|
||||
virtual void flushBatchedSubmissions() = 0;
|
||||
|
@ -46,7 +46,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
|
||||
FlushStamp flush(BatchBuffer &batchBuffer, EngineType engineType, ResidencyContainer *allocationsForResidency) override;
|
||||
|
||||
CompletionStamp flushTask(LinearStream &commandStream, size_t commandStreamStart,
|
||||
const LinearStream &dsh, const LinearStream &ioh, const LinearStream &ssh,
|
||||
const IndirectHeap &dsh, const IndirectHeap &ioh, const IndirectHeap &ssh,
|
||||
uint32_t taskLevel, DispatchFlags &dispatchFlags) override;
|
||||
|
||||
void flushBatchedSubmissions() override;
|
||||
|
@ -106,9 +106,9 @@ template <typename GfxFamily>
|
||||
CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
LinearStream &commandStreamTask,
|
||||
size_t commandStreamStartTask,
|
||||
const LinearStream &dsh,
|
||||
const LinearStream &ioh,
|
||||
const LinearStream &ssh,
|
||||
const IndirectHeap &dsh,
|
||||
const IndirectHeap &ioh,
|
||||
const IndirectHeap &ssh,
|
||||
uint32_t taskLevel,
|
||||
DispatchFlags &dispatchFlags) {
|
||||
typedef typename GfxFamily::MI_BATCH_BUFFER_START MI_BATCH_BUFFER_START;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@ -61,7 +61,7 @@ HWTEST_F(CommandQueueSimpleTest, flushWaitlistDoesNotFlushSingleEventWhenTaskCou
|
||||
|
||||
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
auto *gfxAllocation = pDevice->getMemoryManager()->allocateGraphicsMemory(4096);
|
||||
LinearStream stream(gfxAllocation);
|
||||
IndirectHeap stream(gfxAllocation);
|
||||
|
||||
// Update latestSentTaskCount to == 1
|
||||
DispatchFlags dispatchFlags;
|
||||
|
@ -855,7 +855,7 @@ HWTEST_F(CommandStreamReceiverCQFlushTaskTests, getCSShouldReturnACSWithEnoughSi
|
||||
commandStream.getSpace(sizeRequested - sizeCQReserves);
|
||||
|
||||
GraphicsAllocation allocation((void *)0x1234, 1);
|
||||
LinearStream linear(&allocation);
|
||||
IndirectHeap linear(&allocation);
|
||||
|
||||
auto blocking = true;
|
||||
DispatchFlags dispatchFlags;
|
||||
|
@ -35,7 +35,6 @@ struct UltCommandStreamReceiverTest
|
||||
: public DeviceFixture,
|
||||
public HardwareParse,
|
||||
::testing::Test {
|
||||
|
||||
void SetUp() override {
|
||||
DeviceFixture::SetUp();
|
||||
HardwareParse::SetUp();
|
||||
@ -147,9 +146,9 @@ struct UltCommandStreamReceiverTest
|
||||
DispatchFlags flushTaskFlags = {};
|
||||
uint32_t taskLevel = 42;
|
||||
LinearStream commandStream;
|
||||
LinearStream dsh;
|
||||
LinearStream ioh;
|
||||
LinearStream ssh;
|
||||
IndirectHeap dsh = {nullptr};
|
||||
IndirectHeap ioh = {nullptr};
|
||||
IndirectHeap ssh = {nullptr};
|
||||
|
||||
void *cmdBuffer = nullptr;
|
||||
void *dshBuffer = nullptr;
|
||||
|
@ -447,9 +447,9 @@ class CommandStreamReceiverMock : public CommandStreamReceiver {
|
||||
CompletionStamp flushTask(
|
||||
LinearStream &commandStream,
|
||||
size_t commandStreamStart,
|
||||
const LinearStream &dsh,
|
||||
const LinearStream &ioh,
|
||||
const LinearStream &ssh,
|
||||
const IndirectHeap &dsh,
|
||||
const IndirectHeap &ioh,
|
||||
const IndirectHeap &ssh,
|
||||
uint32_t taskLevel,
|
||||
DispatchFlags &dispatchFlags) override {
|
||||
CompletionStamp cs = {};
|
||||
|
@ -31,9 +31,9 @@ FlushStamp MockCommandStreamReceiver::flush(BatchBuffer &batchBuffer, EngineType
|
||||
CompletionStamp MockCommandStreamReceiver::flushTask(
|
||||
LinearStream &commandStream,
|
||||
size_t commandStreamStart,
|
||||
const LinearStream &dsh,
|
||||
const LinearStream &ioh,
|
||||
const LinearStream &ssh,
|
||||
const IndirectHeap &dsh,
|
||||
const IndirectHeap &ioh,
|
||||
const IndirectHeap &ssh,
|
||||
uint32_t taskLevel,
|
||||
DispatchFlags &dispatchFlags) {
|
||||
++taskCount;
|
||||
|
@ -119,9 +119,9 @@ class MockCsr : public MockCsrBase<GfxFamily> {
|
||||
CompletionStamp flushTask(
|
||||
LinearStream &commandStream,
|
||||
size_t commandStreamStart,
|
||||
const LinearStream &dsh,
|
||||
const LinearStream &ioh,
|
||||
const LinearStream &ssh,
|
||||
const IndirectHeap &dsh,
|
||||
const IndirectHeap &ioh,
|
||||
const IndirectHeap &ssh,
|
||||
uint32_t taskLevel,
|
||||
DispatchFlags &dispatchFlags) override {
|
||||
this->flushTaskStamp = *this->executionStamp;
|
||||
@ -189,8 +189,8 @@ class MockCsrHw2 : public CommandStreamReceiverHw<GfxFamily> {
|
||||
}
|
||||
|
||||
CompletionStamp flushTask(LinearStream &commandStream, size_t commandStreamStart,
|
||||
const LinearStream &dsh, const LinearStream &ioh,
|
||||
const LinearStream &ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags) override {
|
||||
const IndirectHeap &dsh, const IndirectHeap &ioh,
|
||||
const IndirectHeap &ssh, uint32_t taskLevel, DispatchFlags &dispatchFlags) override {
|
||||
passedDispatchFlags = dispatchFlags;
|
||||
return CommandStreamReceiverHw<GfxFamily>::flushTask(commandStream, commandStreamStart,
|
||||
dsh, ioh, ssh, taskLevel, dispatchFlags);
|
||||
@ -217,9 +217,9 @@ class MockCommandStreamReceiver : public CommandStreamReceiver {
|
||||
CompletionStamp flushTask(
|
||||
LinearStream &commandStream,
|
||||
size_t commandStreamStart,
|
||||
const LinearStream &dsh,
|
||||
const LinearStream &ioh,
|
||||
const LinearStream &ssh,
|
||||
const IndirectHeap &dsh,
|
||||
const IndirectHeap &ioh,
|
||||
const IndirectHeap &ssh,
|
||||
uint32_t taskLevel,
|
||||
DispatchFlags &dispatchFlags) override;
|
||||
|
||||
|
@ -559,7 +559,7 @@ struct DrmCsrVfeTests : ::testing::Test {
|
||||
}
|
||||
};
|
||||
|
||||
void flushTask(CommandStreamReceiver &csr, LinearStream &stream, bool lowPriority) {
|
||||
void flushTask(CommandStreamReceiver &csr, IndirectHeap &stream, bool lowPriority) {
|
||||
dispatchFlags.lowPriority = lowPriority;
|
||||
csr.flushTask(stream, 0, stream, stream, stream, 0, dispatchFlags);
|
||||
}
|
||||
@ -576,7 +576,7 @@ HWTEST_F(DrmCsrVfeTests, givenNonDirtyVfeForDefaultContextWhenLowPriorityIsFlush
|
||||
device->resetCommandStreamReceiver(mockCsr);
|
||||
|
||||
auto graphicAlloc = mockCsr->getMemoryManager()->allocateGraphicsMemory(1024, 1024);
|
||||
LinearStream stream(graphicAlloc);
|
||||
IndirectHeap stream(graphicAlloc);
|
||||
|
||||
EXPECT_TRUE(mockCsr->peekDefaultMediaVfeStateDirty());
|
||||
EXPECT_TRUE(mockCsr->peekLowPriorityMediaVfeStateDirty());
|
||||
@ -604,7 +604,7 @@ HWTEST_F(DrmCsrVfeTests, givenNonDirtyVfeForLowPriorityContextWhenDefaultPriorit
|
||||
device->resetCommandStreamReceiver(mockCsr);
|
||||
|
||||
auto graphicAlloc = mockCsr->getMemoryManager()->allocateGraphicsMemory(1024, 1024);
|
||||
LinearStream stream(graphicAlloc);
|
||||
IndirectHeap stream(graphicAlloc);
|
||||
|
||||
EXPECT_TRUE(mockCsr->peekDefaultMediaVfeStateDirty());
|
||||
EXPECT_TRUE(mockCsr->peekLowPriorityMediaVfeStateDirty());
|
||||
@ -632,7 +632,7 @@ HWTEST_F(DrmCsrVfeTests, givenNonDirtyVfeForLowPriorityContextWhenLowPriorityIsF
|
||||
device->resetCommandStreamReceiver(mockCsr);
|
||||
|
||||
auto graphicAlloc = mockCsr->getMemoryManager()->allocateGraphicsMemory(1024, 1024);
|
||||
LinearStream stream(graphicAlloc);
|
||||
IndirectHeap stream(graphicAlloc);
|
||||
|
||||
EXPECT_TRUE(mockCsr->peekDefaultMediaVfeStateDirty());
|
||||
EXPECT_TRUE(mockCsr->peekLowPriorityMediaVfeStateDirty());
|
||||
@ -660,7 +660,7 @@ HWTEST_F(DrmCsrVfeTests, givenNonDirtyVfeForBothPriorityContextWhenFlushedLowWit
|
||||
device->resetCommandStreamReceiver(mockCsr);
|
||||
|
||||
auto graphicAlloc = mockCsr->getMemoryManager()->allocateGraphicsMemory(1024, 1024);
|
||||
LinearStream stream(graphicAlloc);
|
||||
IndirectHeap stream(graphicAlloc);
|
||||
|
||||
mockCsr->overrideMediaVFEStateDirty(false);
|
||||
EXPECT_FALSE(mockCsr->peekDefaultMediaVfeStateDirty());
|
||||
@ -681,7 +681,7 @@ HWTEST_F(DrmCsrVfeTests, givenNonDirtyVfeForBothPriorityContextWhenFlushedDefaul
|
||||
device->resetCommandStreamReceiver(mockCsr);
|
||||
|
||||
auto graphicAlloc = mockCsr->getMemoryManager()->allocateGraphicsMemory(1024, 1024);
|
||||
LinearStream stream(graphicAlloc);
|
||||
IndirectHeap stream(graphicAlloc);
|
||||
|
||||
mockCsr->overrideMediaVFEStateDirty(false);
|
||||
EXPECT_FALSE(mockCsr->peekDefaultMediaVfeStateDirty());
|
||||
@ -996,7 +996,7 @@ TEST_F(DrmCommandStreamBatchingTests, givenCsrWhenDispatchPolicyIsSetToBatchingT
|
||||
auto dummyAllocation = mm->allocateGraphicsMemory(1024, 4096);
|
||||
ASSERT_NE(nullptr, commandBuffer);
|
||||
ASSERT_EQ(0u, reinterpret_cast<uintptr_t>(commandBuffer->getUnderlyingBuffer()) & 0xFFF);
|
||||
LinearStream cs(commandBuffer);
|
||||
IndirectHeap cs(commandBuffer);
|
||||
|
||||
tCsr->makeResident(*dummyAllocation);
|
||||
|
||||
@ -1054,7 +1054,7 @@ TEST_F(DrmCommandStreamBatchingTests, givenRecordedCommandBufferWhenItIsSubmitte
|
||||
|
||||
auto commandBuffer = mm->allocateGraphicsMemory(1024, 4096);
|
||||
auto dummyAllocation = mm->allocateGraphicsMemory(1024, 4096);
|
||||
LinearStream cs(commandBuffer);
|
||||
IndirectHeap cs(commandBuffer);
|
||||
std::unique_ptr<Device> device(DeviceHelper<>::create(nullptr));
|
||||
|
||||
tCsr->getMemoryManager()->device = device.get();
|
||||
|
@ -684,9 +684,9 @@ HWTEST_F(WddmCommandStreamMockGdiTest, givenRecordedCommandBufferWhenItIsSubmitt
|
||||
mockCsr->setPreemptionCsrAllocation(preemptionAllocation);
|
||||
|
||||
LinearStream cs(commandBuffer);
|
||||
LinearStream dsh(dshAlloc);
|
||||
LinearStream ioh(iohAlloc);
|
||||
LinearStream ssh(sshAlloc);
|
||||
IndirectHeap dsh(dshAlloc);
|
||||
IndirectHeap ioh(iohAlloc);
|
||||
IndirectHeap ssh(sshAlloc);
|
||||
|
||||
DispatchFlags dispatchFlags;
|
||||
dispatchFlags.guardCommandBufferWithPipeControl = true;
|
||||
@ -828,7 +828,7 @@ HWTEST_F(WddmCsrCompressionTests, givenEnabledCompressionWhenFlushingThenInitTra
|
||||
auto &csrCS = mockWddmCsr.getCS();
|
||||
|
||||
auto graphicsAllocation = memManager->allocateGraphicsMemory(1024, 4096);
|
||||
LinearStream cs(graphicsAllocation);
|
||||
IndirectHeap cs(graphicsAllocation);
|
||||
|
||||
EXPECT_FALSE(mockWddmCsr.pageTableManagerInitialized);
|
||||
|
||||
@ -863,7 +863,7 @@ HWTEST_F(WddmCsrCompressionTests, givenDisabledCompressionWhenFlushingThenDontIn
|
||||
mockWddmCsr.setPreemptionCsrAllocation(preemptionAllocation);
|
||||
|
||||
auto graphicsAllocation = memManager->allocateGraphicsMemory(1024, 4096);
|
||||
LinearStream cs(graphicsAllocation);
|
||||
IndirectHeap cs(graphicsAllocation);
|
||||
|
||||
EXPECT_FALSE(mockWddmCsr.pageTableManagerInitialized);
|
||||
|
||||
|
Reference in New Issue
Block a user