mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
Add Clear SLM workaround for BDW
- set ProtectedMemoryDisable in PC prior to setting new L3 config Change-Id: I2ecbfe9535ef45159b48fffa41faad66db55d074
This commit is contained in:
committed by
sys_ocldev
parent
4cb86b4045
commit
a1a224c3bc
@@ -92,6 +92,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
|
|||||||
|
|
||||||
void addPipeControlWA(LinearStream &commandStream, bool flushDC);
|
void addPipeControlWA(LinearStream &commandStream, bool flushDC);
|
||||||
void addDcFlushToPipeControl(typename GfxFamily::PIPE_CONTROL *pCmd, bool flushDC);
|
void addDcFlushToPipeControl(typename GfxFamily::PIPE_CONTROL *pCmd, bool flushDC);
|
||||||
|
void addClearSLMWorkAround(typename GfxFamily::PIPE_CONTROL *pCmd);
|
||||||
PIPE_CONTROL *addPipeControlCmd(LinearStream &commandStream);
|
PIPE_CONTROL *addPipeControlCmd(LinearStream &commandStream);
|
||||||
|
|
||||||
uint64_t getScratchPatchAddress();
|
uint64_t getScratchPatchAddress();
|
||||||
|
|||||||
@@ -653,6 +653,7 @@ inline void CommandStreamReceiverHw<GfxFamily>::programL3(LinearStream &csr, Dis
|
|||||||
*pCmd = GfxFamily::cmdInitPipeControl;
|
*pCmd = GfxFamily::cmdInitPipeControl;
|
||||||
pCmd->setCommandStreamerStallEnable(true);
|
pCmd->setCommandStreamerStallEnable(true);
|
||||||
pCmd->setDcFlushEnable(true);
|
pCmd->setDcFlushEnable(true);
|
||||||
|
addClearSLMWorkAround(pCmd);
|
||||||
|
|
||||||
PreambleHelper<GfxFamily>::programL3(&csr, newL3Config);
|
PreambleHelper<GfxFamily>::programL3(&csr, newL3Config);
|
||||||
this->lastSentL3Config = newL3Config;
|
this->lastSentL3Config = newL3Config;
|
||||||
@@ -727,4 +728,8 @@ void CommandStreamReceiverHw<GfxFamily>::resetKmdNotifyHelper(KmdNotifyHelper *n
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename GfxFamily>
|
||||||
|
void CommandStreamReceiverHw<GfxFamily>::addClearSLMWorkAround(typename GfxFamily::PIPE_CONTROL *pCmd) {
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace OCLRT
|
} // namespace OCLRT
|
||||||
|
|||||||
@@ -58,6 +58,11 @@ void populateFactoryTable<CommandStreamReceiverHw<Family>>() {
|
|||||||
commandStreamReceiverFactory[gfxCore] = DeviceCommandStreamReceiver<Family>::create;
|
commandStreamReceiverFactory[gfxCore] = DeviceCommandStreamReceiver<Family>::create;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <>
|
||||||
|
void CommandStreamReceiverHw<Family>::addClearSLMWorkAround(Family::PIPE_CONTROL *pCmd) {
|
||||||
|
pCmd->setProtectedMemoryDisable(1);
|
||||||
|
}
|
||||||
|
|
||||||
// Explicitly instantiate CommandStreamReceiverHw for this device family
|
// Explicitly instantiate CommandStreamReceiverHw for this device family
|
||||||
template class CommandStreamReceiverHw<Family>;
|
template class CommandStreamReceiverHw<Family>;
|
||||||
|
|
||||||
|
|||||||
@@ -49,3 +49,30 @@ GEN8TEST_F(CommandStreamReceiverHwTestGen8, GivenKernelWithSlmWhenPreviousNOSLML
|
|||||||
GEN8TEST_F(CommandStreamReceiverHwTestGen8, GivenBlockedKernelWithSlmWhenPreviousNOSLML3WasSentOnThenProgramL3WithSLML3ConfigAfterUnblocking) {
|
GEN8TEST_F(CommandStreamReceiverHwTestGen8, GivenBlockedKernelWithSlmWhenPreviousNOSLML3WasSentOnThenProgramL3WithSLML3ConfigAfterUnblocking) {
|
||||||
givenBlockedKernelWithSlmWhenPreviousNOSLML3WasSentThenProgramL3WithSLML3ConfigAfterUnblockingImpl();
|
givenBlockedKernelWithSlmWhenPreviousNOSLML3WasSentThenProgramL3WithSLML3ConfigAfterUnblockingImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GEN8TEST_F(CommandStreamReceiverHwTestGen8, GivenChangedL3ConfigWhenL3IsProgrammedThenClearSLMWorkAroundIsAdded) {
|
||||||
|
MockCsrHw2<FamilyType> csr(pDevice->getHardwareInfo());
|
||||||
|
csr.csrSizeRequestFlags.l3ConfigChanged = true;
|
||||||
|
csr.isPreambleSent = true;
|
||||||
|
|
||||||
|
size_t bufferSize = 2 * sizeof(typename FamilyType::MI_LOAD_REGISTER_IMM) + sizeof(typename FamilyType::PIPE_CONTROL);
|
||||||
|
void *buffer = alignedMalloc(bufferSize, 64);
|
||||||
|
|
||||||
|
LinearStream stream(buffer, bufferSize);
|
||||||
|
DispatchFlags flags;
|
||||||
|
uint32_t l3Config = 0x12345678;
|
||||||
|
|
||||||
|
csr.programL3(stream, flags, l3Config);
|
||||||
|
|
||||||
|
this->parseCommands<FamilyType>(stream);
|
||||||
|
|
||||||
|
typename FamilyType::PIPE_CONTROL *pc = getCommand<typename FamilyType::PIPE_CONTROL>();
|
||||||
|
ASSERT_NE(nullptr, pc);
|
||||||
|
EXPECT_TRUE(pc->getProtectedMemoryDisable() != 0);
|
||||||
|
|
||||||
|
typename FamilyType::MI_LOAD_REGISTER_IMM *lri = getCommand<typename FamilyType::MI_LOAD_REGISTER_IMM>();
|
||||||
|
ASSERT_NE(nullptr, lri);
|
||||||
|
EXPECT_EQ(l3Config, lri->getDataDword());
|
||||||
|
|
||||||
|
alignedFree(buffer);
|
||||||
|
}
|
||||||
|
|||||||
@@ -149,12 +149,15 @@ template <typename GfxFamily>
|
|||||||
class MockCsrHw2 : public CommandStreamReceiverHw<GfxFamily> {
|
class MockCsrHw2 : public CommandStreamReceiverHw<GfxFamily> {
|
||||||
public:
|
public:
|
||||||
using CommandStreamReceiverHw<GfxFamily>::flushStamp;
|
using CommandStreamReceiverHw<GfxFamily>::flushStamp;
|
||||||
|
using CommandStreamReceiverHw<GfxFamily>::programL3;
|
||||||
|
using CommandStreamReceiverHw<GfxFamily>::csrSizeRequestFlags;
|
||||||
using CommandStreamReceiver::commandStream;
|
using CommandStreamReceiver::commandStream;
|
||||||
using CommandStreamReceiver::dispatchMode;
|
using CommandStreamReceiver::dispatchMode;
|
||||||
using CommandStreamReceiver::lastSentCoherencyRequest;
|
using CommandStreamReceiver::lastSentCoherencyRequest;
|
||||||
using CommandStreamReceiver::mediaVfeStateDirty;
|
using CommandStreamReceiver::mediaVfeStateDirty;
|
||||||
using CommandStreamReceiver::taskCount;
|
using CommandStreamReceiver::taskCount;
|
||||||
using CommandStreamReceiver::taskLevel;
|
using CommandStreamReceiver::taskLevel;
|
||||||
|
using CommandStreamReceiver::isPreambleSent;
|
||||||
|
|
||||||
MockCsrHw2(const HardwareInfo &hwInfoIn) : CommandStreamReceiverHw<GfxFamily>(hwInfoIn) {}
|
MockCsrHw2(const HardwareInfo &hwInfoIn) : CommandStreamReceiverHw<GfxFamily>(hwInfoIn) {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user