| 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 |
#include "encode_vp9_vdenc_pipeline_adapter_xe_lpm_plus.h" |
| 100 |
#endif |
| 101 |
|
| 102 |
#include "renderhal_xe_hpg_next.h" |
| 103 |
|
| 104 |
#include "decode_scalability_singlepipe_next.h" |
| 105 |
#include "decode_scalability_multipipe_next.h" |
| 106 |
|
| 107 |
class MhwInterfacesXe_Lpm_Plus_Next : public MhwInterfacesNext |
| 108 |
{ |
| 109 |
public: |
| 110 |
//TODO, Remove legacy mhw sub interfaces |
| 111 |
using Cp = MhwCpInterface; |
| 112 |
using StateHeap = MHW_STATE_HEAP_INTERFACE_XE_HPG; |
| 113 |
|
| 114 |
virtual MOS_STATUS Initialize( |
| 115 |
CreateParams params, |
| 116 |
PMOS_INTERFACE osInterface); |
| 117 |
|
| 118 |
//! |
| 119 |
//! \brief Destroys all created MHW interfaces |
| 120 |
//! \details If the HAL creation fails, this is used for cleanup |
| 121 |
//! |
| 122 |
virtual void Destroy(); |
| 123 |
|
| 124 |
MEDIA_CLASS_DEFINE_END(MhwInterfacesXe_Lpm_Plus_Next) |
| 125 |
}; |
| 126 |
|
| 127 |
class MmdDeviceXe_Lpm_Plus_Next : public MmdDeviceNext |
| 128 |
{ |
| 129 |
public: |
| 130 |
using Mmd = MediaMemDeCompNext_Xe_Lpm_Plus_Base; |
| 131 |
|
| 132 |
MOS_STATUS Initialize( |
| 133 |
PMOS_INTERFACE osInterface, |
| 134 |
MhwInterfacesNext* mhwInterfaces); |
| 135 |
|
| 136 |
MEDIA_CLASS_DEFINE_END(MmdDeviceXe_Lpm_Plus_Next) |
| 137 |
}; |
| 138 |
|
| 139 |
using McpyDeviceXe_Lpm_Plus = McpyDeviceNextImpl<MediaCopyStateXe_Lpm_Plus_Base>; |
| 140 |
|
| 141 |
class CodechalInterfacesXe_Lpm_Plus : public CodechalDeviceNext |
| 142 |
{ |
| 143 |
public: |
| 144 |
using Hw = CodechalHwInterfaceXe_Lpm_Plus_Base; |
| 145 |
|
| 146 |
MOS_STATUS Initialize( |
| 147 |
void *standardInfo, |
| 148 |
void *settings, |
| 149 |
MhwInterfacesNext *mhwInterfaces, |
| 150 |
PMOS_INTERFACE osInterface) override; |
| 151 |
|
| 152 |
MEDIA_CLASS_DEFINE_END(CodechalInterfacesXe_Lpm_Plus) |
| 153 |
}; |
| 154 |
|
| 155 |
/* |
| 156 |
#define DG2_L3_CONFIG_COUNT 6 |
| 157 |
// 4KB per Way for DG2, two Way per section |
| 158 |
static const L3ConfigRegisterValues DG2_L3_PLANES[DG2_L3_CONFIG_COUNT] = |
| 159 |
{ // Rest R/W RO UTC CB Sum (in KB) |
| 160 |
{0x00000200, 0, 0, 0}, // 512 0 0 0 0 512 |
| 161 |
{0xC0000000, 0x40000000, 0, 0}, // 384 0 0 128 0 512 |
| 162 |
{0xF0000000, 0x00000080, 0, 0}, // 480 0 0 0 32 512 |
| 163 |
{0x80000000, 0x80000000, 0, 0}, // 256 0 0 256 0 512 |
| 164 |
{0x40000000, 0x00000080, 0, 0}, // 0 128 352 0 32 512 |
| 165 |
{0x80000000, 0x70000080, 0, 0}, // 256 0 0 224 32 512 |
| 166 |
}; |
| 167 |
*/ |
| 168 |
|
| 169 |
class VphalInterfacesXe_Lpm_Plus : public VphalDevice |
| 170 |
{ |
| 171 |
public: |
| 172 |
MOS_STATUS Initialize( |
| 173 |
PMOS_INTERFACE osInterface, |
| 174 |
bool bInitVphalState, |
| 175 |
MOS_STATUS *eStatus, |
| 176 |
bool clearViewMode = false); |
| 177 |
|
| 178 |
MOS_STATUS CreateVpPlatformInterface( |
| 179 |
PMOS_INTERFACE osInterface, |
| 180 |
MOS_STATUS * eStatus); |
| 181 |
|
| 182 |
private: |
| 183 |
void InitPlatformKernelBinary( |
| 184 |
vp::VpPlatformInterface *&vpPlatformInterface); |
| 185 |
|
| 186 |
MEDIA_CLASS_DEFINE_END(VphalInterfacesXe_Lpm_Plus) |
| 187 |
}; |
| 188 |
|
| 189 |
class RenderHalInterfacesXe_Lpg : public RenderHalDevice |
| 190 |
{ |
| 191 |
protected: |
| 192 |
using XRenderHal = XRenderHal_Interface_Xe_Hpg_Next; |
| 193 |
MOS_STATUS Initialize(); |
| 194 |
|
| 195 |
MEDIA_CLASS_DEFINE_END(RenderHalInterfacesXe_Lpg) |
| 196 |
}; |
| 197 |
|
| 198 |
class MediaInterfacesHwInfoDeviceXe_Lpm_Plus : public MediaInterfacesHwInfoDevice |
| 199 |
{ |
| 200 |
public: |
| 201 |
virtual MOS_STATUS Initialize(PLATFORM platform) override; |
| 202 |
|
| 203 |
MEDIA_CLASS_DEFINE_END(MediaInterfacesHwInfoDeviceXe_Lpm_Plus) |
| 204 |
}; |
| 205 |
|
| 206 |
#endif // __MEDIA_INTERFACES_MTL_H__ |