Skip to content

Commit

Permalink
[Media Common] ARL-S Open Source Upstream
Browse files Browse the repository at this point in the history
This patch is for ARL-S open source upstream.

1. Move ARL-S to open source
2. Updated ARL  and MTL DeviceIDs to keep align with specification
and others minor change
  • Loading branch information
chenhao5-Intel authored and intel-mediadev committed Aug 14, 2023
1 parent 87146e8 commit e16c7ab
Show file tree
Hide file tree
Showing 11 changed files with 335 additions and 13 deletions.
12 changes: 9 additions & 3 deletions media_driver/cmake/linux/media_gen_flags_linux.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2017, Intel Corporation
# Copyright (c) 2017-2023, Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -119,12 +119,14 @@ cmake_dependent_option(PVC

option(MTL "Enable MTL support" ON)

if(MTL)
option(ARL "Enable ARL support" ON)

if(MTL OR ARL)
option(XE_LPM_PLUS_SUPPORT "Enable XE_LPM_PLUS support" ON)
option(XE_LPG "Enable XE_LPG support" ON)
endif()

if(MTL)
if(MTL OR ARL)
option(Xe_M_plus "Enable Xe_M_plus support" ON)
endif()

Expand Down Expand Up @@ -242,4 +244,8 @@ if(MTL)
add_definitions(-DIGFX_MTL_SUPPORTED)
endif()

if(ARL)
add_definitions(-DIGFX_ARL_SUPPORTED)
endif()

include(${MEDIA_EXT_CMAKE}/ext/linux/media_gen_flags_linux_ext.cmake OPTIONAL)
4 changes: 3 additions & 1 deletion media_softlet/cmake/linux/media_gen_flags_linux.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021, Intel Corporation
# Copyright (c) 2021-2023, Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand All @@ -20,4 +20,6 @@

option(MTL "Enable MTL support" ON)

option(ARL "Enable ARL support" ON)

