Skip to content

Commit 72da161

Browse files
Add function to detect conditions to reset CSR
Change-Id: I76d21eee26e22e841670180392c1b9262f6b59e1
1 parent c878590 commit 72da161

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

runtime/command_stream/command_stream_receiver_hw.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018 Intel Corporation
2+
* Copyright (C) 2018-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -95,6 +95,8 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
9595

9696
static void emitNoop(LinearStream &commandStream, size_t bytesToUpdate);
9797

98+
bool detectInitProgrammingFlagsRequired(const DispatchFlags &dispatchFlags) const;
99+
98100
HeapDirtyState dshState;
99101
HeapDirtyState iohState;
100102
HeapDirtyState sshState;

runtime/command_stream/command_stream_receiver_hw.inl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
165165
if (DebugManager.flags.ForceCsrFlushing.get()) {
166166
flushBatchedSubmissions();
167167
}
168-
if (DebugManager.flags.ForceCsrReprogramming.get()) {
168+
if (detectInitProgrammingFlagsRequired(dispatchFlags)) {
169169
initProgrammingFlags();
170170
}
171171

@@ -407,7 +407,6 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
407407
GraphicsAllocation *chainedBatchBuffer = nullptr;
408408

409409
if (submitTask) {
410-
programMediaSampler(commandStreamTask, dispatchFlags);
411410
this->addBatchBufferEnd(commandStreamTask, &bbEndLocation);
412411
this->emitNoop(commandStreamTask, bbEndPaddingSize);
413412
this->alignToCacheLine(commandStreamTask);
@@ -812,4 +811,9 @@ template <typename GfxFamily>
812811
uint64_t CommandStreamReceiverHw<GfxFamily>::getScratchPatchAddress() {
813812
return scratchSpaceController->getScratchPatchAddress();
814813
}
814+
815+
template <typename GfxFamily>
816+
bool CommandStreamReceiverHw<GfxFamily>::detectInitProgrammingFlagsRequired(const DispatchFlags &dispatchFlags) const {
817+
return DebugManager.flags.ForceCsrReprogramming.get();
818+
}
815819
} // namespace OCLRT

0 commit comments

Comments
 (0)