1 /*
2 * Copyright (c) 2017, 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_g8.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_G8_H__
28 #define __VPHAL_RENDERER_G8_H__
29 
30 #include "vphal_renderer.h"
31 
32 const VphalSseuSetting VpHalDefaultSSEUTableG8[baseKernelMaxNumID] =
33 {
34     // Slice    Sub-Slice   EU      Rsvd(freq)
35     {    1,        3,        8,         0},     // COMBINED_FC_KERNEL Default
36 
37     // 2 VEBOX KERNELS
38     {    1,        3,        8,         0},     // VEBOX_SECUREBLOCKCOPY_KERNEL,
39     {    1,        3,        8,         0},     // VEBOX_UPDATEDNSTATE_KERNEL,
40 };
41 
42 void KernelDll_ModifyFunctionPointers_g8(Kdll_State *pState);
43 
44 //!
45 //! \brief VPHAL renderer Gen8 class
46 //!
47 class VphalRendererG8 : public VphalRenderer
48 {
49 public:
50     //!
51     //! \brief    VphalRendererG8 constructor
52     //! \details  Based on the HW and OS info, initialize the renderer interfaces
53     //! \param    [in,out] pRenderHal
54     //!           Pointer to RenderHal Interface Structure
55     //! \param    [in,out] pStatus
56     //!           Pointer to the MOS_STATUS flag.
57     //!           Will assign this flag to MOS_STATUS_SUCCESS if successful, otherwise failed
58     //!
VphalRendererG8(PRENDERHAL_INTERFACE pRenderHal,MOS_STATUS * pStatus)59     VphalRendererG8(
60         PRENDERHAL_INTERFACE                pRenderHal,
61         MOS_STATUS                          *pStatus) :
62         VphalRenderer(pRenderHal, pStatus)
63     {
64         // Set SSEUTable
65         pRenderHal->sseuTable           = VpHalDefaultSSEUTableG8;
66 #if defined(ENABLE_KERNELS) && !defined(_FULL_OPEN_SOURCE)
67         m_modifyKdllFunctionPointers    = KernelDll_ModifyFunctionPointers_g8;
68 #endif
69     }
70 
71     //!
72     //! \brief    VPHAL renderer destructor
73     //! \details  Destory the resources allocated for the renderers
74     //!           including VEBOX and Composite.
75     //!
~VphalRendererG8()76     virtual ~VphalRendererG8()
77     {
78     }
79 
80     //!
81     //! \brief    Get Renderer Cache Settings
82     //! \details  Get cache settings for various VP features
83     //! \param    [in] pOsInterface
84     //!           OS Interface
85     //! \param    [in] pPlatform
86     //!           Platform Pointer
87     //! \param    [in] pSkuTable
88     //!           SKU feature table
89     //! \param    [in,out] pSettings
90     //!           Pointer to Render Cache Control Settings
91     //! \return   void
92     //!
93     virtual void GetCacheCntl(
94         PMOS_INTERFACE                      pOsInterface,
95         PLATFORM                            *pPlatform,
96         MEDIA_FEATURE_TABLE                 *pSkuTable,
97         PVPHAL_RENDER_CACHE_CNTL            pSettings);
98 
99     //!
100     //! \brief    Allocate render components
101     //! \details  Allocate render components
102     //! \param    [in] pVeboxInterface
103     //!           Pointer to Vebox Interface Structure
104     //! \param    [in] pSfcInterface
105     //!           Pointer to SFC interface Structure
106     //! \return   MOS_STATUS
107     //!           Return MOS_STATUS_SUCCESS if successful, otherwise failed
108     //!
109     virtual MOS_STATUS AllocateRenderComponents(
110         PMHW_VEBOX_INTERFACE                pVeboxInterface,
111         PMHW_SFC_INTERFACE                  pSfcInterface);
112 
113     //!
114     //! \brief    Initialize the KDLL parameters
115     //! \details  Initialize the KDLL parameters
116     //! \return   MOS_STATUS
117     //!
118     virtual MOS_STATUS InitKdllParam();
119 };
120 
121 #endif // __VPHAL_RENDER_G8_H__
122