Check EnableTimestampPacket debug variable once and set as CSR mode

Change-Id: Ia6e7caa96f3b46b30590fb46a1fb37fa153adeb4
This commit is contained in:
Dunajski, Bartosz
2018-09-06 09:03:07 +02:00
committed by sys_ocldev
parent a8beec98e0
commit b74280beb6
11 changed files with 41 additions and 28 deletions

View File

@@ -242,7 +242,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
}
TimestampPacket *timestampPacket = nullptr;
if (DebugManager.flags.EnableTimestampPacket.get()) {
if (device->peekCommandStreamReceiver()->peekTimestampPacketWriteEnabled()) {
obtainNewTimestampPacketNode();
timestampPacket = timestampPacketNode->tag;
}

View File

@@ -291,7 +291,7 @@ LinearStream &getCommandStream(CommandQueue &commandQueue, bool reserveProfiling
SchedulerKernel &scheduler = commandQueue.getDevice().getExecutionEnvironment()->getBuiltIns()->getSchedulerKernel(parentKernel->getContext());
expectedSizeCS += EnqueueOperation<GfxFamily>::getSizeRequiredCS(eventType, reserveProfilingCmdsSpace, reservePerfCounterCmdsSpace, commandQueue, &scheduler);
}
if (DebugManager.flags.EnableTimestampPacket.get()) {
if (commandQueue.getDevice().peekCommandStreamReceiver()->peekTimestampPacketWriteEnabled()) {
expectedSizeCS += 2 * sizeof(typename GfxFamily::PIPE_CONTROL);
}
return commandQueue.getCS(expectedSizeCS);

View File

@@ -48,6 +48,8 @@ CommandStreamReceiver::CommandStreamReceiver(ExecutionEnvironment &executionEnvi
for (int i = 0; i < IndirectHeap::NUM_TYPES; ++i) {
indirectHeap[i] = nullptr;
}
timestampPacketWriteEnabled = DebugManager.flags.EnableTimestampPacket.get();
}
CommandStreamReceiver::~CommandStreamReceiver() {

View File

@@ -155,6 +155,8 @@ class CommandStreamReceiver {
return kmdNotifyHelper.get();
}
bool peekTimestampPacketWriteEnabled() const { return timestampPacketWriteEnabled; }
size_t defaultSshSize;
protected:
@@ -162,6 +164,8 @@ class CommandStreamReceiver {
disableL3Cache = val;
}
bool timestampPacketWriteEnabled = false;
// taskCount - # of tasks submitted
uint32_t taskCount = 0;
// current taskLevel. Used for determining if a PIPE_CONTROL is needed.

View File

@@ -181,7 +181,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
epiloguePipeControlLocation = ptrOffset(commandStreamTask.getCpuBase(), commandStreamTask.getUsed());
if ((dispatchFlags.outOfOrderExecutionAllowed || DebugManager.flags.EnableTimestampPacket.get()) &&
if ((dispatchFlags.outOfOrderExecutionAllowed || timestampPacketWriteEnabled) &&
!dispatchFlags.dcFlush) {
currentPipeControlForNooping = epiloguePipeControlLocation;
}
@@ -355,7 +355,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
// Add a PC if we have a dependency on a previous walker to avoid concurrency issues.
if (taskLevel > this->taskLevel) {
if (!DebugManager.flags.EnableTimestampPacket.get()) {
if (!timestampPacketWriteEnabled) {
addPipeControl(commandStreamCSR, false);
}
this->taskLevel = taskLevel;