include(${MEDIA_SOFTLET_EXT_CMAKE}/linux/media_gen_flags_linux_ext.cmake OPTIONAL)
3 changes: 3 additions & 0 deletions media_softlet/linux/Xe_M_plus/ddi/media_libva_caps_mtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ VAStatus MediaLibvaCapsMtl::GetDisplayAttributes(

static bool mtlRegistered = MediaLibvaCapsFactory<MediaLibvaCaps, DDI_MEDIA_CONTEXT>::
RegisterCaps<MediaLibvaCapsMtl>((uint32_t)IGFX_METEORLAKE);

static bool arlRegistered = MediaLibvaCapsFactory<MediaLibvaCaps, DDI_MEDIA_CONTEXT>::
RegisterCaps<MediaLibvaCapsMtl>((uint32_t)IGFX_ARROWLAKE);
35 changes: 35 additions & 0 deletions media_softlet/linux/Xe_M_plus/ddi/media_sku_wa_mtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,38 @@ static struct LinuxDeviceInit mtlDeviceInit =

static bool mtlDeviceRegister = DeviceInfoFactory<LinuxDeviceInit>::
RegisterDevice(IGFX_METEORLAKE, &mtlDeviceInit);

static bool InitArlMediaSku(struct GfxDeviceInfo *devInfo,
MediaFeatureTable * skuTable,
struct LinuxDriverInfo *drvInfo,
MediaUserSettingSharedPtr userSettingPtr)
{
if (!InitMtlMediaSkuExt(devInfo, skuTable, drvInfo, userSettingPtr))
{
return false;
}

return true;
}

static bool InitArlMediaWa(struct GfxDeviceInfo *devInfo,
MediaWaTable * waTable,
struct LinuxDriverInfo * drvInfo)
{
if (!InitMtlMediaWaExt(devInfo, waTable, drvInfo))
{
return false;
}

return true;
}

static struct LinuxDeviceInit arlDeviceInit =
{
.productFamily = (uint32_t)IGFX_ARROWLAKE,
.InitMediaFeature = InitArlMediaSku,
.InitMediaWa = InitArlMediaWa,
};

static bool arlDeviceRegister = DeviceInfoFactory<LinuxDeviceInit>::
RegisterDevice((uint32_t)IGFX_ARROWLAKE, &arlDeviceInit);
2 changes: 1 addition & 1 deletion media_softlet/linux/Xe_M_plus/ddi/media_srcs.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2017 - 2022, Intel Corporation
# Copyright (c) 2017-2023, Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand Down
28 changes: 23 additions & 5 deletions media_softlet/linux/Xe_M_plus/ddi/media_sysinfo_mtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,26 @@ static bool mtlDevice7d45 = DeviceInfoFactory<GfxDeviceInfo>::
static bool mtlDevice7d60 = DeviceInfoFactory<GfxDeviceInfo>::
RegisterDevice(0x7D60, &mtlInfo);

static bool mtlDevice7d57 = DeviceInfoFactory<GfxDeviceInfo>::
RegisterDevice(0x7D57, &mtlInfo);

static bool mtlDevice7dD7 = DeviceInfoFactory<GfxDeviceInfo>::
RegisterDevice(0x7DD7, &mtlInfo);
static struct GfxDeviceInfo arlInfo = {
.platformType = PLATFORM_MOBILE,
.productFamily = (uint32_t)IGFX_ARROWLAKE,
.displayFamily = IGFX_UNKNOWN_CORE,
.renderFamily = IGFX_GEN12_CORE,
.mediaFamily = IGFX_UNKNOWN_CORE,
.eGTType = GTTYPE_GT2,
.L3CacheSizeInKb = 0,
.L3BankCount = 0,
.EUCount = 0,
.SliceCount = 0,
.SubSliceCount = 0,
.MaxEuPerSubSlice = 0,
.isLCIA = 0,
.hasLLC = 0,
.hasERAM = 0,
.InitMediaSysInfo = InitMtlMediaSysInfo,
.InitShadowSku = InitMtlShadowSku,
.InitShadowWa = InitMtlShadowWa,
};

static bool arlsDevice7d67 = DeviceInfoFactory<GfxDeviceInfo>::
RegisterDevice(0x7D67, &arlInfo);
4 changes: 2 additions & 2 deletions media_softlet/linux/media_srcs.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019, Intel Corporation
# Copyright (c) 2019-2023, Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand All @@ -24,6 +24,6 @@ if(XE_LPM_PLUS_SUPPORT)
media_include_subdirectory(xe_lpm_plus)
endif()

if(MTL)
if(MTL OR ARL)
media_include_subdirectory(Xe_M_plus)
endif()
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*===================== begin_copyright_notice ==================================
# Copyright (c) 2023, Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
======================= end_copyright_notice ==================================*/
//!
//! \file media_interfaces_arl.cpp

//! \brief Helps with ARL factory creation.
//!

#include "media_interfaces_arl.h"

#include "codechal_common.h"
#include "codechal_debug.h"

#include "vp_pipeline_adapter_xe_lpm_plus.h"
#include "vp_platform_interface_xe_lpm_plus.h"
#include "mhw_mi_xe_lpm_plus_base_next_impl.h"
#include "mhw_blt_xe_lpm_plus_base_next_impl.h"
#include "mhw_sfc_xe_lpm_plus_base_next_impl.h"
#include "mhw_vebox_xe_lpm_plus_base_next_impl.h"
#include "mhw_render_xe_hpg_impl.h"

#if defined(ENABLE_KERNELS)
#include "igvpkrn_xe_hpg.h"
#include "igvpkrn_xe_hpg_cmfcpatch.h"
#if !defined(_FULL_OPEN_SOURCE)
#include "igvpkrn_isa_xe_hpg.h"
#endif
#endif

using namespace mhw::vdbox::avp::xe_lpm_plus_base;
using namespace mhw::vdbox::vdenc::xe_lpm_plus_base;
using namespace mhw::vdbox::huc::xe_lpm_plus_base;
using namespace mhw::vdbox::mfx::xe_lpm_plus_base;

extern template class MediaFactory<uint32_t, CodechalDeviceNext>;
extern template class MediaFactory<uint32_t, VphalDevice>;
extern template class MediaFactory<uint32_t, RenderHalDevice>;
extern template class MediaFactory<uint32_t, MediaInterfacesHwInfoDevice>;

// Swith to use new media factory template
extern template class MediaFactory<uint32_t, MhwInterfacesNext>;
extern template class MediaFactory<uint32_t, MmdDeviceNext>;

static bool arlRegisteredVphal =
MediaFactory<uint32_t, VphalDevice>::
Register<VphalInterfacesXe_Lpm_Plus>((uint32_t)IGFX_ARROWLAKE);

static bool arlRegisteredMhwNext =
MediaFactory<uint32_t, MhwInterfacesNext>::
Register<MhwInterfacesXe_Lpm_Plus_Next>((uint32_t)IGFX_ARROWLAKE);

#ifdef _MMC_SUPPORTED
static bool arlRegisteredMmd =
MediaFactory<uint32_t, MmdDeviceNext>::
Register<MmdDeviceXe_Lpm_Plus_Next>((uint32_t)IGFX_ARROWLAKE);
#endif

static bool arlRegisteredMcpy =
MediaFactory<uint32_t, McpyDeviceNext>::
Register<McpyDeviceXe_Lpm_Plus>((uint32_t)IGFX_ARROWLAKE);

static bool arlRegisteredCodecHal =
MediaFactory<uint32_t, CodechalDeviceNext>::
Register<CodechalInterfacesXe_Lpm_Plus>((uint32_t)IGFX_ARROWLAKE);

static bool arlRegisteredRenderHal =
MediaFactory<uint32_t, RenderHalDevice>::
Register<RenderHalInterfacesXe_Lpg>((uint32_t)IGFX_ARROWLAKE);

static bool arlRegisteredHwInfo =
MediaFactory<uint32_t, MediaInterfacesHwInfoDevice>::
Register<MediaInterfacesHwInfoDeviceXe_Lpm_Plus>((uint32_t)IGFX_ARROWLAKE);

Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/*===================== begin_copyright_notice ==================================
# Copyright (c) 2023, Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
======================= end_copyright_notice ==================================*/
//!
//! \file media_interfaces_arl.h
//! \brief All interfaces used for ARL that require factory creation
//!

#ifndef __MEDIA_INTERFACES_ARL_H__
#define __MEDIA_INTERFACES_ARL_H__

#include "media_interfaces_mtl.h"
#include "media_interfaces_mhw_next.h"
#include "media_interfaces_codechal_next.h"
#include "media_interfaces_mcpy_next.h"
#include "media_interfaces_mmd_next.h"

#include "media_interfaces_vphal.h"
#include "media_interfaces_renderhal.h"
#include "media_interfaces_hwinfo_device.h"

#include "mhw_cp_interface.h"

#include "mhw_vdbox_mfx_impl_xe_lpm_plus.h"

#include "mhw_vdbox_avp_impl_xe_lpm_plus.h"

#include "mhw_vdbox_huc_impl_xe_lpm_plus.h"

#include "mhw_vdbox_hcp_impl_xe_lpm_plus.h"

#include "mhw_vdbox_vdenc_impl_xe_lpm_plus.h"

#include "media_mem_decompress_xe_lpm_plus_base.h"
#include "media_copy_xe_lpm_plus_base.h"
#include "mhw_state_heap_xe_hpg.h"
#include "codec_hw_xe_lpm_plus_base.h"

#ifdef _AVC_DECODE_SUPPORTED
#include "decode_avc_pipeline_adapter_xe_lpm_plus.h"
#endif

#ifdef _HEVC_DECODE_SUPPORTED
#include "decode_hevc_pipeline_adapter_xe_lpm_plus.h"
#endif

#ifdef _JPEG_DECODE_SUPPORTED
#include "decode_jpeg_pipeline_adapter_xe_lpm_plus.h"
#endif

#ifdef _MPEG2_DECODE_SUPPORTED
#include "decode_mpeg2_pipeline_adapter_xe_lpm_plus.h"
#endif

#ifdef _VP9_DECODE_SUPPORTED
#include "decode_vp9_pipeline_adapter_xe_lpm_plus.h"
#endif

#ifdef _VP8_DECODE_SUPPORTED
#include "decode_vp8_pipeline_adapter_xe_lpm_plus.h"
#endif

#ifdef _AV1_DECODE_SUPPORTED
#include "decode_av1_pipeline_adapter_xe_lpm_plus.h"
#endif

#ifdef _JPEG_ENCODE_SUPPORTED
#include "encode_jpeg_pipeline_adapter_xe_lpm_plus_base.h"
#endif

#ifdef _HEVC_ENCODE_VDENC_SUPPORTED
#include "encode_hevc_vdenc_pipeline_adapter_xe_lpm_plus.h"
#endif

#ifdef _AV1_ENCODE_VDENC_SUPPORTED
#include "encode_av1_vdenc_pipeline_adapter_xe_lpm_plus.h"
#endif

#ifdef _AVC_ENCODE_VDENC_SUPPORTED
#include "encode_avc_vdenc_pipeline_adapter_xe_lpm_plus_base.h"
#endif

#ifdef _VP9_ENCODE_VDENC_SUPPORTED
#ifndef _APOGEIOS_SUPPORTED
#ifdef _MEDIA_RESERVED
#include "codechal_vdenc_vp9_xe_lpm_plus.h"
#endif
#endif
#include "encode_vp9_vdenc_pipeline_adapter_xe_lpm_plus.h"
#endif

#include "renderhal_xe_hpg_next.h"


#include "decode_scalability_singlepipe_next.h"
#include "decode_scalability_multipipe_next.h"

#endif // __MEDIA_INTERFACES_ARL_H__
Loading

0 comments on commit e16c7ab

Please sign in to comment.