Fixed TBX with AUB dump mode without AubStream

Related-To: NEO-3150

Change-Id: I9ee7fc3c44f3021c61db7c27c01522cbe7d7445d
Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
Milczarek, Slawomir
2019-05-09 17:58:35 +02:00
committed by sys_ocldev
parent 0c9995d447
commit cc6a94b5b6
7 changed files with 35 additions and 6 deletions

View File

@@ -125,6 +125,7 @@ void *CommandQueue::cpuDataTransferHandler(TransferProperties &transferPropertie
if (!unmapInfo.readOnly) {
auto graphicsAllocation = transferProperties.memObj->getGraphicsAllocation();
graphicsAllocation->setAubWritable(true);
graphicsAllocation->setTbxWritable(true);
}
break;
case CL_COMMAND_READ_BUFFER:

View File

@@ -614,6 +614,10 @@ void AUBCommandStreamReceiverHw<GfxFamily>::writeMemory(uint64_t gpuAddress, voi
template <typename GfxFamily>
bool AUBCommandStreamReceiverHw<GfxFamily>::writeMemory(GraphicsAllocation &gfxAllocation) {
if (!gfxAllocation.isAubWritable()) {
return false;
}
bool ownsLock = !gfxAllocation.isLocked();
uint64_t gpuAddress;

View File

@@ -102,7 +102,7 @@ bool CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getParametersForWriteMem
size = gmm->gmmResourceInfo->getSizeAllocation();
}
if ((size == 0) || !graphicsAllocation.isAubWritable())
if (size == 0)
return false;
if (cpuAddress == nullptr) {

View File

@@ -365,6 +365,10 @@ void TbxCommandStreamReceiverHw<GfxFamily>::writeMemory(uint64_t gpuAddress, voi
template <typename GfxFamily>
bool TbxCommandStreamReceiverHw<GfxFamily>::writeMemory(GraphicsAllocation &gfxAllocation) {
if (!gfxAllocation.isTbxWritable()) {
return false;
}
uint64_t gpuAddress;
void *cpuAddress;
size_t size;
@@ -379,7 +383,7 @@ bool TbxCommandStreamReceiverHw<GfxFamily>::writeMemory(GraphicsAllocation &gfxA
}
if (AubHelper::isOneTimeAubWritableAllocationType(gfxAllocation.getAllocationType())) {
gfxAllocation.setAubWritable(false);
gfxAllocation.setTbxWritable(false);
}
return true;
@@ -411,7 +415,7 @@ template <typename GfxFamily>
void TbxCommandStreamReceiverHw<GfxFamily>::processResidency(ResidencyContainer &allocationsForResidency) {
for (auto &gfxAllocation : allocationsForResidency) {
if (!writeMemory(*gfxAllocation)) {
DEBUG_BREAK_IF(!((gfxAllocation->getUnderlyingBufferSize() == 0) || !gfxAllocation->isAubWritable()));
DEBUG_BREAK_IF(!((gfxAllocation->getUnderlyingBufferSize() == 0) || !gfxAllocation->isTbxWritable()));
}
gfxAllocation->updateResidencyTaskCount(this->taskCount + 1, this->osContext->getContextId());
}

View File

@@ -133,6 +133,8 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
void setAubWritable(bool writable) { aubInfo.aubWritable = writable; }
bool isAubWritable() const { return aubInfo.aubWritable; }
void setTbxWritable(bool writable) { aubInfo.tbxWritable = writable; }
bool isTbxWritable() const { return aubInfo.tbxWritable; }
void setAllocDumpable(bool dumpable) { aubInfo.allocDumpable = dumpable; }
bool isAllocDumpable() const { return aubInfo.allocDumpable; }
bool isMemObjectsAllocationWithWritableFlags() const { return aubInfo.memObjectsAllocationWithWritableFlags; }
@@ -210,6 +212,7 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
};
struct AubInfo {
bool aubWritable = true;
bool tbxWritable = true;
bool allocDumpable = false;
bool memObjectsAllocationWithWritableFlags = false;
};