1 /*===================== begin_copyright_notice ================================== 2 3 # Copyright (c) 2022, 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 media_interfaces_mtl.h 26 //! \brief All interfaces used for MTL that require factory creation 27 //! 28 29 #ifndef __MEDIA_INTERFACES_MTL_H__ 30 #define __MEDIA_INTERFACES_MTL_H__ 31 32 #include "media_interfaces_mhw_next.h" 33 #include "media_interfaces_codechal_next.h" 34 #include "media_interfaces_mcpy_next.h" 35 #include "media_interfaces_mmd_next.h" 36 37 #include "media_interfaces_vphal.h" 38 #include "media_interfaces_renderhal.h" 39 #include "media_interfaces_hwinfo_device.h" 40 41 #include "mhw_cp_interface.h" 42 43 #include "mhw_vdbox_mfx_impl_xe_lpm_plus.h" 44 45 #include "mhw_vdbox_avp_impl_xe_lpm_plus.h" 46 #include "mhw_vdbox_huc_impl_xe_lpm_plus.h" 47 #include "mhw_vdbox_hcp_impl_xe_lpm_plus.h" 48 #include "mhw_vdbox_vdenc_impl_xe_lpm_plus.h" 49 #include "media_mem_decompress_xe_lpm_plus_base.h" 50 #include "media_copy_xe_lpm_plus_base.h" 51 #include "mhw_state_heap_xe_hpg.h" 52 #include "codec_hw_xe_lpm_plus_base.h" 53 54 #ifdef _AVC_DECODE_SUPPORTED 55 #include "decode_avc_pipeline_adapter_xe_lpm_plus.h" 56 #endif 57 58 #ifdef _HEVC_DECODE_SUPPORTED 59 #include "decode_hevc_pipeline_adapter_xe_lpm_plus.h" 60 #endif 61 62 #ifdef _JPEG_DECODE_SUPPORTED 63 #include "decode_jpeg_pipeline_adapter_xe_lpm_plus.h" 64 #endif 65 66 #ifdef _MPEG2_DECODE_SUPPORTED 67 #include "decode_mpeg2_pipeline_adapter_xe_lpm_plus.h" 68 #endif 69 70 #ifdef _VP9_DECODE_SUPPORTED 71 #include "decode_vp9_pipeline_adapter_xe_lpm_plus.h" 72 #endif 73 74 #ifdef _VP8_DECODE_SUPPORTED 75 #include "decode_vp8_pipeline_adapter_xe_lpm_plus.h" 76 #endif 77 78 #ifdef _AV1_DECODE_SUPPORTED 79 #include "decode_av1_pipeline_adapter_xe_lpm_plus.h" 80 #endif 81 82 #ifdef _JPEG_ENCODE_SUPPORTED 83 #include "encode_jpeg_pipeline_adapter_xe_lpm_plus_base.h" 84 #endif 85 86 #ifdef _HEVC_ENCODE_VDENC_SUPPORTED 87 #include "encode_hevc_vdenc_pipeline_adapter_xe_lpm_plus.h" 88 #endif 89 90 #ifdef _AV1_ENCODE_VDENC_SUPPORTED 91 #include "encode_av1_vdenc_pipeline_adapter_xe_lpm_plus.h" 92 #endif 93 94 #ifdef _AVC_ENCODE_VDENC_SUPPORTED 95 #include "encode_avc_vdenc_pipeline_adapter_xe_lpm_plus_base.h" 96 #endif 97 98 #ifdef _VP9_ENCODE_VDENC_SUPPORTED 99 #ifndef _APOGEIOS_SUPPORTED 100 #ifdef _MEDIA_RESERVED 101 #include "codechal_vdenc_vp9_xe_lpm_plus.h" 102 #endif 103 #endif 104 #include "encode_vp9_vdenc_pipeline_adapter_xe_lpm_plus.h" 105 #endif 106 107 #include "renderhal_xe_hpg_next.h" 108 109 #include "decode_scalability_singlepipe_next.h" 110 #include "decode_scalability_multipipe_next.h" 111 112 class MhwInterfacesXe_Lpm_Plus_Next : public MhwInterfacesNext 113 { 114 public: 115 //TODO, Remove legacy mhw sub interfaces 116 using Cp = MhwCpInterface; 117 using StateHeap = MHW_STATE_HEAP_INTERFACE_XE_HPG; 118 119 virtual MOS_STATUS Initialize( 120 CreateParams params, 121 PMOS_INTERFACE osInterface); 122 123 //! 124 //! \brief Destroys all created MHW interfaces 125 //! \details If the HAL creation fails, this is used for cleanup 126 //! 127 virtual void Destroy(); 128 129 MEDIA_CLASS_DEFINE_END(MhwInterfacesXe_Lpm_Plus_Next) 130 }; 131 132 class MmdDeviceXe_Lpm_Plus_Next : public MmdDeviceNext 133 { 134 public: 135 using Mmd = MediaMemDeCompNext_Xe_Lpm_Plus_Base; 136 137 MOS_STATUS Initialize( 138 PMOS_INTERFACE osInterface, 139 MhwInterfacesNext* mhwInterfaces); 140 141 MEDIA_CLASS_DEFINE_END(MmdDeviceXe_Lpm_Plus_Next) 142 }; 143 144 class McpyDeviceXe_Lpm_Plus : public McpyDeviceNext 145 { 146 public: 147 using Mcpy = MediaCopyStateXe_Lpm_Plus_Base; 148 MOS_STATUS Initialize( 149 PMOS_INTERFACE osInterface, 150 MhwInterfacesNext *mhwInterfaces); 151 152 MEDIA_CLASS_DEFINE_END(McpyDeviceXe_Lpm_Plus) 153 }; 154 155 class CodechalInterfacesXe_Lpm_Plus : public CodechalDeviceNext 156 { 157 public: 158 using Hw = CodechalHwInterfaceXe_Lpm_Plus_Base; 159 160 MOS_STATUS Initialize( 161 void *standardInfo, 162 void *settings, 163 MhwInterfacesNext *mhwInterfaces, 164 PMOS_INTERFACE osInterface) override; 165 166 MEDIA_CLASS_DEFINE_END(CodechalInterfacesXe_Lpm_Plus) 167 }; 168 169 /* 170 #define DG2_L3_CONFIG_COUNT 6 171 // 4KB per Way for DG2, two Way per section 172 static const L3ConfigRegisterValues DG2_L3_PLANES[DG2_L3_CONFIG_COUNT] = 173 { // Rest R/W RO UTC CB Sum (in KB) 174 {0x00000200, 0, 0, 0}, // 512 0 0 0 0 512 175 {0xC0000000, 0x40000000, 0, 0}, // 384 0 0 128 0 512 176 {0xF0000000, 0x00000080, 0, 0}, // 480 0 0 0 32 512 177 {0x80000000, 0x80000000, 0, 0}, // 256 0 0 256 0 512 178 {0x40000000, 0x00000080, 0, 0}, // 0 128 352 0 32 512 179 {0x80000000, 0x70000080, 0, 0}, // 256 0 0 224 32 512 180 }; 181 */ 182 183 class VphalInterfacesXe_Lpm_Plus : public VphalDevice 184 { 185 public: 186 MOS_STATUS Initialize( 187 PMOS_INTERFACE osInterface, 188 bool bInitVphalState, 189 MOS_STATUS *eStatus, 190 bool clearViewMode = false); 191 192 MOS_STATUS CreateVpPlatformInterface( 193 PMOS_INTERFACE osInterface, 194 MOS_STATUS * eStatus); 195 196 private: 197 void InitPlatformKernelBinary( 198 vp::VpPlatformInterface *&vpPlatformInterface); 199 200 MEDIA_CLASS_DEFINE_END(VphalInterfacesXe_Lpm_Plus) 201 }; 202 203 class RenderHalInterfacesXe_Lpg : public RenderHalDevice 204 { 205 protected: 206 using XRenderHal = XRenderHal_Interface_Xe_Hpg_Next; 207 MOS_STATUS Initialize(); 208 209 MEDIA_CLASS_DEFINE_END(RenderHalInterfacesXe_Lpg) 210 }; 211 212 class MediaInterfacesHwInfoDeviceXe_Lpm_Plus : public MediaInterfacesHwInfoDevice 213 { 214 public: 215 virtual MOS_STATUS Initialize(PLATFORM platform) override; 216 217 MEDIA_CLASS_DEFINE_END(MediaInterfacesHwInfoDeviceXe_Lpm_Plus) 218 }; 219 220 #endif // __MEDIA_INTERFACES_MTL_H__ 221