| 1 |
/*===================== begin_copyright_notice ================================== |
| 2 |
|
| 3 |
* Copyright (c) 2024, 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_bmg.h |
| 26 |
//! \brief All interfaces used for BMG that require factory creation |
| 27 |
//! |
| 28 |
|
| 29 |
#ifndef __MEDIA_INTERFACES_XE2_HPM_H__ |
| 30 |
#define __MEDIA_INTERFACES_XE2_HPM_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_vphal.h" |
| 36 |
#include "media_interfaces_renderhal.h" |
| 37 |
#include "media_interfaces_hwinfo_device.h" |
| 38 |
|
| 39 |
#include "mhw_cp_interface.h" |
| 40 |
#include "mhw_state_heap_xe2_hpg.h" |
| 41 |
#include "mhw_vdbox_mfx_impl_xe2_hpm.h" |
| 42 |
#include "mhw_vdbox_avp_impl_xe2_hpm.h" |
| 43 |
#include "mhw_vdbox_huc_impl_xe2_hpm.h" |
| 44 |
#include "mhw_vdbox_hcp_impl_xe2_hpm.h" |
| 45 |
|
| 46 |
#include "mhw_vdbox_vdenc_impl_xe2_hpm.h" |
| 47 |
|
| 48 |
#include "codec_hw_xe_lpm_plus_base.h" |
| 49 |
|
| 50 |
#ifdef _AVC_DECODE_SUPPORTED |
| 51 |
#include "decode_avc_pipeline_adapter_xe2_hpm.h" |
| 52 |
#endif |
| 53 |
|
| 54 |
#ifdef _HEVC_DECODE_SUPPORTED |
| 55 |
#include "decode_hevc_pipeline_adapter_xe2_hpm.h" |
| 56 |
#endif |
| 57 |
|
| 58 |
#ifdef _JPEG_DECODE_SUPPORTED |
| 59 |
#include "decode_jpeg_pipeline_adapter_xe2_hpm.h" |
| 60 |
#endif |
| 61 |
|
| 62 |
#ifdef _MPEG2_DECODE_SUPPORTED |
| 63 |
#include "decode_mpeg2_pipeline_adapter_xe2_hpm.h" |
| 64 |
#endif |
| 65 |
|
| 66 |
#ifdef _VP9_DECODE_SUPPORTED |
| 67 |
#include "decode_vp9_pipeline_adapter_xe2_hpm.h" |
| 68 |
#endif |
| 69 |
|
| 70 |
#ifdef _AV1_DECODE_SUPPORTED |
| 71 |
#include "decode_av1_pipeline_adapter_xe2_hpm.h" |
| 72 |
#endif |
| 73 |
|
| 74 |
#ifdef _VP8_DECODE_SUPPORTED |
| 75 |
#include "decode_vp8_pipeline_adapter_xe2_hpm.h" |
| 76 |
#endif |
| 77 |
|
| 78 |
#ifdef _JPEG_ENCODE_SUPPORTED |
| 79 |
#include "encode_jpeg_pipeline_adapter.h" |
| 80 |
#endif |
| 81 |
|
| 82 |
#ifdef _HEVC_ENCODE_VDENC_SUPPORTED |
| 83 |
#include "encode_hevc_vdenc_pipeline_adapter_xe2_hpm.h" |
| 84 |
#endif |
| 85 |
|
| 86 |
#ifdef _AVC_ENCODE_VDENC_SUPPORTED |
| 87 |
#include "encode_avc_vdenc_pipeline_adapter_xe2_hpm.h" |
| 88 |
#endif |
| 89 |
|
| 90 |
#ifdef _AV1_ENCODE_VDENC_SUPPORTED |
| 91 |
#include "encode_av1_vdenc_pipeline_adapter_xe2_hpm.h" |
| 92 |
#endif |
| 93 |
|
| 94 |
#ifdef _MEDIA_RESERVED |
| 95 |
#ifdef _VP9_ENCODE_VDENC_SUPPORTED |
| 96 |
#include "encode_vp9_vdenc_pipeline_adapter_xe2_hpm.h" |
| 97 |
#endif |
| 98 |
#endif |
| 99 |
|
| 100 |
#include "renderhal_xe2_hpg_next.h" |
| 101 |
#include "decode_scalability_singlepipe_next.h" |
| 102 |
#include "decode_scalability_multipipe_next.h" |
| 103 |
|
| 104 |
#include "media_copy_xe2_hpm_base.h" |
| 105 |
|
| 106 |
class MhwInterfacesBmg_Next : public MhwInterfacesNext |
| 107 |
{ |
| 108 |
public: |
| 109 |
|
| 110 |
//TODO, Remove legacy mhw sub interfaces |
| 111 |
using Cp = MhwCpInterface; |
| 112 |
using StateHeap = MHW_STATE_HEAP_INTERFACE_XE2_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(MhwInterfacesBmg_Next) |
| 125 |
}; |
| 126 |
|
| 127 |
class CodechalDecodeInterfacesXe2_Hpm |
| 128 |
{ |
| 129 |
public: |
| 130 |
#ifdef _AVC_DECODE_SUPPORTED |
| 131 |
using Avc = DecodeAvcPipelineAdapterXe2_Hpm; |
| 132 |
#endif |
| 133 |
#ifdef _HEVC_DECODE_SUPPORTED |
| 134 |
using Hevc = DecodeHevcPipelineAdapterXe2_Hpm; |
| 135 |
#endif |
| 136 |
#ifdef _JPEG_DECODE_SUPPORTED |
| 137 |
using Jpeg = DecodeJpegPipelineAdapterXe2_Hpm; |
| 138 |
#endif |
| 139 |
#ifdef _MPEG2_DECODE_SUPPORTED |
| 140 |
using Mpeg2 = DecodeMpeg2PipelineAdapterXe2_Hpm; |
| 141 |
#endif |
| 142 |
#ifdef _VP9_DECODE_SUPPORTED |
| 143 |
using Vp9 = DecodeVp9PipelineAdapterXe2_Hpm; |
| 144 |
#endif |
| 145 |
#ifdef _AV1_DECODE_SUPPORTED |
| 146 |
using Av1 = DecodeAv1PipelineAdapterXe2_Hpm; |
| 147 |
#endif |
| 148 |
#ifdef _VP8_DECODE_SUPPORTED |
| 149 |
using Vp8 = DecodeVp8PipelineAdapterXe2_Hpm; |
| 150 |
#endif |
| 151 |
MEDIA_CLASS_DEFINE_END(CodechalDecodeInterfacesXe2_Hpm) |
| 152 |
}; |
| 153 |
|
| 154 |
class CodechalInterfacesXe2_Hpm : public CodechalDeviceNext |
| 155 |
{ |
| 156 |
public: |
| 157 |
using Decode = CodechalDecodeInterfacesXe2_Hpm; |
| 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(CodechalInterfacesXe2_Hpm) |
| 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 VphalInterfacesXe2_Hpm : 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(VphalInterfacesXe2_Hpm) |
| 201 |
}; |
| 202 |
|
| 203 |
class RenderHalInterfacesXe2_Hpg : public RenderHalDevice |
| 204 |
{ |
| 205 |
protected: |
| 206 |
using XRenderHal = XRenderHal_Interface_Xe2_Hpg_Next; |
| 207 |
MOS_STATUS Initialize(); |
| 208 |
|
| 209 |
MEDIA_CLASS_DEFINE_END(RenderHalInterfacesXe2_Hpg) |
| 210 |
}; |
| 211 |
|
| 212 |
class MediaInterfacesHwInfoDeviceXe2_Hpm : public MediaInterfacesHwInfoDevice |
| 213 |
{ |
| 214 |
public: |
| 215 |
virtual MOS_STATUS Initialize(PLATFORM platform) override; |
| 216 |
|
| 217 |
MEDIA_CLASS_DEFINE_END(MediaInterfacesHwInfoDeviceXe2_Hpm) |
| 218 |
}; |
| 219 |
|
| 220 |
using McpyDeviceXe2_Hpm = McpyDeviceNextImpl<MediaCopyStateXe2_Hpm_Base>; |
| 221 |
|
| 222 |
#endif // __MEDIA_INTERFACES_XE2_HPM_H__ |