Calculate max threads for preamble only once

Change-Id: I345f1229ae8421d97fe7c947af54f459632ae792
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2019-05-29 15:37:54 +02:00
committed by sys_ocldev
parent ab8e3e472f
commit 137ab6c130
13 changed files with 41 additions and 13 deletions

View File

@@ -32,7 +32,11 @@ struct PreambleHelper {
static void programThreadArbitration(LinearStream *pCommandStream, uint32_t requiredThreadArbitrationPolicy);
static void programPreemption(LinearStream *pCommandStream, Device &device, GraphicsAllocation *preemptionCsr);
static void addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo);
static void programVFEState(LinearStream *pCommandStream, const HardwareInfo &hwInfo, int scratchSize, uint64_t scratchAddress);
static void programVFEState(LinearStream *pCommandStream,
const HardwareInfo &hwInfo,
int scratchSize,
uint64_t scratchAddress,
uint32_t maxFrontEndThreads);
static void programPreamble(LinearStream *pCommandStream, Device &device, uint32_t l3Config,
uint32_t requiredThreadArbitrationPolicy, GraphicsAllocation *preemptionCsr);
static void programKernelDebugging(LinearStream *pCommandStream);

View File

@@ -25,14 +25,18 @@ uint32_t PreambleHelper<GfxFamily>::getUrbEntryAllocationSize() {
}
template <typename GfxFamily>
void PreambleHelper<GfxFamily>::programVFEState(LinearStream *pCommandStream, const HardwareInfo &hwInfo, int scratchSize, uint64_t scratchAddress) {
void PreambleHelper<GfxFamily>::programVFEState(LinearStream *pCommandStream,
const HardwareInfo &hwInfo,
int scratchSize,
uint64_t scratchAddress,
uint32_t maxFrontEndThreads) {
using MEDIA_VFE_STATE = typename GfxFamily::MEDIA_VFE_STATE;
addPipeControlBeforeVfeCmd(pCommandStream, &hwInfo);
auto pMediaVfeState = reinterpret_cast<MEDIA_VFE_STATE *>(pCommandStream->getSpace(sizeof(MEDIA_VFE_STATE)));
*pMediaVfeState = GfxFamily::cmdInitMediaVfeState;
pMediaVfeState->setMaximumNumberOfThreads(HwHelper::getMaxThreadsForVfe(hwInfo));
pMediaVfeState->setMaximumNumberOfThreads(maxFrontEndThreads);
pMediaVfeState->setNumberOfUrbEntries(1);
pMediaVfeState->setUrbEntryAllocationSize(PreambleHelper<GfxFamily>::getUrbEntryAllocationSize());
pMediaVfeState->setPerThreadScratchSpace(Kernel::getScratchSizeValueToProgramMediaVfeState(scratchSize));