xref: /aosp_15_r20/external/intel-media-driver/media_driver/agnostic/Xe_M/Xe_XPM/hw/mhw_sfc_xe_xpm.h (revision ba62d9d3abf0e404f2022b4cd7a85e107f48596f)
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_sfc_xe_xpm.h
26 //! \brief    Defines functions for constructing sfc commands on Gen12-based platforms
27 //!
28 
29 #ifndef __MHW_SFC_XE_XPM_H__
30 #define __MHW_SFC_XE_XPM_H__
31 
32 #include "mhw_sfc_g12_X.h"
33 #include "mhw_sfc_hwcmd_xe_xpm.h"
34 
35 typedef enum _MHW_SFC_INDEX
36 {
37     MHW_SFC_INDEX_0          = 0,
38     MHW_SFC_INDEX_1          = 1,
39     MHW_SFC_INDEX_2          = 2,
40     MHW_SFC_INDEX_3          = 3
41 } MHW_SFC_INDEX;
42 
43 #define MHW_SFC_MAX_PIPE_NUM_XE_XPM                        4
44 
45 struct MHW_SFC_STATE_PARAMS_XE_XPM: public MHW_SFC_STATE_PARAMS_G12
46 {
47     uint32_t    ditheringEn; //!< 0 - disable, 1 - enable.
48 
49     // Interlaced Scaling parameters
50     uint32_t                        iScalingType;
51     uint32_t                        inputFrameDataFormat;                       // Input frame data format -- Progressive, Interleaved, Field mode
52     uint32_t                        outputFrameDataFormat;                      // Output frame data format -- Progressive, Interleaved, Field mode
53     uint32_t                        topBottomField;                             // Top/Bottom field -- Top field, Bottom field
54     uint32_t                        topBottomFieldFirst;                        // Top/Bottom field first
55     uint32_t                        outputSampleType;                           // Output sample type
56     uint32_t                        bottomFieldVerticalScalingOffset;           // Bottom field vertical scaling offset
57     PMOS_RESOURCE                   tempFieldResource;                          // Temp filed surface
58 
59     PMOS_RESOURCE                   pOsResAVSLineBufferSplit[MHW_SFC_MAX_PIPE_NUM_XE_XPM]; //!< AVS Line buffer used by SFC
60     PMOS_RESOURCE                   pOsResIEFLineBufferSplit[MHW_SFC_MAX_PIPE_NUM_XE_XPM]; //!< IEF Line buffer used by SFC
61 };
62 using PMHW_SFC_STATE_PARAMS_XE_XPM = MHW_SFC_STATE_PARAMS_XE_XPM*;
63 
64 //!  MHW SFC interface for Xe_XPM
65 /*!
66 This class defines the SFC command interface for Gen12 common platforms
67 */
68 class MhwSfcInterfaceXe_Xpm: public MhwSfcInterfaceG12
69 {
70 public:
71     MhwSfcInterfaceXe_Xpm(PMOS_INTERFACE pOsInterface);
72     ~MhwSfcInterfaceXe_Xpm();
73 
74     MOS_STATUS AddSfcState(
75         PMOS_COMMAND_BUFFER         pCmdBuffer,
76         PMHW_SFC_STATE_PARAMS       pSfcStateParams,
77         PMHW_SFC_OUT_SURFACE_PARAMS pOutSurface);
78 
79     //!
80     //! \brief    Set which Sfc can be used by HW
81     //! \details  VPHAL set which Sfc can be use by HW
82     //! \param    [in] dwSfcIndex;
83     //!           set which Sfc can be used by HW
84     //! \param    [in] dwSfcCount;
85     //!           set Sfc Count
86     //! \return   MOS_STATUS
87     //!           MOS_STATUS_SUCCESS if success, else fail reason
88     MOS_STATUS SetSfcIndex(
89         uint32_t                    dwSfcIndex,
90         uint32_t                    dwSfcCount);
91 
92 private:
93     bool     m_sfcScalabilitySupported;
94     bool     m_sfcScalabilityEnabled;
95     uint32_t m_indexofSfc;
96     uint32_t m_numofSfc;
97 };
98 #endif // __MHW_SFC_XE_XPM_H__
99