mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 21:27:04 +08:00
Update programVFEState function
Related-To: NEO-4940, NEO-4574 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e1884fd38f
commit
31b7fcf653
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "opencl/source/kernel/kernel_execution_type.h"
|
||||
|
||||
#include "engine_group_types.h"
|
||||
#include "engine_node.h"
|
||||
#include "igfxfmid.h"
|
||||
|
||||
@@ -37,16 +38,17 @@ struct PreambleHelper {
|
||||
const HardwareInfo &hwInfo);
|
||||
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, aub_stream::EngineType engineType);
|
||||
static void addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo, EngineGroupType engineGroupType);
|
||||
static void appendProgramVFEState(const HardwareInfo &hwInfo, KernelExecutionType kernelExecutionType, uint32_t additionalKernelExecInfo, void *cmd);
|
||||
static uint64_t programVFEState(LinearStream *pCommandStream,
|
||||
const HardwareInfo &hwInfo,
|
||||
uint32_t scratchSize,
|
||||
uint64_t scratchAddress,
|
||||
uint32_t maxFrontEndThreads,
|
||||
aub_stream::EngineType engineType,
|
||||
uint32_t additionalKernelExecInfo,
|
||||
KernelExecutionType kernelExecutionType);
|
||||
static void *programVFEState(LinearStream *pCommandStream,
|
||||
const HardwareInfo &hwInfo,
|
||||
uint32_t scratchSize,
|
||||
uint64_t scratchAddress,
|
||||
uint32_t maxFrontEndThreads,
|
||||
EngineGroupType engineGroupType,
|
||||
uint32_t additionalKernelExecInfo,
|
||||
KernelExecutionType kernelExecutionType);
|
||||
static uint64_t getScratchSpaceAddressOffsetForVfeState(LinearStream *pCommandStream, void *pVfeState);
|
||||
static void programAdditionalFieldsInVfeState(VFE_STATE_TYPE *mediaVfeState, const HardwareInfo &hwInfo);
|
||||
static void programPreamble(LinearStream *pCommandStream, Device &device, uint32_t l3Config,
|
||||
uint32_t requiredThreadArbitrationPolicy, GraphicsAllocation *preemptionCsr);
|
||||
|
||||
@@ -27,19 +27,18 @@ uint32_t PreambleHelper<GfxFamily>::getUrbEntryAllocationSize() {
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
uint64_t PreambleHelper<GfxFamily>::programVFEState(LinearStream *pCommandStream,
|
||||
const HardwareInfo &hwInfo,
|
||||
uint32_t scratchSize,
|
||||
uint64_t scratchAddress,
|
||||
uint32_t maxFrontEndThreads,
|
||||
aub_stream::EngineType engineType,
|
||||
uint32_t additionalExecInfo,
|
||||
KernelExecutionType kernelExecutionType) {
|
||||
void *PreambleHelper<GfxFamily>::programVFEState(LinearStream *pCommandStream,
|
||||
const HardwareInfo &hwInfo,
|
||||
uint32_t scratchSize,
|
||||
uint64_t scratchAddress,
|
||||
uint32_t maxFrontEndThreads,
|
||||
EngineGroupType engineGroupType,
|
||||
uint32_t additionalExecInfo,
|
||||
KernelExecutionType kernelExecutionType) {
|
||||
using MEDIA_VFE_STATE = typename GfxFamily::MEDIA_VFE_STATE;
|
||||
|
||||
addPipeControlBeforeVfeCmd(pCommandStream, &hwInfo, engineType);
|
||||
addPipeControlBeforeVfeCmd(pCommandStream, &hwInfo, engineGroupType);
|
||||
|
||||
auto scratchSpaceAddressOffset = static_cast<uint64_t>(pCommandStream->getUsed() + MEDIA_VFE_STATE::PATCH_CONSTANTS::SCRATCHSPACEBASEPOINTER_BYTEOFFSET);
|
||||
auto pMediaVfeState = pCommandStream->getSpaceForCmd<MEDIA_VFE_STATE>();
|
||||
MEDIA_VFE_STATE cmd = GfxFamily::cmdInitMediaVfeState;
|
||||
cmd.setMaximumNumberOfThreads(maxFrontEndThreads);
|
||||
@@ -56,7 +55,15 @@ uint64_t PreambleHelper<GfxFamily>::programVFEState(LinearStream *pCommandStream
|
||||
appendProgramVFEState(hwInfo, kernelExecutionType, additionalExecInfo, &cmd);
|
||||
*pMediaVfeState = cmd;
|
||||
|
||||
return scratchSpaceAddressOffset;
|
||||
return pMediaVfeState;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
uint64_t PreambleHelper<GfxFamily>::getScratchSpaceAddressOffsetForVfeState(LinearStream *pCommandStream, void *pVfeState) {
|
||||
using MEDIA_VFE_STATE = typename GfxFamily::MEDIA_VFE_STATE;
|
||||
return static_cast<uint64_t>(reinterpret_cast<uintptr_t>(pVfeState) -
|
||||
reinterpret_cast<uintptr_t>(pCommandStream->getCpuBase()) +
|
||||
MEDIA_VFE_STATE::PATCH_CONSTANTS::SCRATCHSPACEBASEPOINTER_BYTEOFFSET);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
Reference in New Issue
Block a user