xref: /aosp_15_r20/external/intel-media-driver/media_driver/agnostic/gen9/vp/hal/vphal_render_sfc_g9_base.h (revision ba62d9d3abf0e404f2022b4cd7a85e107f48596f)
1 /*
2 * Copyright (c) 2010-2017, 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_sfc_g9_base.h
24 //! \brief    The header file of the Gen9 VPHAL SFC rendering component
25 //! \details  The SFC renderer supports Scaling, IEF, CSC/ColorFill and Rotation.
26 //!           It's responsible for setting up HW states and generating the SFC
27 //!           commands.
28 //!
29 #ifndef __VPHAL_RENDER_SFC_G9_BASE_H__
30 #define __VPHAL_RENDER_SFC_G9_BASE_H__
31 
32 #include "mhw_sfc.h"
33 #include "vphal_render_sfc_base.h"
34 
35 #if __VPHAL_SFC_SUPPORTED
36 
37 class VphalSfcStateG9:virtual public VphalSfcState
38 {
39 public:
VphalSfcStateG9(PMOS_INTERFACE osInterface,PRENDERHAL_INTERFACE renderHal,PMHW_SFC_INTERFACE sfcInterface)40     VphalSfcStateG9(
41         PMOS_INTERFACE       osInterface,
42         PRENDERHAL_INTERFACE renderHal,
43         PMHW_SFC_INTERFACE   sfcInterface):VphalSfcState(osInterface, renderHal, sfcInterface)
44     {
45     }
46 
~VphalSfcStateG9()47     virtual ~VphalSfcStateG9()
48     {
49 
50     }
51 
52     //!
53     //! \brief    Initialize sfc render data
54     //! \return   void
55     //!
InitRenderData()56     virtual void InitRenderData()
57     {
58         VphalSfcState::InitRenderData();
59         m_renderData.SfcStateParams = (MHW_SFC_STATE_PARAMS*)MOS_AllocAndZeroMemory(sizeof(MHW_SFC_STATE_PARAMS));
60     }
61 
62 protected:
63     virtual bool IsInputFormatSupported(
64         PVPHAL_SURFACE              srcSurface);
65 
66     virtual bool IsOutputFormatSupported(
67         PVPHAL_SURFACE              outSurface);
68 
69     virtual void GetInputWidthHeightAlignUnit(
70         MOS_FORMAT              inputFormat,
71         MOS_FORMAT              outputFormat,
72         uint16_t                &widthAlignUnit,
73         uint16_t                &heightAlignUnit,
74         bool                    isInterlacedScaling = false);
75 };
76 
77 #endif // __VPHAL_SFC_SUPPORTED
78 #endif // __VPHAL_RENDER_SFC_G9_BASE_H__
79