Refactor blit buffer call

Resolves: NEO-3241

Change-Id: I726135ae55d1e0fcbacd80620e827ee5c7c0c8dc
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2019-08-06 18:01:26 +02:00
committed by sys_ocldev
parent 5ab8748fc5
commit 552a1268eb
36 changed files with 290 additions and 76 deletions

View File

@@ -624,7 +624,7 @@ void AUBCommandStreamReceiverHw<GfxFamily>::writeMemory(uint64_t gpuAddress, voi
template <typename GfxFamily>
bool AUBCommandStreamReceiverHw<GfxFamily>::writeMemory(GraphicsAllocation &gfxAllocation) {
if (!gfxAllocation.isAubWritable()) {
if (!this->isAubWritable(gfxAllocation)) {
return false;
}
@@ -651,7 +651,7 @@ bool AUBCommandStreamReceiverHw<GfxFamily>::writeMemory(GraphicsAllocation &gfxA
}
if (AubHelper::isOneTimeAubWritableAllocationType(gfxAllocation.getAllocationType())) {
gfxAllocation.setAubWritable(false);
this->setAubWritable(false, gfxAllocation);
}
return true;
@@ -714,10 +714,11 @@ void AUBCommandStreamReceiverHw<GfxFamily>::processResidency(ResidencyContainer
for (auto &gfxAllocation : allocationsForResidency) {
if (dumpAubNonWritable) {
gfxAllocation->setAubWritable(true);
this->setAubWritable(true, *gfxAllocation);
}
if (!writeMemory(*gfxAllocation)) {
DEBUG_BREAK_IF(!((gfxAllocation->getUnderlyingBufferSize() == 0) || !gfxAllocation->isAubWritable()));
DEBUG_BREAK_IF(!((gfxAllocation->getUnderlyingBufferSize() == 0) ||
!this->isAubWritable(*gfxAllocation)));
}
gfxAllocation->updateResidencyTaskCount(this->taskCount + 1, this->osContext->getContextId());
}

View File

@@ -54,6 +54,11 @@ class CommandStreamReceiverSimulatedCommonHw : public CommandStreamReceiverHw<Gf
virtual void writeMemory(uint64_t gpuAddress, void *cpuAddress, size_t size, uint32_t memoryBank, uint64_t entryBits) = 0;
virtual void writeMemoryWithAubManager(GraphicsAllocation &graphicsAllocation) = 0;
virtual void setAubWritable(bool writable, GraphicsAllocation &graphicsAllocation) = 0;
virtual bool isAubWritable(GraphicsAllocation &graphicsAllocation) const = 0;
virtual void setTbxWritable(bool writable, GraphicsAllocation &graphicsAllocation) = 0;
virtual bool isTbxWritable(GraphicsAllocation &graphicsAllocation) const = 0;
size_t getPreferredTagPoolSize() const override { return 1; }
aub_stream::AubManager *aubManager = nullptr;

View File

@@ -12,7 +12,7 @@
namespace NEO {
extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE];
extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[IGFX_MAX_CORE];
template <typename BaseCSR>
CommandStreamReceiverWithAUBDump<BaseCSR>::CommandStreamReceiverWithAUBDump(const std::string &baseName, ExecutionEnvironment &executionEnvironment)

View File

@@ -15,7 +15,7 @@
namespace NEO {
extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE];
extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[IGFX_MAX_CORE];
CommandStreamReceiver *createCommandStreamImpl(ExecutionEnvironment &executionEnvironment) {
auto funcCreate = commandStreamReceiverFactory[executionEnvironment.getHardwareInfo()->platform.eRenderCoreFamily];

View File

@@ -29,5 +29,18 @@ class CommandStreamReceiverSimulatedHw : public CommandStreamReceiverSimulatedCo
return new PhysicalAddressAllocator();
}
void writeMemoryWithAubManager(GraphicsAllocation &graphicsAllocation) override{};
void setAubWritable(bool writable, GraphicsAllocation &graphicsAllocation) override {
graphicsAllocation.setAubWritable(writable, getMemoryBank(&graphicsAllocation));
}
bool isAubWritable(GraphicsAllocation &graphicsAllocation) const override {
return graphicsAllocation.isAubWritable(getMemoryBank(&graphicsAllocation));
}
void setTbxWritable(bool writable, GraphicsAllocation &graphicsAllocation) override {
graphicsAllocation.setTbxWritable(writable, getMemoryBank(&graphicsAllocation));
}
bool isTbxWritable(GraphicsAllocation &graphicsAllocation) const override {
return graphicsAllocation.isTbxWritable(getMemoryBank(&graphicsAllocation));
}
};
} // namespace NEO

View File

@@ -363,7 +363,7 @@ void TbxCommandStreamReceiverHw<GfxFamily>::writeMemory(uint64_t gpuAddress, voi
template <typename GfxFamily>
bool TbxCommandStreamReceiverHw<GfxFamily>::writeMemory(GraphicsAllocation &gfxAllocation) {
if (!gfxAllocation.isTbxWritable()) {
if (!this->isTbxWritable(gfxAllocation)) {
return false;
}
@@ -381,7 +381,7 @@ bool TbxCommandStreamReceiverHw<GfxFamily>::writeMemory(GraphicsAllocation &gfxA
}
if (AubHelper::isOneTimeAubWritableAllocationType(gfxAllocation.getAllocationType())) {
gfxAllocation.setTbxWritable(false);
this->setTbxWritable(false, gfxAllocation);
}
return true;
@@ -413,7 +413,8 @@ template <typename GfxFamily>
void TbxCommandStreamReceiverHw<GfxFamily>::processResidency(ResidencyContainer &allocationsForResidency) {
for (auto &gfxAllocation : allocationsForResidency) {
if (!writeMemory(*gfxAllocation)) {
DEBUG_BREAK_IF(!((gfxAllocation->getUnderlyingBufferSize() == 0) || !gfxAllocation->isTbxWritable()));
DEBUG_BREAK_IF(!((gfxAllocation->getUnderlyingBufferSize() == 0) ||
!this->isTbxWritable(*gfxAllocation)));
}
gfxAllocation->updateResidencyTaskCount(this->taskCount + 1, this->osContext->getContextId());
}