Skip to content

Commit 0867682

Browse files
committed
Init MI_SEMAPHORE_WAIT with memory polling mode
Change-Id: Id7e4ca279568bf3366ab958ab3bb9af8454f5045
1 parent 5e25f81 commit 0867682

12 files changed

+17
-3
lines changed

runtime/gen10/command_stream_receiver_hw_gen10.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,5 @@ const Family::MEDIA_STATE_FLUSH Family::cmdInitMediaStateFlush = Family::MEDIA_S
6565
const Family::MI_BATCH_BUFFER_START Family::cmdInitBatchBufferStart = Family::MI_BATCH_BUFFER_START::sInit();
6666
const Family::MI_BATCH_BUFFER_END Family::cmdInitBatchBufferEnd = Family::MI_BATCH_BUFFER_END::sInit();
6767
const Family::PIPE_CONTROL Family::cmdInitPipeControl = Family::PIPE_CONTROL::sInit();
68+
const Family::MI_SEMAPHORE_WAIT Family::cmdInitMiSemaphoreWait = Family::MI_SEMAPHORE_WAIT::sInit();
6869
} // namespace OCLRT

runtime/gen10/hw_cmds.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ struct CNLFamily : public GEN10 {
3333
static const MI_BATCH_BUFFER_END cmdInitBatchBufferEnd;
3434
static const MI_BATCH_BUFFER_START cmdInitBatchBufferStart;
3535
static const PIPE_CONTROL cmdInitPipeControl;
36+
static const MI_SEMAPHORE_WAIT cmdInitMiSemaphoreWait;
3637

3738
static constexpr bool supportsCmdSet(GFXCORE_FAMILY cmdSetBaseFamily) {
3839
return cmdSetBaseFamily == IGFX_GEN8_CORE;

runtime/gen10/hw_cmds_generated_patched.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ typedef struct tagMI_SEMAPHORE_WAIT {
434434
TheStructure.Common.DwordLength = DWORD_LENGTH_EXCLUDES_DWORD_0_1;
435435
TheStructure.Common.CompareOperation = COMPARE_OPERATION_SAD_GREATER_THAN_SDD;
436436
TheStructure.Common.WaitMode = WAIT_MODE_SIGNAL_MODE;
437-
TheStructure.Common.RegisterPollMode = REGISTER_POLL_MODE_REGISTER_POLL;
437+
TheStructure.Common.RegisterPollMode = REGISTER_POLL_MODE_MEMORY_POLL;
438438
TheStructure.Common.MemoryType = MEMORY_TYPE_PER_PROCESS_GRAPHICS_ADDRESS;
439439
TheStructure.Common.MiCommandOpcode = MI_COMMAND_OPCODE_MI_SEMAPHORE_WAIT;
440440
TheStructure.Common.CommandType = COMMAND_TYPE_MI_COMMAND;

runtime/gen8/command_stream_receiver_hw_gen8.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ const Family::MEDIA_STATE_FLUSH Family::cmdInitMediaStateFlush = Family::MEDIA_S
5858
const Family::MI_BATCH_BUFFER_START Family::cmdInitBatchBufferStart = Family::MI_BATCH_BUFFER_START::sInit();
5959
const Family::MI_BATCH_BUFFER_END Family::cmdInitBatchBufferEnd = Family::MI_BATCH_BUFFER_END::sInit();
6060
const Family::PIPE_CONTROL Family::cmdInitPipeControl = Family::PIPE_CONTROL::sInit();
61+
const Family::MI_SEMAPHORE_WAIT Family::cmdInitMiSemaphoreWait = Family::MI_SEMAPHORE_WAIT::sInit();
6162
} // namespace OCLRT

runtime/gen8/hw_cmds_base.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ struct BDWFamily : public GEN8 {
3232
static const MI_BATCH_BUFFER_END cmdInitBatchBufferEnd;
3333
static const MI_BATCH_BUFFER_START cmdInitBatchBufferStart;
3434
static const PIPE_CONTROL cmdInitPipeControl;
35+
static const MI_SEMAPHORE_WAIT cmdInitMiSemaphoreWait;
3536

3637
static constexpr bool supportsCmdSet(GFXCORE_FAMILY cmdSetBaseFamily) {
3738
return cmdSetBaseFamily == IGFX_GEN8_CORE;

runtime/gen9/command_stream_receiver_hw_gen9.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,5 @@ const Family::MEDIA_STATE_FLUSH Family::cmdInitMediaStateFlush = Family::MEDIA_S
5757
const Family::MI_BATCH_BUFFER_START Family::cmdInitBatchBufferStart = Family::MI_BATCH_BUFFER_START::sInit();
5858
const Family::MI_BATCH_BUFFER_END Family::cmdInitBatchBufferEnd = Family::MI_BATCH_BUFFER_END::sInit();
5959
const Family::PIPE_CONTROL Family::cmdInitPipeControl = Family::PIPE_CONTROL::sInit();
60+
const Family::MI_SEMAPHORE_WAIT Family::cmdInitMiSemaphoreWait = Family::MI_SEMAPHORE_WAIT::sInit();
6061
} // namespace OCLRT

runtime/gen9/hw_cmds_base.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ struct SKLFamily : public GEN9 {
3333
static const MI_BATCH_BUFFER_END cmdInitBatchBufferEnd;
3434
static const MI_BATCH_BUFFER_START cmdInitBatchBufferStart;
3535
static const PIPE_CONTROL cmdInitPipeControl;
36+
static const MI_SEMAPHORE_WAIT cmdInitMiSemaphoreWait;
3637

3738
static constexpr bool supportsCmdSet(GFXCORE_FAMILY cmdSetBaseFamily) {
3839
return cmdSetBaseFamily == IGFX_GEN8_CORE;

runtime/helpers/kernel_commands.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ void KernelCommandsHelper<GfxFamily>::programMiSemaphoreWait(LinearStream &comma
377377
using MI_SEMAPHORE_WAIT = typename GfxFamily::MI_SEMAPHORE_WAIT;
378378

379379
auto miSemaphoreCmd = commandStream.getSpaceForCmd<MI_SEMAPHORE_WAIT>();
380-
*miSemaphoreCmd = MI_SEMAPHORE_WAIT::sInit();
380+
*miSemaphoreCmd = GfxFamily::cmdInitMiSemaphoreWait;
381381
miSemaphoreCmd->setCompareOperation(MI_SEMAPHORE_WAIT::COMPARE_OPERATION::COMPARE_OPERATION_SAD_NOT_EQUAL_SDD);
382382
miSemaphoreCmd->setSemaphoreDataDword(compareData);
383383
miSemaphoreCmd->setSemaphoreGraphicsAddress(compareAddress);

unit_tests/gen10/command_stream_receiver_hw_tests_gen10.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@ GEN10TEST_F(CommandStreamReceiverHwTestGen10, GivenKernelWithSlmWhenPreviousNOSL
3434
GEN10TEST_F(CommandStreamReceiverHwTestGen10, GivenBlockedKernelWithSlmWhenPreviousNOSLML3WasSentThenProgramL3WithSLML3ConfigAfterUnblocking) {
3535
givenBlockedKernelWithSlmWhenPreviousNOSLML3WasSentThenProgramL3WithSLML3ConfigAfterUnblockingImpl();
3636
}
37+
38+
GEN10TEST_F(CommandStreamReceiverHwTestGen10, whenProgrammingMiSemaphoreWaitThenSetRegisterPollModeMemoryPoll) {
39+
using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT;
40+
MI_SEMAPHORE_WAIT miSemaphoreWait = FamilyType::cmdInitMiSemaphoreWait;
41+
EXPECT_EQ(MI_SEMAPHORE_WAIT::REGISTER_POLL_MODE::REGISTER_POLL_MODE_MEMORY_POLL, miSemaphoreWait.getRegisterPollMode());
42+
}

unit_tests/helpers/kernel_commands_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ HWTEST_F(KernelCommandsHelperTests, givenCompareAddressAndDataWhenProgrammingSem
10951095
uint8_t buffer[1024] = {};
10961096
LinearStream cmdStream(buffer, 1024);
10971097

1098-
MI_SEMAPHORE_WAIT referenceCommand = MI_SEMAPHORE_WAIT::sInit();
1098+
MI_SEMAPHORE_WAIT referenceCommand = FamilyType::cmdInitMiSemaphoreWait;
10991099
referenceCommand.setCompareOperation(MI_SEMAPHORE_WAIT::COMPARE_OPERATION::COMPARE_OPERATION_SAD_NOT_EQUAL_SDD);
11001100
referenceCommand.setSemaphoreDataDword(compareData);
11011101
referenceCommand.setSemaphoreGraphicsAddress(compareAddress);

0 commit comments

Comments
 (0)