Debian Codegraph @

media_driver/agnostic/Xe_M/Xe_XPM/hw/mhw_vebox_xe_xpm.h

raw
1 /*===================== begin_copyright_notice ==================================
2
3 # Copyright (c) 2020-2021, Intel Corporation
4
5 # Permission is hereby granted, free of charge, to any person obtaining a
6 # copy of this software and associated documentation files (the "Software"),
7 # to deal in the Software without restriction, including without limitation
8 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 # and/or sell copies of the Software, and to permit persons to whom the
10 # Software is furnished to do so, subject to the following conditions:
11
12 # The above copyright notice and this permission notice shall be included
13 # in all copies or substantial portions of the Software.
14
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 # OTHER DEALINGS IN THE SOFTWARE.
22
23 ======================= end_copyright_notice ==================================*/
24 //!
25 //! \file mhw_vebox_xe_xpm.h
26 //! \brief Defines functions for constructing vebox commands on Xe_XPM-based platforms
27 //!
28
29 #ifndef __MHW_VEBOX_XE_XPM_H__
30 #define __MHW_VEBOX_XE_XPM_H__
31
32 #include "mhw_vebox_g12_X.h"
33 #include "mhw_vebox_hwcmd_xe_xpm.h"
34
35 typedef enum _MHW_VEBOX_INDEX
36 {
37 MHW_VEBOX_INDEX_0 = 0,
38 MHW_VEBOX_INDEX_1 = 1,
39 MHW_VEBOX_INDEX_2 = 2,
40 MHW_VEBOX_INDEX_3 = 3
41 } MHW_VEBOX_INDEX;
42
43 //!
44 //! \brief Macro for Vebox Scalable
45 //!
46 #define MHW_VEBOX_MAX_PIPE_SIZE_G12 4096
47 #define MHW_VEBOX_MAX_SEMAPHORE_NUM_G12 4
48 #define MHW_VEBOX_TIMESTAMP_CNTS_PER_SEC_G12 12000048
49 #define MHW_VEBOX_4K_PIC_WIDTH_G12 3840
50 #define MHW_VEBOX_4K_PIC_HEIGHT_G12 2160
51
52 //! MHW vebox interface for Xe_XPM
53 /*!
54 This class defines the VEBOX command interface for Xe_XPM platforms
55 */
56 class MhwVeboxInterfaceXe_Xpm: public MhwVeboxInterfaceG12
57 {
58 public:
59 MhwVeboxInterfaceXe_Xpm(PMOS_INTERFACE pOsInterface);
60 virtual ~MhwVeboxInterfaceXe_Xpm();
61
62 MOS_STATUS AddVeboxDiIecp(
63 PMOS_COMMAND_BUFFER pCmdBuffer,
64 PMHW_VEBOX_DI_IECP_CMD_PARAMS pVeboxDiIecpCmdParams) override;
65
66 MOS_STATUS AddVeboxDndiState(
67 PMHW_VEBOX_DNDI_PARAMS pVeboxDndiParams) override;
68
69 MOS_STATUS VeboxAdjustBoundary(
70 PMHW_VEBOX_SURFACE_PARAMS pSurfaceParam,
71 uint32_t *pdwSurfaceWidth,
72 uint32_t *pdwSurfaceHeight,
73 bool bDIEnable,
74 bool b3DlutEnable);
75
76 //!
77 //! \brief Set which vebox can be used by HW
78 //! \details VPHAL set which VEBOX can be use by HW
79 //! \param [in] dwVeboxIndex;
80 //! set which Vebox can be used by HW
81 //! \param [in] dwVeboxCount;
82 //! set Vebox Count
83 //! \param [in] dwUsingSFC;
84 //! set whether using SFC
85 //! \return MOS_STATUS
86 //! MOS_STATUS_SUCCESS if success, else fail reason
87 MOS_STATUS SetVeboxIndex(
88 uint32_t dwVeboxIndex,
89 uint32_t dwVeboxCount,
90 uint32_t dwUsingSFC) override;
91
92 //!
93 //! \brief Create Gpu Context for Vebox
94 //! \details Create Gpu Context for Vebox
95 //! \param [in] pOsInterface
96 //! OS interface
97 //! \param [in] VeboxGpuContext
98 //! Vebox Gpu Context
99 //! \param [in] VeboxGpuNode
100 //! Vebox Gpu Node
101 //! \return MOS_STATUS
102 //! MOS_STATUS_SUCCESS if success, else fail reason
103 //!
104 MOS_STATUS CreateGpuContext(
105 PMOS_INTERFACE pOsInterface,
106 MOS_GPU_CONTEXT VeboxGpuContext,
107 MOS_GPU_NODE VeboxGpuNode) override;
108
109 MOS_STATUS AddVeboxSurfaces(
110 PMOS_COMMAND_BUFFER pCmdBuffer,
111 PMHW_VEBOX_SURFACE_STATE_CMD_PARAMS pVeboxSurfaceStateCmdParams) override;
112
113 MOS_STATUS FindVeboxGpuNodeToUse(
114 PMHW_VEBOX_GPUNODE_LIMIT pGpuNodeLimit) override;
115
116 #if (_DEBUG || _RELEASE_INTERNAL)
117 //!
118 //! \brief Validate the GPU Node to use for Vebox
119 //! \details Validate the GPU Node to create gpu context used by vebox
120 //! \return MOS_STATUS
121 //! MOS_STATUS_SUCCESS if success, else fail reason
122 //!
123 MOS_STATUS ValidateVeboxScalabilityConfig();
124 #endif
125
126 //! \brief get the status for vebox's Scalability.
127 //! \details VPHAL will check whether the veobx support Scalabiltiy.
128 //! \return bool
129 //! false or true
130 bool IsScalabilitySupported();
131
132 protected:
133 bool m_veboxScalabilitySupported = false;
134 bool m_veboxScalabilityEnabled = false;
135 uint32_t m_indexofVebox = 0;
136 uint32_t m_numofVebox = 1;
137 uint32_t m_usingSfc = 0;
138
139 using MhwVeboxInterfaceG12::SetVeboxSurfaces;
140
141 void SetVeboxSurfaces(
142 PMHW_VEBOX_SURFACE_PARAMS pSurfaceParam,
143 PMHW_VEBOX_SURFACE_PARAMS pDerivedSurfaceParam,
144 PMHW_VEBOX_SURFACE_PARAMS pSkinScoreSurfaceParam,
145 mhw_vebox_xe_xpm::VEBOX_SURFACE_STATE_CMD *pVeboxSurfaceState,
146 bool bIsOutputSurface,
147 bool bDIEnable,
148 bool b3DlutEnable);
149
150 };
151
152 #endif // __MHW_VEBOX_XE_XPM_H__