Return error when there is no memory to evict

We want to return error code to the application instead of aborting when
we are not able to make more memory resident.

Related-To: NEO-7289
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
This commit is contained in:
Fabian Zwolinski
2022-09-13 14:26:03 +00:00
committed by Compute-Runtime-Automation
parent 501873d0e0
commit 645600d141
20 changed files with 159 additions and 55 deletions

View File

@@ -73,6 +73,20 @@ class TestedDrmCommandStreamReceiver : public DrmCommandStreamReceiver<GfxFamily
return this->submissionAggregator.get();
}
bool processResidency(const ResidencyContainer &allocationsForResidency, uint32_t handleId) override {
if (callBaseProcessResidency) {
return DrmCommandStreamReceiver<GfxFamily>::processResidency(allocationsForResidency, handleId);
}
return processResidencyResult;
}
int exec(const BatchBuffer &batchBuffer, uint32_t vmHandleId, uint32_t drmContextId, uint32_t index) override {
if (callBaseExec) {
return DrmCommandStreamReceiver<GfxFamily>::exec(batchBuffer, vmHandleId, drmContextId, index);
}
return execResult;
}
void overrideSubmissionAggregator(SubmissionAggregator *newSubmissionsAggregator) {
this->submissionAggregator.reset(newSubmissionsAggregator);
}
@@ -105,11 +119,11 @@ class TestedDrmCommandStreamReceiver : public DrmCommandStreamReceiver<GfxFamily
}
}
int flushInternal(const BatchBuffer &batchBuffer, const ResidencyContainer &allocationsForResidency) override {
SubmissionStatus flushInternal(const BatchBuffer &batchBuffer, const ResidencyContainer &allocationsForResidency) override {
if (callHwFlush) {
return DrmCommandStreamReceiver<GfxFamily>::flushInternal(batchBuffer, allocationsForResidency);
}
return 0;
return SubmissionStatus::SUCCESS;
}
void readBackAllocation(void *source) override {
@@ -119,6 +133,10 @@ class TestedDrmCommandStreamReceiver : public DrmCommandStreamReceiver<GfxFamily
void *latestReadBackAddress = nullptr;
bool callHwFlush = true;
bool callBaseProcessResidency = true;
bool processResidencyResult = true;
bool callBaseExec = true;
int execResult = 0;
};
template <typename GfxFamily>