[18/n] Internal 4GB allocator.

- Remove IH from preemption functions.
- This is one of parts of complete IH removal.

Change-Id: Ic19a6e2e1f5d9df25785c2c982c52b581b57a605
This commit is contained in:
Mrozek, Michal
2018-03-27 09:58:00 +02:00
committed by sys_ocldev
parent eb6c8aeec9
commit 3958cd909a
8 changed files with 12 additions and 117 deletions

View File

@@ -78,7 +78,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
uint64_t generalStateBase);
protected:
void programPreemption(LinearStream &csr, DispatchFlags &dispatchFlags, const LinearStream &ih);
void programPreemption(LinearStream &csr, DispatchFlags &dispatchFlags);
void programL3(LinearStream &csr, DispatchFlags &dispatchFlags, uint32_t &newL3Config);
void programPreamble(LinearStream &csr, DispatchFlags &dispatchFlags, uint32_t &newL3Config);
void programPipelineSelect(LinearStream &csr, DispatchFlags &dispatchFlags);

View File

@@ -194,7 +194,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
auto commandStreamStartCSR = commandStreamCSR.getUsed();
initPageTableManagerRegisters(commandStreamCSR);
programPreemption(commandStreamCSR, dispatchFlags, ih);
programPreemption(commandStreamCSR, dispatchFlags);
programCoherency(commandStreamCSR, dispatchFlags);
programL3(commandStreamCSR, dispatchFlags, newL3Config);
programPipelineSelect(commandStreamCSR, dispatchFlags);
@@ -592,10 +592,9 @@ inline void CommandStreamReceiverHw<GfxFamily>::waitForTaskCountWithKmdNotifyFal
}
template <typename GfxFamily>
inline void CommandStreamReceiverHw<GfxFamily>::programPreemption(LinearStream &csr, DispatchFlags &dispatchFlags,
const LinearStream &ih) {
inline void CommandStreamReceiverHw<GfxFamily>::programPreemption(LinearStream &csr, DispatchFlags &dispatchFlags) {
PreemptionHelper::programCmdStream<GfxFamily>(csr, dispatchFlags.preemptionMode, this->lastPreemptionMode, preemptionCsrAllocation,
ih, *memoryManager->device);
*memoryManager->device);
this->lastPreemptionMode = dispatchFlags.preemptionMode;
}

View File

@@ -127,16 +127,6 @@ void PreemptionHelper::initializeInstructionHeapSipKernelReservedBlock(LinearStr
UNRECOVERABLE_IF(err != 0);
}
// verify that SIP CSR kernel resides at the begining of the InstructionHeap
bool PreemptionHelper::isValidInstructionHeapForMidThreadPreemption(const LinearStream &ih, Device &device) {
const SipKernel &sip = BuiltIns::getInstance().getSipKernel(SipKernelType::Csr, device);
if (ih.getUsed() < sip.getBinarySize()) {
return false;
}
return (0 == memcmp(ih.getCpuBase(), sip.getBinary(), sip.getBinarySize()));
}
PreemptionMode PreemptionHelper::getDefaultPreemptionMode(const HardwareInfo &hwInfo) {
return DebugManager.flags.ForcePreemptionMode.get() == -1
? hwInfo.capabilityTable.defaultPreemptionMode

View File

@@ -43,7 +43,6 @@ class PreemptionHelper {
static size_t getInstructionHeapSipKernelReservedSize(Device &device);
static void initializeInstructionHeapSipKernelReservedBlock(LinearStream &ih, Device &device);
static bool isValidInstructionHeapForMidThreadPreemption(const LinearStream &ih, Device &device);
template <typename GfxFamily>
static size_t getRequiredPreambleSize(const Device &device);
@@ -56,7 +55,7 @@ class PreemptionHelper {
template <typename GfxFamily>
static void programCmdStream(LinearStream &cmdStream, PreemptionMode newPreemptionMode, PreemptionMode oldPreemptionMode,
GraphicsAllocation *preemptionCsr, const LinearStream &ih, Device &device);
GraphicsAllocation *preemptionCsr, Device &device);
template <typename GfxFamily>
static size_t getPreemptionWaCsSize(const Device &device);

View File

@@ -94,10 +94,8 @@ void PreemptionHelper::programPreamble(LinearStream &preambleCmdStream, const De
template <typename GfxFamily>
void PreemptionHelper::programCmdStream(LinearStream &cmdStream,
PreemptionMode newPreemptionMode, PreemptionMode oldPreemptionMode,
GraphicsAllocation *preemptionCsr,
const LinearStream &ih, Device &device) {
GraphicsAllocation *preemptionCsr, Device &device) {
if (oldPreemptionMode == newPreemptionMode) {
DEBUG_BREAK_IF((newPreemptionMode == PreemptionMode::MidThread) && (false == isValidInstructionHeapForMidThreadPreemption(ih, device)));
return;
}

View File

@@ -41,7 +41,7 @@ struct PreemptionConfig<GfxFamily> {
template <>
void PreemptionHelper::programCmdStream<GfxFamily>(LinearStream &cmdStream, PreemptionMode newPreemptionMode, PreemptionMode oldPreemptionMode,
GraphicsAllocation *preemptionCsr, const LinearStream &ih, Device &device) {
GraphicsAllocation *preemptionCsr, Device &device) {
if (newPreemptionMode == oldPreemptionMode) {
return;
}

View File

@@ -46,7 +46,7 @@ struct PreemptionConfig<GfxFamily> {
template void PreemptionHelper::programCmdStream<GfxFamily>(LinearStream &cmdStream,
PreemptionMode newPreemptionMode, PreemptionMode oldPreemptionMode,
GraphicsAllocation *preemptionCsr,
const LinearStream &ih, Device &device);
Device &device);
template void PreemptionHelper::programPreamble<GfxFamily>(LinearStream &preambleCmdStream, const Device &device, const GraphicsAllocation *preemptionCsr);
template size_t PreemptionHelper::getRequiredPreambleSize<GfxFamily>(const Device &device);
template size_t PreemptionHelper::getRequiredCmdStreamSize<GfxFamily>(PreemptionMode newPreemptionMode, PreemptionMode oldPreemptionMode);