xref: /aosp_15_r20/external/intel-media-driver/media_driver/agnostic/gen12/vp/hal/vphal_renderer_g12.h (revision ba62d9d3abf0e404f2022b4cd7a85e107f48596f)
1 /*
2 * Copyright (c) 2017-2022, 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 //!
23 //! \file     vphal_renderer_g12.h
24 //! \brief    The header file of VPHAL top level rendering component
25 //! \details  The top renderer is responsible for coordinating the sequence of calls to low level renderers, e.g. DNDI or Comp
26 //!
27 #ifndef __VPHAL_RENDERER_G12_H__
28 #define __VPHAL_RENDERER_G12_H__
29 
30 #include "vphal_renderer.h"
31 
32 const VphalSseuSetting VpHalDefaultSSEUTableG12[baseKernelMaxNumID] =
33 {
34     // Slice    Sub-Slice       EU      Rsvd(freq)
35     { 2,            3,          8,          0 },     // COMBINED_FC_KERNEL Default
36 
37     // 2 VEBOX KERNELS
38     { 2,            3,          8,          0 },     // VEBOX_SECUREBLOCKCOPY_KERNEL,
39     { 2,            3,          8,          0 },     // VEBOX_UPDATEDNSTATE_KERNEL,
40 };
41 
42 // Two pass down scaling for down scaling quality due to 8-Tab polyphase filter.
43 #define VPHAL_MAX_NUM_DS_SURFACES 2
44 
45 //!
46 //! \brief VPHAL renderer Gen12 class
47 //!
48 class VphalRendererG12 : public VphalRenderer
49 {
50 public:
51     bool                        bEnableCMFC = false;                                    //!< Enable CM based FC for GEN12
52     //!
53     //! \brief    VphalRendererG8 constructor
54     //! \details  Based on the HW and OS info, initialize the renderer interfaces
55     //! \param    [in,out] pRenderHal
56     //!           Pointer to RenderHal Interface Structure
57     //! \param    [in,out] pStatus
58     //!           Pointer to the MOS_STATUS flag.
59     //!           Will assign this flag to MOS_STATUS_SUCCESS if successful, otherwise failed
60     //!
VphalRendererG12(PRENDERHAL_INTERFACE pRenderHal,MOS_STATUS * pStatus)61     VphalRendererG12(
62         PRENDERHAL_INTERFACE                pRenderHal,
63         MOS_STATUS                          *pStatus) :
64         VphalRenderer(pRenderHal, pStatus)
65     {
66         // Set SSEUTable
67         pRenderHal->sseuTable = VpHalDefaultSSEUTableG12;
68     }
69 
70     //!
71     //! \brief    VPHAL renderer destructor
72     //! \details  Destory the resources allocated for the renderers
73     //!           including VEBOX and Composite.
74     //! \param    [in,out] VphalRenderer* pRenderer
75     //!           VPHAL renderer pointer
76     //! \return   VOID
77     //!
~VphalRendererG12()78     virtual ~VphalRendererG12()
79     {
80     }
81 
82     //!
83     //! \brief    Get Renderer Cache Settings
84     //! \details  Get cache settings for various VP features
85     //! \param    [in] pOsInterface
86     //!           OS Interface
87     //! \param    [in] pPlatform
88     //!           Platform Pointer
89     //! \param    [in] pSkuTable
90     //!           SKU feature table
91     //! \param    [in,out] pSettings
92     //!           Pointer to Render Cache Control Settings
93     //! \return   void
94     //!
95     virtual void GetCacheCntl(
96         PMOS_INTERFACE                      pOsInterface,
97         PLATFORM                            *pPlatform,
98         MEDIA_FEATURE_TABLE                 *pSkuTable,
99         PVPHAL_RENDER_CACHE_CNTL            pSettings);
100 
101     //!
102     //! \brief    Allocate render components
103     //! \details  Allocate render components
104     //! \param    [in] pVeboxInterface
105     //!           Pointer to Vebox Interface Structure
106     //! \param    [in] pSfcInterface
107     //!           Pointer to SFC interface Structure
108     //! \return   MOS_STATUS
109     //!           Return MOS_STATUS_SUCCESS if successful, otherwise failed
110     //!
111     virtual MOS_STATUS AllocateRenderComponents(
112         PMHW_VEBOX_INTERFACE                pVeboxInterface,
113         PMHW_SFC_INTERFACE                  pSfcInterface);
114 
115     //!
116     //! \brief    Initialize the KDLL parameters
117     //! \details  Initialize the KDLL parameters
118     //! \return   MOS_STATUS
119     //!
120     virtual MOS_STATUS InitKdllParam() = 0;
121 
122     //!
123     //! \brief    Allocate surface
124     //! \details  Allocate surface according to the attributes of surface except the specified width/height/format.
125     //! \param    [in] RenderParams
126     //!           VPHAL render parameter
127     //! \param    [in] pSurface
128     //!           Pointer to the surface which specifies the attributes except the specified width/height/format.
129     //! \param    [in] pAllocatedSurface
130     //!           Pointer to the allocated surface.
131     //! \param    [in] dwSurfaceWidth
132     //!           The width of allocated surface.
133     //! \param    [in] dwSurfaceHeight
134     //!           The height of allocated surface.
135     //! \param    [in] eFormat
136     //!           The format of allocated surface.
137     //! \return   MOS_STATUS
138     //!           Return MOS_STATUS_SUCCESS if successful, otherwise failed
139     //!
140     MOS_STATUS AllocateSurface(
141         PCVPHAL_RENDER_PARAMS       pcRenderParams,
142         PVPHAL_SURFACE              pSurface,
143         PVPHAL_SURFACE              pAllocatedSurface,
144         uint32_t                    dwSurfaceWidth,
145         uint32_t                    dwSurfaceHeight,
146         MOS_FORMAT                  eFormat);
147 
148 };
149 
150 #endif // __VPHAL_RENDER_G12_H__
151