xref: /aosp_15_r20/external/intel-media-driver/media_driver/agnostic/Xe_M/Xe_XPM/codec/hal/codechal_hw_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      codechal_hw_xe_xpm.h
26 //! \brief     This modules implements HW interface layer to be used on XeHP platforms on all operating systems/DDIs, across CODECHAL components.
27 //!
28 #ifndef __CODECHAL_HW_XE_XPM_H__
29 #define __CODECHAL_HW_XE_XPM_H__
30 
31 #include "codechal_hw.h"
32 #include "codechal_hw_g12_X.h"
33 #include "media_blt_copy_xe_xpm_base.h"
34 
35 
36 //!  Codechal hw interface Gen12
37 /*!
38 This class defines the interfaces for hardware dependent settings and functions used in Codechal for Gen12 platforms
39 */
40 class CodechalHwInterfaceXe_Xpm : public CodechalHwInterfaceG12
41 {
42 protected:
43     BltStateXe_Xpm           *m_bltState     = nullptr;        //!< Pointer to blt state
44 public:
45     //!
46     //! \brief    Constructor
47     //!
48     CodechalHwInterfaceXe_Xpm(
49         PMOS_INTERFACE    osInterface,
50         CODECHAL_FUNCTION codecFunction,
51         MhwInterfaces     *mhwInterfaces,
52         bool              disableScalability = false);
53 
54     //!
55     //! \brief    Copy constructor
56     //!
57     CodechalHwInterfaceXe_Xpm(const CodechalHwInterfaceXe_Xpm&) = delete;
58 
59     //!
60     //! \brief    Copy assignment operator
61     //!
62     CodechalHwInterfaceXe_Xpm& operator=(const CodechalHwInterfaceXe_Xpm&) = delete;
63 
64     //!
65     //! \brief    Destructor
66     //!
~CodechalHwInterfaceXe_Xpm()67     virtual ~CodechalHwInterfaceXe_Xpm()
68     {
69         if (m_bltState)
70         {
71             MOS_Delete(m_bltState);
72             m_bltState = nullptr;
73         }
74     }
75 
76     //! \brief    Get blt state
77     //! \details  Get blt interface in codechal hw interface
78     //!
79     //! \return   [out] BltState*
80     //!           Interface got.
81     //!
GetBltState()82     inline BltStateXe_Xpm *GetBltState() override
83     {
84         return m_bltState;
85     }
86 
87     //!
88     //! \brief    Get film grain kernel info
89     //! \details  Get kernel base and size
90     //!
91     //! \param    [out] kernelBase
92     //!           base addr of film grain kernels
93     //!
94     //! \param    [out] kernelSize
95     //!           size of film grain kernels
96     //!
97     //! \return   MOS_STATUS
98     //!           MOS_STATUS_SUCCESS if success, else fail reason
99     //!
100     virtual MOS_STATUS GetFilmGrainKernelInfo(
101         uint8_t*    &kernelBase,
102         uint32_t    &kernelSize) override;
103 };
104 
105 #endif // __CODECHAL_HW_XE_XPM_H__
106