xref: /aosp_15_r20/external/intel-media-driver/media_driver/agnostic/Xe_R/Xe_HPG/hw/render/mhw_render_xe_hpg.h (revision ba62d9d3abf0e404f2022b4cd7a85e107f48596f)
1 /*===================== begin_copyright_notice ==================================
2 
3 # Copyright (c) 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 //!
26 //! \file     mhw_render_xe_hpg.h
27 //! \brief    Defines functions for constructing  render engine commands on Xe_HPM platforms
28 //!
29 
30 #ifndef __MHW_RENDER_XE_HPM_H__
31 #define __MHW_RENDER_XE_HPM_H__
32 
33 #include "mhw_render_generic.h"
34 #include "mhw_render_hwcmd_xe_hp_base.h"
35 #include "mhw_render_xe_hp_base.h"
36 #include "mhw_mmio_g12.h"
37 #include "mhw_render_itf.h"
38 #include "mhw_render_xe_hpg_impl.h"
39 #include <memory>
40 
41 class MhwRenderInterfaceXe_Hpg : public MhwRenderInterfaceXe_Xpm_Base
42 {
43 public:
MhwRenderInterfaceXe_Hpg(MhwMiInterface * miInterface,PMOS_INTERFACE osInterface,MEDIA_SYSTEM_INFO * gtSystemInfo,uint8_t newStateHeapManagerRequested)44     MhwRenderInterfaceXe_Hpg(
45         MhwMiInterface          *miInterface,
46         PMOS_INTERFACE          osInterface,
47         MEDIA_SYSTEM_INFO       *gtSystemInfo,
48         uint8_t                 newStateHeapManagerRequested) :
49         MhwRenderInterfaceXe_Xpm_Base(miInterface, osInterface, gtSystemInfo, newStateHeapManagerRequested)
50     {
51         MHW_FUNCTION_ENTER;
52     }
53 
~MhwRenderInterfaceXe_Hpg()54     virtual ~MhwRenderInterfaceXe_Hpg() { MHW_FUNCTION_ENTER; }
55 
56     virtual MOS_STATUS AddCfeStateCmd(
57         PMOS_COMMAND_BUFFER cmdBuffer,
58         PMHW_VFE_PARAMS params) override;
59 
60     virtual MOS_STATUS AddComputeWalkerCmd(MOS_COMMAND_BUFFER *cmdBuffer,
61                                            MHW_GPGPU_WALKER_PARAMS *gpgpuWalkerParams,
62                                            MHW_ID_ENTRY_PARAMS *interfaceDescriptorParams,
63                                            MOS_RESOURCE *postsyncResource,
64                                            uint32_t resourceOffset) override;
65 
66     virtual MOS_STATUS AddChromaKeyCmd(
67             PMOS_COMMAND_BUFFER     cmdBuffer,
68             PMHW_CHROMAKEY_PARAMS   params) override;
69 
GetNewRenderInterface()70     std::shared_ptr<mhw::render::Itf> GetNewRenderInterface() override
71     {
72         if (!m_renderItfNew)
73         {
74             auto ptr = std::make_shared<mhw::render::xe_hpg::Impl>(m_osInterface);
75             m_renderItfNew = ptr;
76         }
77 
78         return m_renderItfNew;
79     }
80 };
81 #endif
82