xref: /aosp_15_r20/external/intel-media-driver/media_driver/agnostic/gen12/hw/vdbox/mhw_vdbox_huc_g12_X.h (revision ba62d9d3abf0e404f2022b4cd7a85e107f48596f)
1 /*
2 * Copyright (c) 2017-2019, 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     mhw_vdbox_huc_g12_X.h
24 //! \brief    Defines functions for constructing Vdbox HUC commands on Gen12-based platforms
25 //!
26 
27 #ifndef __MHW_VDBOX_HUC_G12_X_H__
28 #define __MHW_VDBOX_HUC_G12_X_H__
29 
30 #include "mhw_vdbox_huc_generic.h"
31 #include "mhw_vdbox_huc_hwcmd_g12_X.h"
32 #include "mhw_mi_hwcmd_g12_X.h"
33 
34 //!  MHW Vdbox Huc interface for Gen12
35 /*!
36 This class defines the Huc command construction functions for Gen12 based platforms
37 */
38 
39 class MhwVdboxHucInterfaceG12 : public MhwVdboxHucInterfaceGeneric<mhw_vdbox_huc_g12_X, mhw_mi_g12_X>
40 {
41 
42 public:
43     //!
44     //! \brief  Constructor
45     //!
MhwVdboxHucInterfaceG12(PMOS_INTERFACE osInterface,MhwMiInterface * miInterface,MhwCpInterface * cpInterface)46     MhwVdboxHucInterfaceG12(
47         PMOS_INTERFACE osInterface,
48         MhwMiInterface *miInterface,
49         MhwCpInterface *cpInterface) :
50         MhwVdboxHucInterfaceGeneric(osInterface, miInterface, cpInterface)
51     {
52         MHW_FUNCTION_ENTER;
53 
54         InitMmioRegisters();
55     }
56 
57     //!
58     //! \brief    Destructor
59     //!
~MhwVdboxHucInterfaceG12()60     virtual ~MhwVdboxHucInterfaceG12() { MHW_FUNCTION_ENTER; }
61 
62     //!
63     //! \brief    Get huc product family
64     //!
65     //! \return   uint32_t
66     //!           Huc product family.
67     //!
GetHucProductFamily()68     uint32_t GetHucProductFamily() override
69     {
70         return m_hucFamilyTigerlake;
71     }
72 
73     static const uint32_t m_hucFamilyTigerlake = 8;
74 
75 protected:
76     MOS_STATUS AddHucPipeModeSelectCmd(
77         MOS_COMMAND_BUFFER                  *cmdBuffer,
78         MHW_VDBOX_PIPE_MODE_SELECT_PARAMS   *params) override;
79     MOS_STATUS AddHucImemStateCmd(
80         MOS_COMMAND_BUFFER                  *cmdBuffer,
81         MHW_VDBOX_HUC_IMEM_STATE_PARAMS     *params) override;
82 
83     MOS_STATUS GetHucStateCommandSize(
84         uint32_t                        mode,
85         uint32_t                        *commandsSize,
86         uint32_t                        *patchListSize,
87         PMHW_VDBOX_STATE_CMDSIZE_PARAMS params) override;
88 
89     void InitMmioRegisters();
90 };
91 
92 #endif
93