mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
Pass linear stream to encode MMIO
Change-Id: I07bafc49676e31fb457a63f4655a98fd0c793389 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
4549bafb15
commit
536c50234f
@@ -95,10 +95,10 @@ void CommandListCoreFamily<gfxCoreFamily>::appendEventForProfiling(ze_event_hand
|
||||
commandContainer.addToResidencyContainer(&event->getAllocation());
|
||||
if (beforeWalker) {
|
||||
timeStampAddress = event->getGpuAddress() + event->getOffsetOfEventTimestampRegister(Event::GLOBAL_START);
|
||||
NEO::EncodeStoreMMIO<GfxFamily>::encode(commandContainer, REG_GLOBAL_TIMESTAMP_LDW, timeStampAddress);
|
||||
NEO::EncodeStoreMMIO<GfxFamily>::encode(*commandContainer.getCommandStream(), REG_GLOBAL_TIMESTAMP_LDW, timeStampAddress);
|
||||
|
||||
timeStampAddress = event->getGpuAddress() + event->getOffsetOfEventTimestampRegister(Event::CONTEXT_START);
|
||||
NEO::EncodeStoreMMIO<GfxFamily>::encode(commandContainer, GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW, timeStampAddress);
|
||||
NEO::EncodeStoreMMIO<GfxFamily>::encode(*commandContainer.getCommandStream(), GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW, timeStampAddress);
|
||||
} else {
|
||||
|
||||
timeStampAddress = event->getGpuAddress() + event->getOffsetOfEventTimestampRegister(Event::GLOBAL_END);
|
||||
@@ -116,7 +116,7 @@ void CommandListCoreFamily<gfxCoreFamily>::appendEventForProfiling(ze_event_hand
|
||||
args);
|
||||
|
||||
timeStampAddress = event->getGpuAddress() + event->getOffsetOfEventTimestampRegister(Event::CONTEXT_END);
|
||||
NEO::EncodeStoreMMIO<GfxFamily>::encode(commandContainer, GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW, timeStampAddress);
|
||||
NEO::EncodeStoreMMIO<GfxFamily>::encode(*commandContainer.getCommandStream(), GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW, timeStampAddress);
|
||||
|
||||
if (args.dcFlushEnable) {
|
||||
NEO::MemorySynchronizationCommands<GfxFamily>::addPipeControl(*commandContainer.getCommandStream(), args);
|
||||
|
||||
@@ -145,7 +145,7 @@ struct EncodeStoreMMIO {
|
||||
using MI_STORE_REGISTER_MEM = typename GfxFamily::MI_STORE_REGISTER_MEM;
|
||||
|
||||
static const size_t size = sizeof(MI_STORE_REGISTER_MEM);
|
||||
static void encode(CommandContainer &container, uint32_t offset, uint64_t address);
|
||||
static void encode(LinearStream &csr, uint32_t offset, uint64_t address);
|
||||
};
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
@@ -78,7 +78,7 @@ void EncodeMathMMIO<Family>::encodeMulRegVal(CommandContainer &container, uint32
|
||||
EncodeSetMMIO<Family>::encodeREG(container, CS_GPR_R0, CS_GPR_R2);
|
||||
i++;
|
||||
}
|
||||
EncodeStoreMMIO<Family>::encode(container, CS_GPR_R1, dstAddress);
|
||||
EncodeStoreMMIO<Family>::encode(*container.getCommandStream(), CS_GPR_R1, dstAddress);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -213,7 +213,7 @@ void EncodeIndirectParams<Family>::setGroupCountIndirect(CommandContainer &conta
|
||||
if (NEO::isUndefinedOffset(offsets[i])) {
|
||||
continue;
|
||||
}
|
||||
EncodeStoreMMIO<Family>::encode(container, GPUGPU_DISPATCHDIM[i], ptrOffset(reinterpret_cast<uint64_t>(crossThreadAddress), offsets[i]));
|
||||
EncodeStoreMMIO<Family>::encode(*container.getCommandStream(), GPUGPU_DISPATCHDIM[i], ptrOffset(reinterpret_cast<uint64_t>(crossThreadAddress), offsets[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,11 +255,11 @@ void EncodeSetMMIO<Family>::encodeREG(CommandContainer &container, uint32_t dstO
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
void EncodeStoreMMIO<Family>::encode(CommandContainer &container, uint32_t offset, uint64_t address) {
|
||||
void EncodeStoreMMIO<Family>::encode(LinearStream &csr, uint32_t offset, uint64_t address) {
|
||||
MI_STORE_REGISTER_MEM cmd = Family::cmdInitStoreRegisterMem;
|
||||
cmd.setRegisterAddress(offset);
|
||||
cmd.setMemoryAddress(address);
|
||||
auto buffer = container.getCommandStream()->getSpaceForCmd<MI_STORE_REGISTER_MEM>();
|
||||
auto buffer = csr.getSpaceForCmd<MI_STORE_REGISTER_MEM>();
|
||||
*buffer = cmd;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user