refactor: remove not needed code

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2025-11-28 10:19:50 +00:00
committed by Compute-Runtime-Automation
parent 231cfdc472
commit 68d01f398f
24 changed files with 20 additions and 794 deletions

View File

@@ -263,7 +263,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
const IndirectHeap *ssh,
DispatchFlags &dispatchFlags,
Device &device, LinearStream &commandStreamCSR,
bool force32BitAllocations, bool sshDirty, bool bindingTablePoolCommandNeeded);
bool sshDirty, bool bindingTablePoolCommandNeeded);
inline void programStateBaseAddressCommon(const IndirectHeap *dsh,
const IndirectHeap *ioh,
const IndirectHeap *ssh,

View File

@@ -1687,14 +1687,12 @@ inline void CommandStreamReceiverHw<GfxFamily>::programStateBaseAddress(const In
surfaceStateBaseAddress, surfaceStateSize);
}
auto force32BitAllocations = getMemoryManager()->peekForce32BitAllocations();
stateBaseAddressDirty |= ((gsbaFor32BitProgrammed ^ dispatchFlags.gsba32BitRequired) && force32BitAllocations);
bool isStateBaseAddressDirty = dshDirty || iohDirty || sshDirty || stateBaseAddressDirty;
handleStateBaseAddressStateTransition(dispatchFlags, isStateBaseAddressDirty);
// reprogram state base address command if required
if (isStateBaseAddressDirty) {
reprogramStateBaseAddress(dsh, ioh, ssh, dispatchFlags, device, commandStreamCSR, force32BitAllocations, sshDirty, bindingTablePoolCommandNeeded);
reprogramStateBaseAddress(dsh, ioh, ssh, dispatchFlags, device, commandStreamCSR, sshDirty, bindingTablePoolCommandNeeded);
}
if (hasDsh) {
@@ -1718,16 +1716,12 @@ inline void CommandStreamReceiverHw<GfxFamily>::programStateBaseAddress(const In
}
template <typename GfxFamily>
inline void CommandStreamReceiverHw<GfxFamily>::reprogramStateBaseAddress(const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh, DispatchFlags &dispatchFlags, Device &device, LinearStream &commandStreamCSR, bool force32BitAllocations, bool sshDirty, bool bindingTablePoolCommandNeeded) {
inline void CommandStreamReceiverHw<GfxFamily>::reprogramStateBaseAddress(const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh, DispatchFlags &dispatchFlags, Device &device, LinearStream &commandStreamCSR, bool sshDirty, bool bindingTablePoolCommandNeeded) {
uint64_t newGshBase = 0;
gsbaFor32BitProgrammed = false;
if (is64bit && scratchSpaceController->getScratchSpaceSlot0Allocation() && !force32BitAllocations) {
if (is64bit && scratchSpaceController->getScratchSpaceSlot0Allocation()) {
newGshBase = scratchSpaceController->calculateNewGSH();
} else if (is64bit && force32BitAllocations && dispatchFlags.gsba32BitRequired) {
bool useLocalMemory = scratchSpaceController->getScratchSpaceSlot0Allocation() ? scratchSpaceController->getScratchSpaceSlot0Allocation()->isAllocatedInLocalMemoryPool() : false;
newGshBase = getMemoryManager()->getExternalHeapBaseAddress(rootDeviceIndex, useLocalMemory);
gsbaFor32BitProgrammed = true;
}
uint64_t indirectObjectStateBaseAddress = getMemoryManager()->getInternalHeapBaseAddress(rootDeviceIndex, ioh->getGraphicsAllocation()->isAllocatedInLocalMemoryPool());

View File

@@ -39,8 +39,7 @@ void ScratchSpaceControllerBase::setRequiredScratchSpace(void *sshBaseAddress,
}
createScratchSpaceAllocation();
vfeStateDirty = true;
force32BitAllocation = getMemoryManager()->peekForce32BitAllocations();
if (is64bit && !force32BitAllocation) {
if (is64bit) {
stateBaseAddressDirty = true;
}
}
@@ -64,10 +63,11 @@ uint64_t ScratchSpaceControllerBase::getScratchPatchAddress() {
// and "0 + scratchSpaceOffsetFor64bit" is being programmed in Media VFE state
uint64_t scratchAddress = 0;
if (scratchSlot0Allocation) {
scratchAddress = scratchSlot0Allocation->getGpuAddressToPatch();
if (is64bit && !getMemoryManager()->peekForce32BitAllocations()) {
if (is64bit) {
// this is to avoid scratch allocation offset "0"
scratchAddress = ScratchSpaceConstants::scratchSpaceOffsetFor64Bit;
} else {
scratchAddress = scratchSlot0Allocation->getGpuAddressToPatch();
}
}
return scratchAddress;