mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
Return error code from submit() to application.
Related-To: NEO-3741 Change-Id: I0e0ff6606eb6a8a77673949955c8e799689017b6 Signed-off-by: Pawel Wilma <pawel.wilma@intel.com>
This commit is contained in:
@@ -37,7 +37,7 @@ class DrmCommandStreamReceiver : public DeviceCommandStreamReceiver<GfxFamily> {
|
||||
DrmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex,
|
||||
gemCloseWorkerMode mode = gemCloseWorkerMode::gemCloseWorkerActive);
|
||||
|
||||
FlushStamp flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override;
|
||||
bool flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override;
|
||||
void makeResident(GraphicsAllocation &gfxAllocation) override;
|
||||
void processResidency(const ResidencyContainer &allocationsForResidency) override;
|
||||
void makeNonResident(GraphicsAllocation &gfxAllocation) override;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "core/helpers/preamble.h"
|
||||
#include "runtime/execution_environment/execution_environment.h"
|
||||
#include "runtime/gmm_helper/gmm_helper.h"
|
||||
#include "runtime/helpers/flush_stamp.h"
|
||||
#include "runtime/mem_obj/buffer.h"
|
||||
#include "runtime/os_interface/linux/drm_allocation.h"
|
||||
#include "runtime/os_interface/linux/drm_buffer_object.h"
|
||||
@@ -40,13 +41,13 @@ DrmCommandStreamReceiver<GfxFamily>::DrmCommandStreamReceiver(ExecutionEnvironme
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
FlushStamp DrmCommandStreamReceiver<GfxFamily>::flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) {
|
||||
bool DrmCommandStreamReceiver<GfxFamily>::flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) {
|
||||
DrmAllocation *alloc = static_cast<DrmAllocation *>(batchBuffer.commandBufferAllocation);
|
||||
DEBUG_BREAK_IF(!alloc);
|
||||
|
||||
BufferObject *bb = alloc->getBO();
|
||||
if (bb == nullptr) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this->lastSentSliceCount != batchBuffer.sliceCount) {
|
||||
@@ -55,7 +56,7 @@ FlushStamp DrmCommandStreamReceiver<GfxFamily>::flush(BatchBuffer &batchBuffer,
|
||||
}
|
||||
}
|
||||
|
||||
FlushStamp flushStamp = bb->peekHandle();
|
||||
this->flushStamp->setStamp(bb->peekHandle());
|
||||
this->flushInternal(batchBuffer, allocationsForResidency);
|
||||
|
||||
if (this->gemCloseWorkerOperationMode == gemCloseWorkerMode::gemCloseWorkerActive) {
|
||||
@@ -63,7 +64,7 @@ FlushStamp DrmCommandStreamReceiver<GfxFamily>::flush(BatchBuffer &batchBuffer,
|
||||
this->getMemoryManager()->peekGemCloseWorker()->push(bb);
|
||||
}
|
||||
|
||||
return flushStamp;
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
@@ -765,7 +765,6 @@ bool Wddm::submit(uint64_t commandBuffer, size_t size, void *commandHeader, OsCo
|
||||
osContext.getResidencyController().getMonitoredFence().currentFenceValue++;
|
||||
}
|
||||
getDeviceState();
|
||||
UNRECOVERABLE_IF(!status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class WddmCommandStreamReceiver : public DeviceCommandStreamReceiver<GfxFamily>
|
||||
WddmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex);
|
||||
virtual ~WddmCommandStreamReceiver();
|
||||
|
||||
FlushStamp flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override;
|
||||
bool flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override;
|
||||
void makeResident(GraphicsAllocation &gfxAllocation) override;
|
||||
void processResidency(const ResidencyContainer &allocationsForResidency) override;
|
||||
void processEviction() override;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "runtime/device/device.h"
|
||||
#include "runtime/gen_common/hw_cmds.h"
|
||||
#include "runtime/gmm_helper/page_table_mngr.h"
|
||||
#include "runtime/helpers/flush_stamp.h"
|
||||
#include "runtime/helpers/gmm_callbacks.h"
|
||||
#include "runtime/mem_obj/mem_obj.h"
|
||||
#include "runtime/os_interface/windows/wddm/wddm.h"
|
||||
@@ -25,6 +26,7 @@
|
||||
#include "runtime/os_interface/windows/os_context_win.h"
|
||||
#include "runtime/os_interface/windows/os_interface.h"
|
||||
#include "runtime/os_interface/windows/wddm_memory_manager.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
// Initialize COMMAND_BUFFER_HEADER Type PatchList Streamer Perf Tag
|
||||
@@ -61,7 +63,7 @@ WddmCommandStreamReceiver<GfxFamily>::~WddmCommandStreamReceiver() {
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
FlushStamp WddmCommandStreamReceiver<GfxFamily>::flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) {
|
||||
bool WddmCommandStreamReceiver<GfxFamily>::flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) {
|
||||
auto commandStreamAddress = ptrOffset(batchBuffer.commandBufferAllocation->getGpuAddress(), batchBuffer.startOffset);
|
||||
|
||||
if (this->dispatchMode == DispatchMode::ImmediateDispatch) {
|
||||
@@ -95,9 +97,10 @@ FlushStamp WddmCommandStreamReceiver<GfxFamily>::flush(BatchBuffer &batchBuffer,
|
||||
}
|
||||
|
||||
auto osContextWin = static_cast<OsContextWin *>(osContext);
|
||||
wddm->submit(commandStreamAddress, batchBuffer.usedSize - batchBuffer.startOffset, commandBufferHeader, *osContextWin);
|
||||
auto status = wddm->submit(commandStreamAddress, batchBuffer.usedSize - batchBuffer.startOffset, commandBufferHeader, *osContextWin);
|
||||
|
||||
return osContextWin->getResidencyController().getMonitoredFence().lastSubmittedFence;
|
||||
flushStamp->setStamp(osContextWin->getResidencyController().getMonitoredFence().lastSubmittedFence);
|
||||
return status;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
Reference in New Issue
Block a user