| 1 |
/* |
| 2 |
* Copyright (c) 2017-2021, 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 media_interfaces_g12_tgllp.h |
| 24 |
//! \brief All interfaces used for TGLLP that require factory creation |
| 25 |
//! |
| 26 |
|
| 27 |
#ifndef __MEDIA_INTERFACES_G12_TGLLP_H__ |
| 28 |
#define __MEDIA_INTERFACES_G12_TGLLP_H__ |
| 29 |
|
| 30 |
#include "media_interfaces_mhw.h" |
| 31 |
#include "media_interfaces_codechal.h" |
| 32 |
#include "media_interfaces_mmd.h" |
| 33 |
#include "media_interfaces_mcpy.h" |
| 34 |
#include "media_interfaces_cmhal.h" |
| 35 |
#include "media_interfaces_vphal.h" |
| 36 |
#include "media_interfaces_renderhal.h" |
| 37 |
#include "media_interfaces_nv12top010.h" |
| 38 |
#include "media_interfaces_decode_histogram.h" |
| 39 |
#include "media_interfaces_hwinfo_device.h" |
| 40 |
|
| 41 |
#include "mhw_cp_interface.h" |
| 42 |
#include "mhw_mi_g12_X.h" |
| 43 |
#include "mhw_render_g12_X.h" |
| 44 |
#include "mhw_sfc_g12_X.h" |
| 45 |
#include "mhw_state_heap_g12.h" |
| 46 |
#include "mhw_vebox_g12_X.h" |
| 47 |
#include "mhw_vdbox_mfx_g12_X.h" |
| 48 |
#include "mhw_vdbox_hcp_g12_X.h" |
| 49 |
#include "mhw_vdbox_huc_g12_X.h" |
| 50 |
#include "mhw_vdbox_vdenc_g12_X.h" |
| 51 |
#include "mhw_blt_legacy.h" |
| 52 |
#include "mhw_vdbox_avp_g12_X.h" |
| 53 |
|
| 54 |
#ifdef _MEDIA_RESERVED |
| 55 |
#include "mhw_vdbox_vdenc_g12_X_ext.h" |
| 56 |
#endif |
| 57 |
|
| 58 |
#include "vphal_render_vebox_memdecomp_g12.h" |
| 59 |
#include "media_copy_m12_0.h" |
| 60 |
|
| 61 |
#include "codechal_hw_g12_X.h" |
| 62 |
#ifdef _AVC_DECODE_SUPPORTED |
| 63 |
#include "codechal_decode_avc_g12.h" |
| 64 |
#ifdef _MEDIA_RESERVED |
| 65 |
#include "decode_avc_pipeline_adapter_m12.h" |
| 66 |
#endif |
| 67 |
#endif |
| 68 |
#include "codechal_decode_downsampling_g12.h" |
| 69 |
|
| 70 |
#ifdef _HEVC_DECODE_SUPPORTED |
| 71 |
#include "codechal_decode_hevc_g12.h" |
| 72 |
#endif |
| 73 |
|
| 74 |
#ifdef _JPEG_DECODE_SUPPORTED |
| 75 |
#include "codechal_decode_jpeg_g12.h" |
| 76 |
#endif |
| 77 |
|
| 78 |
#ifdef _MPEG2_DECODE_SUPPORTED |
| 79 |
#include "codechal_decode_mpeg2_g12.h" |
| 80 |
#ifdef _MEDIA_RESERVED |
| 81 |
#include "decode_mpeg2_pipeline_adapter_m12.h" |
| 82 |
#endif |
| 83 |
#endif |
| 84 |
|
| 85 |
#ifdef _VC1_DECODE_SUPPORTED |
| 86 |
#include "codechal_decode_vc1_g12.h" |
| 87 |
#endif |
| 88 |
|
| 89 |
#ifdef _VP8_DECODE_SUPPORTED |
| 90 |
#include "codechal_decode_vp8_g12.h" |
| 91 |
#endif |
| 92 |
|
| 93 |
#ifdef _VP9_DECODE_SUPPORTED |
| 94 |
#include "codechal_decode_vp9_g12.h" |
| 95 |
#endif |
| 96 |
|
| 97 |
#ifdef _JPEG_ENCODE_SUPPORTED |
| 98 |
#include "codechal_encode_jpeg_g12.h" |
| 99 |
#ifdef _MEDIA_RESERVED |
| 100 |
#include "decode_jpeg_pipeline_adapter_m12.h" |
| 101 |
#endif |
| 102 |
#endif |
| 103 |
|
| 104 |
#ifdef _AV1_DECODE_SUPPORTED |
| 105 |
#include "decode_av1_pipeline_adapter_g12.h" |
| 106 |
#endif |
| 107 |
|
| 108 |
#include "codechal_encode_csc_ds_g12.h" |
| 109 |
#include "codechal_encode_csc_ds_mdf_g12.h" |
| 110 |
|
| 111 |
#ifdef _VP9_ENCODE_VDENC_SUPPORTED |
| 112 |
#include "codechal_vdenc_vp9_g12.h" |
| 113 |
#ifdef _MEDIA_RESERVED |
| 114 |
#include "encode_vp9_vdenc_pipeline_adapter_m12.h" |
| 115 |
#endif |
| 116 |
#endif |
| 117 |
|
| 118 |
#ifdef _MPEG2_ENCODE_VME_SUPPORTED |
| 119 |
#include "codechal_encode_mpeg2_g12.h" |
| 120 |
#endif |
| 121 |
|
| 122 |
#ifdef _HEVC_ENCODE_VME_SUPPORTED |
| 123 |
#include "codechal_encode_hevc_g12.h" |
| 124 |
#include "codechal_encode_hevc_mbenc_g12.h" |
| 125 |
#endif |
| 126 |
#ifdef _HEVC_ENCODE_VDENC_SUPPORTED |
| 127 |
#include "codechal_vdenc_hevc_g12.h" |
| 128 |
#ifdef _MEDIA_RESERVED |
| 129 |
#include "decode_hevc_pipeline_adapter_m12.h" |
| 130 |
#include "decode_vp9_pipeline_adapter_m12.h" |
| 131 |
#endif |
| 132 |
#endif |
| 133 |
|
| 134 |
#ifdef _AVC_ENCODE_VME_SUPPORTED |
| 135 |
#include "codechal_encode_avc_g12.h" |
| 136 |
#endif |
| 137 |
#ifdef _AVC_ENCODE_VDENC_SUPPORTED |
| 138 |
#include "codechal_vdenc_avc_g12.h" |
| 139 |
#endif |
| 140 |
|
| 141 |
#include "cm_hal_g12.h" |
| 142 |
#include "vphal_g12_tgllp.h" |
| 143 |
#include "renderhal_g12_0.h" |
| 144 |
|
| 145 |
#include "codechal_decode_histogram_g12.h" |
| 146 |
#include "decode_scalability_singlepipe.h" |
| 147 |
#include "decode_scalability_multipipe.h" |
| 148 |
|
| 149 |
#if LINUX |
| 150 |
#include "vp_pipeline_adapter_g12.h" |
| 151 |
#endif |
| 152 |
|
| 153 |
|
| 154 |
class MhwInterfacesG12Tgllp : public MhwInterfaces |
| 155 |
{ |
| 156 |
public: |
| 157 |
using Mi = MhwMiInterfaceG12; |
| 158 |
using Cp = MhwCpInterface; |
| 159 |
using Render = MhwRenderInterfaceG12; |
| 160 |
using Sfc = MhwSfcInterfaceG12; |
| 161 |
using StateHeap = MHW_STATE_HEAP_INTERFACE_G12_X; // to be updated when headers regenerated |
| 162 |
using Mfx = MhwVdboxMfxInterfaceG12; |
| 163 |
using Hcp = MhwVdboxHcpInterfaceG12; |
| 164 |
using Huc = MhwVdboxHucInterfaceG12; |
| 165 |
using Avp = MhwVdboxAvpInterfaceG12; |
| 166 |
#ifdef _MEDIA_RESERVED |
| 167 |
using Vdenc = MhwVdboxVdencInterfaceG12ExtX; |
| 168 |
#else |
| 169 |
using Vdenc = MhwVdboxVdencInterfaceG12X; |
| 170 |
#endif |
| 171 |
using Vebox = MhwVeboxInterfaceG12; |
| 172 |
using Blt = MhwBltInterface; |
| 173 |
|
| 174 |
MOS_STATUS Initialize( |
| 175 |
CreateParams params, |
| 176 |
PMOS_INTERFACE osInterface); |
| 177 |
|
| 178 |
//! |
| 179 |
//! \brief Destroys all created MHW interfaces |
| 180 |
//! \details If the HAL creation fails, this is used for cleanup |
| 181 |
//! |
| 182 |
virtual void Destroy(); |
| 183 |
}; |
| 184 |
|
| 185 |
class MmdDeviceG12Tgllp : public MmdDevice |
| 186 |
{ |
| 187 |
public: |
| 188 |
using Mmd = MediaVeboxDecompStateG12; |
| 189 |
|
| 190 |
MOS_STATUS Initialize( |
| 191 |
PMOS_INTERFACE osInterface, |
| 192 |
MhwInterfaces *mhwInterfaces); |
| 193 |
|
| 194 |
MhwInterfaces* CreateMhwInterface( |
| 195 |
PMOS_INTERFACE osInterface); |
| 196 |
}; |
| 197 |
|
| 198 |
class McpyDeviceG12Tgllp : public McpyDevice |
| 199 |
{ |
| 200 |
public : |
| 201 |
using Mcpy = MediaCopyStateM12_0; |
| 202 |
|
| 203 |
MOS_STATUS Initialize( |
| 204 |
PMOS_INTERFACE osInterface); |
| 205 |
protected: |
| 206 |
MhwInterfaces* CreateMhwInterface( |
| 207 |
PMOS_INTERFACE osInterface); |
| 208 |
}; |
| 209 |
|
| 210 |
class Nv12ToP010DeviceG12Tgllp : public Nv12ToP010Device |
| 211 |
{ |
| 212 |
public: |
| 213 |
|
| 214 |
MOS_STATUS Initialize( |
| 215 |
PMOS_INTERFACE osInterface); |
| 216 |
}; |
| 217 |
|
| 218 |
class CodechalDecodeInterfacesG12Tgllp |
| 219 |
{ |
| 220 |
public: |
| 221 |
#ifdef _AVC_DECODE_SUPPORTED |
| 222 |
using Avc = CodechalDecodeAvcG12; |
| 223 |
#endif |
| 224 |
#ifdef _HEVC_DECODE_SUPPORTED |
| 225 |
using Hevc = CodechalDecodeHevcG12; |
| 226 |
#endif |
| 227 |
#ifdef _JPEG_DECODE_SUPPORTED |
| 228 |
using Jpeg = CodechalDecodeJpegG12; |
| 229 |
#endif |
| 230 |
#ifdef _MPEG2_DECODE_SUPPORTED |
| 231 |
using Mpeg2 = CodechalDecodeMpeg2G12; |
| 232 |
#endif |
| 233 |
#ifdef _VC1_DECODE_SUPPORTED |
| 234 |
using Vc1 = CodechalDecodeVc1G12; |
| 235 |
#endif |
| 236 |
#ifdef _VP8_DECODE_SUPPORTED |
| 237 |
using Vp8 = CodechalDecodeVp8G12; |
| 238 |
#endif |
| 239 |
#ifdef _VP9_DECODE_SUPPORTED |
| 240 |
using Vp9 = CodechalDecodeVp9G12; |
| 241 |
#endif |
| 242 |
#ifdef _AV1_DECODE_SUPPORTED |
| 243 |
using Av1 = DecodeAv1PipelineAdapterG12; |
| 244 |
#endif |
| 245 |
#ifdef _DECODE_PROCESSING_SUPPORTED |
| 246 |
using FieldScaling = FieldScalingInterfaceG12; |
| 247 |
#endif |
| 248 |
}; |
| 249 |
|
| 250 |
class CodechalEncodeInterfacesG12Tgllp |
| 251 |
{ |
| 252 |
public: |
| 253 |
using CscDs = CodechalEncodeCscDsG12; |
| 254 |
using CscDsMdf = CodechalEncodeCscDsMdfG12; |
| 255 |
#ifdef _VP9_ENCODE_VDENC_SUPPORTED |
| 256 |
using Vp9 = CodechalVdencVp9StateG12; |
| 257 |
#endif |
| 258 |
#ifdef _JPEG_ENCODE_SUPPORTED |
| 259 |
using Jpeg = CodechalEncodeJpegStateG12; |
| 260 |
#endif |
| 261 |
#ifdef _MPEG2_ENCODE_VME_SUPPORTED |
| 262 |
using Mpeg2 = CodechalEncodeMpeg2G12; |
| 263 |
#endif |
| 264 |
#ifdef _HEVC_ENCODE_VME_SUPPORTED |
| 265 |
using HevcEnc = CodechalEncHevcStateG12; |
| 266 |
using HevcMbenc = CodecHalHevcMbencG12; |
| 267 |
#endif |
| 268 |
#ifdef _HEVC_ENCODE_VDENC_SUPPORTED |
| 269 |
using HevcVdenc = CodechalVdencHevcStateG12; |
| 270 |
#endif |
| 271 |
#ifdef _AVC_ENCODE_VME_SUPPORTED |
| 272 |
using AvcEnc = CodechalEncodeAvcEncG12; |
| 273 |
#endif |
| 274 |
#ifdef _AVC_ENCODE_VDENC_SUPPORTED |
| 275 |
using AvcVdenc = CodechalVdencAvcStateG12; |
| 276 |
#endif |
| 277 |
}; |
| 278 |
|
| 279 |
|
| 280 |
class CodechalInterfacesG12Tgllp : public CodechalDevice |
| 281 |
{ |
| 282 |
public: |
| 283 |
using Decode = CodechalDecodeInterfacesG12Tgllp; |
| 284 |
using Encode = CodechalEncodeInterfacesG12Tgllp; |
| 285 |
using Hw = CodechalHwInterfaceG12; |
| 286 |
|
| 287 |
MOS_STATUS Initialize( |
| 288 |
void *standardInfo, |
| 289 |
void *settings, |
| 290 |
MhwInterfaces *mhwInterfaces, |
| 291 |
PMOS_INTERFACE osInterface) override; |
| 292 |
}; |
| 293 |
|
| 294 |
class CMHalInterfacesG12Tgllp : public CMHalDevice |
| 295 |
{ |
| 296 |
protected: |
| 297 |
using CMHal = CM_HAL_G12_X; |
| 298 |
MOS_STATUS Initialize( |
| 299 |
CM_HAL_STATE *pCmState); |
| 300 |
}; |
| 301 |
|
| 302 |
class VphalInterfacesG12Tgllp : public VphalDevice |
| 303 |
{ |
| 304 |
public: |
| 305 |
using VphalState = VphalStateG12Tgllp; |
| 306 |
|
| 307 |
MOS_STATUS Initialize( |
| 308 |
PMOS_INTERFACE osInterface, |
| 309 |
bool bInitVphalState, |
| 310 |
MOS_STATUS *eStatus, |
| 311 |
bool clearViewMode = false); |
| 312 |
|
| 313 |
MOS_STATUS CreateVpPlatformInterface( |
| 314 |
PMOS_INTERFACE osInterface, |
| 315 |
MOS_STATUS * eStatus); |
| 316 |
}; |
| 317 |
|
| 318 |
class RenderHalInterfacesG12Tgllp : public RenderHalDevice |
| 319 |
{ |
| 320 |
protected: |
| 321 |
using XRenderHal = XRenderHal_Interface_G12_0; |
| 322 |
MOS_STATUS Initialize(); |
| 323 |
}; |
| 324 |
|
| 325 |
class DecodeHistogramDeviceG12Tgllp : public DecodeHistogramDevice |
| 326 |
{ |
| 327 |
public: |
| 328 |
using DecodeHistogramG12 = CodechalDecodeHistogramG12; |
| 329 |
|
| 330 |
MOS_STATUS Initialize( |
| 331 |
CodechalHwInterface *hwInterface, |
| 332 |
PMOS_INTERFACE osInterface); |
| 333 |
}; |
| 334 |
|
| 335 |
class MediaInterfacesHwInfoDeviceG12Tgllp : public MediaInterfacesHwInfoDevice |
| 336 |
{ |
| 337 |
public: |
| 338 |
MOS_STATUS Initialize(PLATFORM platform); |
| 339 |
}; |
| 340 |
|
| 341 |
#endif // __MEDIA_INTERFACES_G12_TGLLP_H__ |