1 /*
2 * Copyright (c) 2021, 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_vebox_xe_hpm.h
24 //! \brief    Interface and structure specific for Xe_HPM Vebox
25 //! \details  Interface and structure specific for Xe_HPM Vebox
26 //!
27 #ifndef __VPHAL_RENDER_VEBOX_XE_HPM_H__
28 #define __VPHAL_RENDER_VEBOX_XE_HPM_H__
29 
30 #include "vphal_render_vebox_base.h"
31 #include "vphal_render_vebox_xe_xpm.h"
32 
33 typedef class VPHAL_VEBOX_STATE_XE_HPM *PVPHAL_VEBOX_STATE_XE_HPM;
34 class VPHAL_VEBOX_STATE_XE_HPM:virtual public VPHAL_VEBOX_STATE_XE_XPM
35 {
36 public:
37     VPHAL_VEBOX_STATE_XE_HPM(
38         PMOS_INTERFACE                 pOsInterface,
39         PMHW_VEBOX_INTERFACE           pVeboxInterface,
40         PMHW_SFC_INTERFACE             pSfcInterface,
41         PRENDERHAL_INTERFACE           pRenderHal,
42         PVPHAL_VEBOX_EXEC_STATE        pVeboxExecState,
43         PVPHAL_RNDR_PERF_DATA          pPerfData,
44         const VPHAL_DNDI_CACHE_CNTL    &dndiCacheCntl,
45         MOS_STATUS                     *peStatus);
46 
47     virtual ~VPHAL_VEBOX_STATE_XE_HPM();
48 
49     virtual MOS_STATUS AllocateResources() override;
50 
51     //!
52     //! \brief    Check TGNE Valid
53     //! \details  Check TGNE is Valid or not
54     //! \return   MOS_STATUS
55     //!           Return MOS_STATUS_SUCCESS if successful, otherwise failed
56     //!
57     virtual MOS_STATUS CheckTGNEValid(
58         uint32_t *pStatSlice0GNEPtr,
59         uint32_t *pStatSlice1GNEPtr,
60         uint32_t *pQuery);
61 
62     //!
63     //! \brief    Consistent Check the value of GNE Luma
64     //! \details  Consistent Check the value of GNE Luma
65     //! \param    [in, out] dwGNELuma
66     //!           Spatial GNE in Y channel
67     //! \param    uint32_t* pStatSlice0GNEPtr
68     //!           [in] Pointer to Vebox slice0 GNE data
69     //! \param    uint32_t* pStatSlice1GNEPtr
70     //!           [in] Pointer to Vebox slice1 GNE data
71     //! \return   MOS_STATUS
72     //!           Return MOS_STATUS_SUCCESS if successful, otherwise failed
73     //!
74     virtual MOS_STATUS GNELumaConsistentCheck(
75         uint32_t &dwGNELuma,
76         uint32_t *pStatSlice0GNEPtr,
77         uint32_t *pStatSlice1GNEPtr);
78 
79     //!
80     //! \brief    Vebox HW state heap update for MHW states
81     //! \details  update Vebox HW states (DN),
82     //! \param    PVPHAL_SURFACE pSrcSurface
83     //!           [in] Pointer to input surface of Vebox
84     //! \param    PVPHAL_VEBOX_STATE_PARAMS pVeboxStateParams
85     //!           [in] Pointer to VEBOX State Params
86     //! \return   MOS_STATUS
87     //!           Return MOS_STATUS_SUCCESS if successful, otherwise failed
88     //!
89     virtual MOS_STATUS VeboxUpdateVeboxHwStates(
90         PVPHAL_SURFACE                pSrcSurface,
91         PVPHAL_VEBOX_STATE_PARAMS     pVeboxStateParams);
92 
93 protected:
94     virtual MOS_STATUS VeboxUpdateVeboxStates(
95         PVPHAL_SURFACE pSrcSurface) override;
96 
97     virtual MOS_STATUS VeboxUpdateDnStatesForHVS(
98         PVPHAL_DENOISE_PARAMS pDNParams,
99         uint32_t *            pStatSlice0GNEPtr,
100         uint32_t *            pStatSlice1GNEPtr);
101 };
102 
103 #endif // __VPHAL_RENDER_VEBOX_XE_HPM_H__
104 
105