mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 17:41:26 +08:00
Select correct heap base address for ISA
Change-Id: I400f965faa4615519729756daa78350a46c46ff2 Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
1d4568e548
commit
2a69b1ed78
@@ -87,7 +87,11 @@ ErrorCode CommandContainer::initialize(Device *device) {
|
||||
indirectHeaps[i] = std::make_unique<IndirectHeap>(allocationIndirectHeaps[i], requireInternalHeap);
|
||||
}
|
||||
|
||||
instructionHeapBaseAddress = device->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), allocationIndirectHeaps[IndirectHeap::Type::INDIRECT_OBJECT]->isAllocatedInLocalMemoryPool());
|
||||
auto &hwHelper = HwHelper::get(getDevice()->getHardwareInfo().platform.eRenderCoreFamily);
|
||||
|
||||
indirectObjectHeapBaseAddress = device->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), allocationIndirectHeaps[IndirectHeap::Type::INDIRECT_OBJECT]->isAllocatedInLocalMemoryPool());
|
||||
|
||||
instructionHeapBaseAddress = device->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), !hwHelper.useSystemMemoryPlacementForISA(getDevice()->getHardwareInfo()));
|
||||
|
||||
reserveBindlessOffsets(*indirectHeaps[IndirectHeap::Type::SURFACE_STATE]);
|
||||
|
||||
|
||||
@@ -74,6 +74,8 @@ class CommandContainer : public NonCopyableOrMovableClass {
|
||||
|
||||
uint64_t getInstructionHeapBaseAddress() const { return instructionHeapBaseAddress; }
|
||||
|
||||
uint64_t getIndirectObjectHeapBaseAddress() const { return indirectObjectHeapBaseAddress; }
|
||||
|
||||
void *getHeapSpaceAllowGrow(HeapType heapType, size_t size);
|
||||
|
||||
ErrorCode initialize(Device *device);
|
||||
@@ -108,6 +110,7 @@ class CommandContainer : public NonCopyableOrMovableClass {
|
||||
CmdBufferContainer cmdBufferAllocations;
|
||||
GraphicsAllocation *allocationIndirectHeaps[HeapType::NUM_TYPES] = {};
|
||||
uint64_t instructionHeapBaseAddress = 0u;
|
||||
uint64_t indirectObjectHeapBaseAddress = 0u;
|
||||
uint32_t dirtyHeaps = std::numeric_limits<uint32_t>::max();
|
||||
uint32_t numIddsPerBlock = 64;
|
||||
|
||||
|
||||
@@ -351,6 +351,7 @@ void EncodeStateBaseAddress<Family>::encode(CommandContainer &container, STATE_B
|
||||
0,
|
||||
false,
|
||||
(gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1),
|
||||
container.getIndirectObjectHeapBaseAddress(),
|
||||
container.getInstructionHeapBaseAddress(),
|
||||
false,
|
||||
gmmHelper,
|
||||
|
||||
@@ -342,9 +342,9 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
auto isStateBaseAddressDirty = dshDirty || iohDirty || sshDirty || stateBaseAddressDirty;
|
||||
|
||||
auto mocsIndex = latestSentStatelessMocsConfig;
|
||||
auto &hwHelper = HwHelper::get(peekHwInfo().platform.eRenderCoreFamily);
|
||||
|
||||
if (dispatchFlags.l3CacheSettings != L3CachingSettings::NotApplicable) {
|
||||
auto &hwHelper = HwHelper::get(peekHwInfo().platform.eRenderCoreFamily);
|
||||
auto l3On = dispatchFlags.l3CacheSettings != L3CachingSettings::l3CacheOff;
|
||||
auto l1On = dispatchFlags.l3CacheSettings == L3CachingSettings::l3AndL1On;
|
||||
mocsIndex = hwHelper.getMocsIndex(*device.getGmmHelper(), l3On, l1On);
|
||||
@@ -375,6 +375,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
auto stateBaseAddressCmdOffset = commandStreamCSR.getUsed();
|
||||
auto pCmd = static_cast<STATE_BASE_ADDRESS *>(commandStreamCSR.getSpace(sizeof(STATE_BASE_ADDRESS)));
|
||||
STATE_BASE_ADDRESS cmd;
|
||||
auto instructionHeapBaseAddress = getMemoryManager()->getInternalHeapBaseAddress(rootDeviceIndex, !hwHelper.useSystemMemoryPlacementForISA(peekHwInfo()));
|
||||
StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(
|
||||
&cmd,
|
||||
&dsh,
|
||||
@@ -384,6 +385,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
true,
|
||||
mocsIndex,
|
||||
getMemoryManager()->getInternalHeapBaseAddress(rootDeviceIndex, ioh.getGraphicsAllocation()->isAllocatedInLocalMemoryPool()),
|
||||
instructionHeapBaseAddress,
|
||||
true,
|
||||
device.getGmmHelper(),
|
||||
isMultiOsContextCapable());
|
||||
|
||||
@@ -494,6 +494,6 @@ bool HwHelperHw<GfxFamily>::useOnlyGlobalTimestamps() const {
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool HwHelperHw<GfxFamily>::useSystemMemoryPlacementForISA(const HardwareInfo &hwInfo) const {
|
||||
return false;
|
||||
return !hwInfo.featureTable.ftrLocalMemory;
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
@@ -28,7 +28,8 @@ struct StateBaseAddressHelper {
|
||||
uint64_t generalStateBase,
|
||||
bool setGeneralStateBaseAddress,
|
||||
uint32_t statelessMocsIndex,
|
||||
uint64_t internalHeapBase,
|
||||
uint64_t indirectObjectHeapBaseAddress,
|
||||
uint64_t instructionHeapBaseAddress,
|
||||
bool setInstructionStateBaseAddress,
|
||||
GmmHelper *gmmHelper,
|
||||
bool isMultiOsContextCapable);
|
||||
@@ -37,7 +38,7 @@ struct StateBaseAddressHelper {
|
||||
STATE_BASE_ADDRESS *stateBaseAddress,
|
||||
const IndirectHeap *ssh,
|
||||
bool setGeneralStateBaseAddress,
|
||||
uint64_t internalHeapBase,
|
||||
uint64_t indirectObjectHeapBaseAddress,
|
||||
GmmHelper *gmmHelper,
|
||||
bool isMultiOsContextCapable);
|
||||
|
||||
|
||||
@@ -23,7 +23,8 @@ void StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(
|
||||
uint64_t generalStateBase,
|
||||
bool setGeneralStateBaseAddress,
|
||||
uint32_t statelessMocsIndex,
|
||||
uint64_t internalHeapBase,
|
||||
uint64_t indirectObjectHeapBaseAddress,
|
||||
uint64_t instructionHeapBaseAddress,
|
||||
bool setInstructionStateBaseAddress,
|
||||
GmmHelper *gmmHelper,
|
||||
bool isMultiOsContextCapable) {
|
||||
@@ -51,7 +52,7 @@ void StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(
|
||||
|
||||
if (setInstructionStateBaseAddress) {
|
||||
stateBaseAddress->setInstructionBaseAddressModifyEnable(true);
|
||||
stateBaseAddress->setInstructionBaseAddress(internalHeapBase);
|
||||
stateBaseAddress->setInstructionBaseAddress(instructionHeapBaseAddress);
|
||||
stateBaseAddress->setInstructionBufferSizeModifyEnable(true);
|
||||
stateBaseAddress->setInstructionBufferSize(MemoryConstants::sizeOf4GBinPageEntities);
|
||||
stateBaseAddress->setInstructionMemoryObjectControlState(gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER));
|
||||
@@ -73,7 +74,7 @@ void StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(
|
||||
|
||||
stateBaseAddress->setStatelessDataPortAccessMemoryObjectControlState(statelessMocsIndex);
|
||||
|
||||
appendStateBaseAddressParameters(stateBaseAddress, ssh, setGeneralStateBaseAddress, internalHeapBase, gmmHelper, isMultiOsContextCapable);
|
||||
appendStateBaseAddressParameters(stateBaseAddress, ssh, setGeneralStateBaseAddress, indirectObjectHeapBaseAddress, gmmHelper, isMultiOsContextCapable);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -14,7 +14,7 @@ void StateBaseAddressHelper<GfxFamily>::appendStateBaseAddressParameters(
|
||||
STATE_BASE_ADDRESS *stateBaseAddress,
|
||||
const IndirectHeap *ssh,
|
||||
bool setGeneralStateBaseAddress,
|
||||
uint64_t internalHeapBase,
|
||||
uint64_t indirectObjectHeapBaseAddress,
|
||||
GmmHelper *gmmHelper,
|
||||
bool isMultiOsContextCapable) {
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ void StateBaseAddressHelper<GfxFamily>::appendStateBaseAddressParameters(
|
||||
STATE_BASE_ADDRESS *stateBaseAddress,
|
||||
const IndirectHeap *ssh,
|
||||
bool setGeneralStateBaseAddress,
|
||||
uint64_t internalHeapBase,
|
||||
uint64_t indirectObjectHeapBaseAddress,
|
||||
GmmHelper *gmmHelper,
|
||||
bool isMultiOsContextCapable) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user