Fix to dispatch MEDIA_VFE_STATE with updated scratchSpacePointer & Size

Minor fix to reset scratch space size and indirect params during cmdList reset

Signed-off-by: Vinod Tipparaju <vinod.tipparaju@intel.com>
This commit is contained in:
Vinod Tipparaju
2021-01-15 20:18:38 +05:30
committed by Compute-Runtime-Automation
parent 4e737adb05
commit 494a59c7df
15 changed files with 452 additions and 34 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2020 Intel Corporation
* Copyright (C) 2018-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -131,6 +131,7 @@ class CommandStreamReceiver {
void overrideDispatchPolicy(DispatchMode overrideValue) { this->dispatchMode = overrideValue; }
void setMediaVFEStateDirty(bool dirty) { mediaVfeStateDirty = dirty; }
bool getMediaVFEStateDirty() { return mediaVfeStateDirty; }
void setRequiredScratchSizes(uint32_t newRequiredScratchSize, uint32_t newRequiredPrivateScratchSize);
GraphicsAllocation *getScratchAllocation();

View File

@@ -49,6 +49,9 @@ class ScratchSpaceController {
virtual uint64_t calculateNewGSH() = 0;
virtual uint64_t getScratchPatchAddress() = 0;
inline uint32_t getPerThreadScratchSpaceSize() {
return static_cast<uint32_t>(scratchSizeBytes / computeUnitsUsedForScratch);
}
virtual void reserveHeap(IndirectHeap::Type heapType, IndirectHeap *&indirectHeap) = 0;
virtual void programHeaps(HeapContainer &heapContainer,

View File

@@ -31,7 +31,7 @@ void ScratchSpaceControllerBase::setRequiredScratchSpace(void *sshBaseAddress,
bool &stateBaseAddressDirty,
bool &vfeStateDirty) {
size_t requiredScratchSizeInBytes = requiredPerThreadScratchSize * computeUnitsUsedForScratch;
if (requiredScratchSizeInBytes && (!scratchAllocation || scratchSizeBytes < requiredScratchSizeInBytes)) {
if (requiredScratchSizeInBytes && (scratchSizeBytes < requiredScratchSizeInBytes)) {
if (scratchAllocation) {
scratchAllocation->updateTaskCount(currentTaskCount, osContext.getContextId());
csrAllocationStorage.storeAllocation(std::unique_ptr<GraphicsAllocation>(scratchAllocation), TEMPORARY_ALLOCATION);