From e7e23cd0b495c903facbd96f2ea564109e3b56ee Mon Sep 17 00:00:00 2001 From: "Dunajski, Bartosz" Date: Mon, 2 Sep 2019 10:16:44 +0200 Subject: [PATCH] Remove queueBlocked restriction from blitEnqueueAllowed Change-Id: If7fcd15cbbb4e749d16b9d028dac33a8a7b20bde Signed-off-by: Dunajski, Bartosz Related-To: NEO-3020 --- runtime/command_queue/command_queue.cpp | 4 ++-- runtime/command_queue/command_queue.h | 2 +- runtime/command_queue/command_queue_hw.h | 1 + runtime/command_queue/enqueue_common.h | 6 ++++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/runtime/command_queue/command_queue.cpp b/runtime/command_queue/command_queue.cpp index 9fa77c3c2b..4026e31b7f 100644 --- a/runtime/command_queue/command_queue.cpp +++ b/runtime/command_queue/command_queue.cpp @@ -577,7 +577,7 @@ bool CommandQueue::queueDependenciesClearRequired() const { return isOOQEnabled() || DebugManager.flags.OmitTimestampPacketDependencies.get(); } -bool CommandQueue::blitEnqueueAllowed(bool queueBlocked, cl_command_type cmdType) { +bool CommandQueue::blitEnqueueAllowed(cl_command_type cmdType) const { bool blitAllowed = false; if (DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.get() != -1) { @@ -587,7 +587,7 @@ bool CommandQueue::blitEnqueueAllowed(bool queueBlocked, cl_command_type cmdType bool commandAllowed = (CL_COMMAND_READ_BUFFER == cmdType) || (CL_COMMAND_WRITE_BUFFER == cmdType); - return commandAllowed && !queueBlocked && blitAllowed; + return commandAllowed && blitAllowed; } bool CommandQueue::isBlockedCommandStreamRequired(uint32_t commandType, const EventsRequest &eventsRequest, bool blockedQueue) const { diff --git a/runtime/command_queue/command_queue.h b/runtime/command_queue/command_queue.h index 791df24d89..e47da9589c 100644 --- a/runtime/command_queue/command_queue.h +++ b/runtime/command_queue/command_queue.h @@ -437,7 +437,7 @@ class CommandQueue : public BaseObject<_cl_command_queue> { cl_uint numEventsInWaitList, const cl_event *eventWaitList); void providePerformanceHint(TransferProperties &transferProperties); bool queueDependenciesClearRequired() const; - bool blitEnqueueAllowed(bool queueBlocked, cl_command_type cmdType); + bool blitEnqueueAllowed(cl_command_type cmdType) const; void aubCaptureHook(bool &blocking, bool &clearAllDependencies, const MultiDispatchInfo &multiDispatchInfo); Context *context = nullptr; diff --git a/runtime/command_queue/command_queue_hw.h b/runtime/command_queue/command_queue_hw.h index 3982022b26..2ebf5a64de 100644 --- a/runtime/command_queue/command_queue_hw.h +++ b/runtime/command_queue/command_queue_hw.h @@ -338,6 +338,7 @@ class CommandQueueHw : public CommandQueue { const MultiDispatchInfo &multiDispatchInfo, TimestampPacketContainer *previousTimestampPacketNodes, std::unique_ptr &blockedCommandsData, + const EnqueueProperties &enqueueProperties, EventsRequest &eventsRequest, EventBuilder &externalEventBuilder, std::unique_ptr printfHandler); diff --git a/runtime/command_queue/enqueue_common.h b/runtime/command_queue/enqueue_common.h index 8b9a0df4a9..1145f92285 100644 --- a/runtime/command_queue/enqueue_common.h +++ b/runtime/command_queue/enqueue_common.h @@ -170,7 +170,7 @@ void CommandQueueHw::enqueueHandler(Surface **surfacesForResidency, auto blockQueue = false; auto taskLevel = 0u; obtainTaskLevelAndBlockedStatus(taskLevel, numEventsInWaitList, eventWaitList, blockQueue, commandType); - bool blitEnqueue = blitEnqueueAllowed(blockQueue, commandType); + bool blitEnqueue = blitEnqueueAllowed(commandType); DBG_LOG(EventsDebugEnable, "blockQueue", blockQueue, "virtualEvent", virtualEvent, "taskLevel", taskLevel); @@ -345,6 +345,7 @@ void CommandQueueHw::enqueueHandler(Surface **surfacesForResidency, multiDispatchInfo, &previousTimestampPacketNodes, blockedCommandsData, + enqueueProperties, eventsRequest, eventBuilder, std::move(printfHandler)); @@ -720,6 +721,7 @@ void CommandQueueHw::enqueueBlocked( const MultiDispatchInfo &multiDispatchInfo, TimestampPacketContainer *previousTimestampPacketNodes, std::unique_ptr &blockedCommandsData, + const EnqueueProperties &enqueueProperties, EventsRequest &eventsRequest, EventBuilder &externalEventBuilder, std::unique_ptr printfHandler) { @@ -752,7 +754,7 @@ void CommandQueueHw::enqueueBlocked( std::unique_ptr command; bool storeTimestampPackets = blockedCommandsData && timestampPacketContainer; - if (multiDispatchInfo.empty()) { + if (enqueueProperties.operation != EnqueueProperties::Operation::GpuKernel) { command = std::make_unique(*this, blockedCommandsData); } else { //store task data in event