xref: /aosp_15_r20/external/intel-media-driver/media_driver/agnostic/gen8/vp/hal/vphal_render_composite_g8.h (revision ba62d9d3abf0e404f2022b4cd7a85e107f48596f)
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_render_composite_g8.h
24 //! \brief    Common interface and structure used in Composite
25 //! \details  Common interface and structure used in Composite
26 //!
27 #ifndef __VPHAL_RENDER_COMPOSITE_G8_H__
28 #define __VPHAL_RENDER_COMPOSITE_G8_H__
29 
30 #include "vphal_render_composite.h"
31 
32 //!
33 //! \brief Class to VPHAL Composite G8 render
34 //!
35 class CompositeStateG8 : virtual public CompositeState
36 {
37 public:
38     //!
39     //! \brief    Composite Constructor
40     //! \details  Construct Composite render and allocate member data structure
41     //! \param    [in] pOsInterface
42     //!           Pointer to MOS interface structure
43     //! \param    [in] pRenderHal
44     //!           Pointer to RenderHal interface structure
45     //! \param    [in] pPerfData
46     //!           Pointer to performance data structure
47     //! \param    [in] compositeCacheCntl
48     //!           Composite Cache Control Data
49     //! \param    [in,out] peStatus
50     //!           Pointer to MOS status
51     //!
CompositeStateG8(PMOS_INTERFACE pOsInterface,PRENDERHAL_INTERFACE pRenderHal,PVPHAL_RNDR_PERF_DATA pPerfData,const VPHAL_COMPOSITE_CACHE_CNTL & compositeCacheCntl,MOS_STATUS * peStatus)52     CompositeStateG8(
53         PMOS_INTERFACE                      pOsInterface,
54         PRENDERHAL_INTERFACE                pRenderHal,
55         PVPHAL_RNDR_PERF_DATA               pPerfData,
56         const VPHAL_COMPOSITE_CACHE_CNTL    &compositeCacheCntl,
57         MOS_STATUS                          *peStatus) :
58         CompositeState(pOsInterface, pRenderHal, pPerfData, compositeCacheCntl, peStatus)
59     {
60         m_bSamplerSupportRotation       = false;
61         m_bFallbackIefPatch             = false;
62         m_bKernelSupportDualOutput      = false;
63         m_bKernelSupportHdcDW           = true;
64         m_bAvsTableCoeffExtraEnabled    = false;
65         m_bAvsTableBalancedFilter       = false;
66         m_bApplyTwoLayersCompOptimize   = true;
67         m_bYV12iAvsScaling              = false;
68         m_bEnableSamplerLumakey         = false;    // Disable sampler lumakey on Gen8.
69 
70         if (*peStatus != MOS_STATUS_SUCCESS)
71         {
72             // super class constructor failed, return directly
73             return;
74         }
75         m_AvsCoeffsCache.Init(POLYPHASE_Y_COEFFICIENT_TABLE_SIZE_G8, POLYPHASE_UV_COEFFICIENT_TABLE_SIZE_G8);
76         *peStatus = VpHal_RndrCommonInitAVSParams(&m_AvsParameters,
77                                                   POLYPHASE_Y_COEFFICIENT_TABLE_SIZE_G8,
78                                                   POLYPHASE_UV_COEFFICIENT_TABLE_SIZE_G8);
79     }
80 
81     //!
82     //! \brief    Composite render Destructor
83     //! \details  Destroy Composite render and release all related RenderState resources
84     //!
~CompositeStateG8()85     virtual ~CompositeStateG8()
86     {
87     }
88 
89 protected:
90     //!
91     //! \brief    Override Static Data
92     //! \details  Override Static Data
93     //! \param    [in] pRenderingData
94     //!           Pointer to REnder Data
95     //! \param    [in] pTarget
96     //!           Pointer to Target Surface
97     //! \param    [in,out] pStatic
98     //!           Pointer to Static Data
99     //! \return   VOID
100     //!
101     virtual void SubmitStatesFillGenSpecificStaticData(
102         PVPHAL_RENDERING_DATA_COMPOSITE     pRenderingData,
103         PVPHAL_SURFACE                      pTarget,
104         MEDIA_OBJECT_KA2_STATIC_DATA        *pStatic);
105 
106     //!
107     //! \brief    Get Plane Offset override parameter for Kernel solution
108     //! \details  Get Y/UV Plane Offset override parameters for Kernel solution
109     //! \param    [in,out] pRenderHalSurface
110     //!           Pointer to Render Hal Surface
111     //! \param    [in] pParams
112     //!           Pointer to Surface State Params
113     //! \param    [out] pOverride
114     //!           Pointer to override param that provides adjustments to
115     //!           Y, UV plane offsets, used for kernel solution in a few cases.
116     //! \return   RENDERHAL_OFFSET_OVERRIDE
117     //!           return pointer to RENDERHAL_OFFSET_OVERRIDE if need, otherwise return nullptr.
118     //!
119     virtual PRENDERHAL_OFFSET_OVERRIDE GetPlaneOffsetOverrideParam(
120         PRENDERHAL_SURFACE              pRenderHalSurface,
121         PRENDERHAL_SURFACE_STATE_PARAMS pParams,
122         PRENDERHAL_OFFSET_OVERRIDE      pOverride);
123 
124     //!
125     //! \brief    Get Thread Count
126     //! \details  Get Thread Count for VFE state parameter
127     //! \param    [in] pRenderingData
128     //!           Pointer to Composite state
129     //! \param    [in] pTarget
130     //!           Pointer to target surface
131     //! \return   int32_t
132     //!           return the thread count
133     //!
134     virtual int32_t GetThreadCountForVfeState(
135         PVPHAL_RENDERING_DATA_COMPOSITE     pRenderingData,
136         PVPHAL_SURFACE                      pTarget);
137 
138 private:
139     static const uint32_t waBdwGt2ThreadLimit = 96;
140 };
141 
142 #endif // __VPHAL_RENDER_COMPOSITE_G8_H__
143