Command stream receiver: handle flush method failure when flushing BCS task

Related-To: NEO-7412
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-11-04 17:02:46 +00:00
committed by Compute-Runtime-Automation
parent 27d042107a
commit 33e1b3a717
5 changed files with 46 additions and 1 deletions

View File

@@ -928,4 +928,15 @@ LogicalStateHelper *CommandStreamReceiver::getLogicalStateHelper() const {
return logicalStateHelper.get();
}
uint32_t CompletionStamp::getTaskCountFromSubmissionStatusError(SubmissionStatus status) {
switch (status) {
case SubmissionStatus::OUT_OF_HOST_MEMORY:
return CompletionStamp::outOfHostMemory;
case SubmissionStatus::OUT_OF_MEMORY:
return CompletionStamp::outOfDeviceMemory;
default:
return 0;
}
}
} // namespace NEO

View File

@@ -1164,7 +1164,10 @@ uint32_t CommandStreamReceiverHw<GfxFamily>::flushBcsTask(const BlitPropertiesCo
commandStream.getGraphicsAllocation()->updateTaskCount(newTaskCount, this->osContext->getContextId());
commandStream.getGraphicsAllocation()->updateResidencyTaskCount(newTaskCount, this->osContext->getContextId());
flush(batchBuffer, getResidencyAllocations());
auto flushSubmissionStatus = flush(batchBuffer, getResidencyAllocations());
if (flushSubmissionStatus != SubmissionStatus::SUCCESS) {
return CompletionStamp::getTaskCountFromSubmissionStatusError(flushSubmissionStatus);
}
makeSurfacePackNonResident(getResidencyAllocations(), true);
if (updateTag) {

View File

@@ -11,7 +11,10 @@
namespace NEO {
using FlushStamp = uint64_t;
enum class SubmissionStatus : uint32_t;
struct CompletionStamp {
static uint32_t getTaskCountFromSubmissionStatusError(SubmissionStatus submissionStatus);
uint32_t taskCount;
uint32_t taskLevel;
FlushStamp flushStamp;