1 /*
2 * Copyright (c) 2024, Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22 #ifndef __VP_RENDER_L0_FC_KERNEL_H__
23 #define __VP_RENDER_L0_FC_KERNEL_H__
24 
25 #include "vp_platform_interface.h"
26 #include "vp_render_kernel_obj.h"
27 
28 namespace vp
29 {
30 
31 class VpRenderL0FcKernel : public VpRenderKernelObj
32 {
33 public:
34     VpRenderL0FcKernel(PVP_MHWINTERFACE hwInterface, VpKernelID kernelID, uint32_t kernelIndex, PVpAllocator allocator);
35     virtual ~VpRenderL0FcKernel();
36 
37     virtual MOS_STATUS Init(VpRenderKernel &kernel);
38     virtual MOS_STATUS GetCurbeState(void *&curbe, uint32_t &curbeLength);
GetInlineDataSize()39     virtual uint32_t   GetInlineDataSize() override
40     {
41         return 0;
42     }
43     virtual MOS_STATUS SetSamplerStates(KERNEL_SAMPLER_STATE_GROUP &samplerStateGroup);
44     virtual MOS_STATUS GetWalkerSetting(KERNEL_WALKER_PARAMS &walkerParam, KERNEL_PACKET_RENDER_DATA &renderData);
45 
46     virtual MOS_STATUS SetKernelConfigs(KERNEL_CONFIGS &kernelConfigs) override;
47     virtual MOS_STATUS SetPerfTag() override;
48 
FreeCurbe(void * & curbe)49     MOS_STATUS FreeCurbe(void *&curbe)
50     {
51         return MOS_STATUS_SUCCESS;
52     }
53 
IsKernelCached()54     virtual bool IsKernelCached() override
55     {
56         return true;
57     }
58 
59 protected:
60     virtual MOS_STATUS SetupSurfaceState() override;
61     virtual MOS_STATUS SetWalkerSetting(KERNEL_THREAD_SPACE &threadSpace, bool bSyncFlag, bool flushL1 = false);
62     virtual MOS_STATUS SetKernelArgs(KERNEL_ARGS &kernelArgs, VP_PACKET_SHARED_CONTEXT *sharedContext);
63     virtual MOS_STATUS SetKernelStatefulSurfaces(KERNEL_ARG_INDEX_SURFACE_MAP &statefulSurfaces) override;
64 
65     PRENDERHAL_INTERFACE m_renderHal      = nullptr;
66 
67     //kernel Arguments
68     KERNEL_INDEX_ARG_MAP         m_kernelArgs          = {};
69     KERNEL_BTIS                  m_kernelBtis          = {};
70     KRN_EXECUTE_ENV              m_kernelEnv           = {};
71     KERNEL_WALKER_PARAMS         m_walkerParam         = {};
72     void                        *m_curbe               = nullptr;
73     uint32_t                     m_kernelIndex         = 0;
74     uint32_t                     m_curbeSize           = 0;
75     int32_t                      m_linearSamplerIndex  = -1;
76     int32_t                      m_nearestSamplerIndex = -1;
77     std ::vector<uint8_t>        m_inlineData          = {};
78     L0_FC_KERNEL_CONFIG          m_kernelConfig        = {};
79     KERNEL_ARG_INDEX_SURFACE_MAP m_argIndexSurfMap     = {};
80 
81 MEDIA_CLASS_DEFINE_END(vp__VpRenderL0FcKernel)
82 };
83 }  // namespace vp
84 #endif  //__VP_RENDER_L0_FC_KERNEL_H__
85