mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Calculate max threads for preamble only once
Change-Id: I345f1229ae8421d97fe7c947af54f459632ae792 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
ab8e3e472f
commit
137ab6c130
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user