diff --git a/media_softlet/agnostic/common/vp/hal/features/vp_filter.h b/media_softlet/agnostic/common/vp/hal/features/vp_filter.h index 00eff6f4112..3836408b1a0 100644 --- a/media_softlet/agnostic/common/vp/hal/features/vp_filter.h +++ b/media_softlet/agnostic/common/vp/hal/features/vp_filter.h @@ -329,6 +329,7 @@ using VEBOX_CSC_PARAMS = _VEBOX_CSC_PARAMS; using PVEBOX_CSC_PARAMS = VEBOX_CSC_PARAMS *; using KERNEL_ARGS = std::vector; +using KERNEL_BTIS = std::map; struct _VEBOX_UPDATE_PARAMS { diff --git a/media_softlet/agnostic/common/vp/hal/packet/vp_render_common.h b/media_softlet/agnostic/common/vp/hal/packet/vp_render_common.h index 1d0d61af4fa..43a1123ddfa 100644 --- a/media_softlet/agnostic/common/vp/hal/packet/vp_render_common.h +++ b/media_softlet/agnostic/common/vp/hal/packet/vp_render_common.h @@ -76,6 +76,28 @@ struct KRN_ARG KRN_ARG_KIND eArgKind; }; +//for L0 use only +struct KRN_BTI +{ + uint32_t uIndex; + uint32_t uBTI; +}; + +//for L0 use only +struct KRN_EXECUTE_ENV +{ + uint32_t uBarrierCount; + bool bDisableMidThreadPreemption; + uint32_t uGrfCount; + bool bHasGlobalAtomics; + bool bHasNoStatelessWrite; + uint32_t uInlineDataPayloadSize; + uint32_t uOffsetToSkipPerThreadDataLoad; + uint32_t uSimdSize; + uint32_t uSubgroupIndependentForwardProgress; + uint32_t uEuThreadCount; +}; + using SurfaceIndex = uint32_t; using SamplerIndex = uint32_t; using KernelIndex = uint32_t; // index of current kernel in KERNEL_PARAMS_LIST diff --git a/media_softlet/agnostic/common/vp/hal/platform_interface/vp_platform_interface.cpp b/media_softlet/agnostic/common/vp/hal/platform_interface/vp_platform_interface.cpp index 3eda5b0d39a..b81acd5ec50 100644 --- a/media_softlet/agnostic/common/vp/hal/platform_interface/vp_platform_interface.cpp +++ b/media_softlet/agnostic/common/vp/hal/platform_interface/vp_platform_interface.cpp @@ -674,3 +674,64 @@ void VpPlatformInterface::DisableRender() VP_PUBLIC_NORMALMESSAGE("Disable Render."); m_isRenderDisabled = true; } + +//for L0 use only +MOS_STATUS VpRenderKernel::SetKernelExeEnv(KRN_EXECUTE_ENV &exeEnv) +{ + VP_FUNC_CALL(); + m_kernelExeEnv = exeEnv; + return MOS_STATUS_SUCCESS; +} + +//for L0 use only +MOS_STATUS VpRenderKernel::AddKernelBti(KRN_BTI &bti) +{ + VP_FUNC_CALL(); + m_kernelBtis.emplace(bti.uIndex, bti.uBTI); + return MOS_STATUS_SUCCESS; +} + +//for L0 use only +MOS_STATUS VpRenderKernel::SetKernelCurbeSize(uint32_t size) +{ + VP_FUNC_CALL(); + + m_curbeSize = size; + return MOS_STATUS_SUCCESS; +} + +//for L0 use only +void VpPlatformInterface::InitVpDelayedNativeAdvKernel( + const uint32_t *kernelBin, + uint32_t kernelBinSize, + KRN_ARG *kernelArgs, + uint32_t kernelArgSize, + uint32_t kernelCurbeSize, + KRN_EXECUTE_ENV &kernelExeEnv, + KRN_BTI *kernelBtis, + uint32_t kernelBtiSize, + std::string kernelName) +{ + VP_FUNC_CALL(); + + VpRenderKernel vpKernel; + + vpKernel.SetKernelBinPointer((void *)kernelBin); + vpKernel.SetKernelName(kernelName); + vpKernel.SetKernelBinOffset(0x0); + vpKernel.SetKernelBinSize(kernelBinSize); + vpKernel.SetKernelExeEnv(kernelExeEnv); + vpKernel.SetKernelCurbeSize(kernelCurbeSize); + + for (uint32_t i = 0; i < kernelArgSize; ++i) + { + vpKernel.AddKernelArg(kernelArgs[i]); + } + + for (uint32_t i = 0; i < kernelBtiSize; ++i) + { + vpKernel.AddKernelBti(kernelBtis[i]); + } + + m_kernelPool.insert(std::make_pair(vpKernel.GetKernelName(), vpKernel)); +} \ No newline at end of file diff --git a/media_softlet/agnostic/common/vp/hal/platform_interface/vp_platform_interface.h b/media_softlet/agnostic/common/vp/hal/platform_interface/vp_platform_interface.h index f72bab2d319..7857fddd9e5 100644 --- a/media_softlet/agnostic/common/vp/hal/platform_interface/vp_platform_interface.h +++ b/media_softlet/agnostic/common/vp/hal/platform_interface/vp_platform_interface.h @@ -113,6 +113,29 @@ class VpRenderKernel return m_kernelArgs; } + + //for L0 use only + uint32_t &GetCurbeSize() + { + return m_curbeSize; + } + + MOS_STATUS SetKernelExeEnv(KRN_EXECUTE_ENV &exeEnv); + + MOS_STATUS SetKernelCurbeSize(uint32_t size); + + MOS_STATUS AddKernelBti(KRN_BTI &bti); + + KERNEL_BTIS GetKernelBtis() + { + return m_kernelBtis; + } + + KRN_EXECUTE_ENV &GetKernelExeEnv() + { + return m_kernelExeEnv; + } + protected: // Compositing Kernel DLL/Search state const Kdll_RuleEntry *m_kernelDllRules = nullptr; @@ -122,13 +145,18 @@ class VpRenderKernel uint32_t m_kernelBinSize = 0; // CM Kernel Execution Code Offset uint32_t m_kernelBinOffset = 0; - // CM Kernel Arguments + // CM Kernel Arguments or L0 Kernel Arguments KERNEL_ARGS m_kernelArgs; std::string m_kernelName = {}; // CM Compositing Kernel patch file buffer and size const void *m_fcPatchBin = nullptr; uint32_t m_fcPatchBinSize = 0; + //for L0 use only + uint32_t m_curbeSize = 0; + KERNEL_BTIS m_kernelBtis; + KRN_EXECUTE_ENV m_kernelExeEnv = {}; + public: const static std::string s_kernelNameNonAdvKernels; @@ -320,6 +348,18 @@ class VpPlatformInterface uint32_t kernelBinSize, std::string kernelName); + //for L0 kernel use only + virtual void InitVpDelayedNativeAdvKernel( + const uint32_t *kernelBin, + uint32_t kernelBinSize, + KRN_ARG *kernelArgs, + uint32_t kernelArgSize, + uint32_t kernelCurbeSize, + KRN_EXECUTE_ENV& kernelExeEnv, + KRN_BTI *kernelBtis, + uint32_t kernelBtiSize, + std::string kernelName); + virtual void AddNativeAdvKernelToDelayedList( DelayLoadedKernelType kernelType, DelayLoadedFunc func);