1 /*===================== begin_copyright_notice ==================================
2 
3 # Copyright (c) 2023, 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_arl.cpp
26 
27 //! \brief    Helps with ARL factory creation.
28 //!
29 
30 #include "media_interfaces_arl.h"
31 
32 #include "codechal_common.h"
33 #include "codechal_debug.h"
34 
35 #include "vp_pipeline_adapter_xe_lpm_plus.h"
36 #include "vp_platform_interface_xe_lpm_plus.h"
37 #include "mhw_mi_xe_lpm_plus_base_next_impl.h"
38 #include "mhw_blt_xe_lpm_plus_base_next_impl.h"
39 #include "mhw_sfc_xe_lpm_plus_base_next_impl.h"
40 #include "mhw_vebox_xe_lpm_plus_base_next_impl.h"
41 #include "mhw_render_xe_hpg_impl.h"
42 
43 #if defined(ENABLE_KERNELS)
44 #include "igvpkrn_xe_hpg.h"
45 #include "igvpkrn_xe_hpg_cmfcpatch.h"
46 #if !defined(_FULL_OPEN_SOURCE)
47 #include "igvpkrn_isa_xe_hpg.h"
48 #endif
49 #endif
50 
51 using namespace mhw::vdbox::avp::xe_lpm_plus_base;
52 using namespace mhw::vdbox::vdenc::xe_lpm_plus_base;
53 using namespace mhw::vdbox::huc::xe_lpm_plus_base;
54 using namespace mhw::vdbox::mfx::xe_lpm_plus_base;
55 
56 extern template class MediaFactory<uint32_t, CodechalDeviceNext>;
57 extern template class MediaFactory<uint32_t, VphalDevice>;
58 extern template class MediaFactory<uint32_t, RenderHalDevice>;
59 extern template class MediaFactory<uint32_t, MediaInterfacesHwInfoDevice>;
60 
61 // Swith to use new media factory template
62 extern template class MediaFactory<uint32_t, MhwInterfacesNext>;
63 extern template class MediaFactory<uint32_t, MmdDeviceNext>;
64 
65 static bool arlRegisteredVphal =
66     MediaFactory<uint32_t, VphalDevice>::
67         Register<VphalInterfacesXe_Lpm_Plus>((uint32_t)IGFX_ARROWLAKE);
68 
69 static bool arlRegisteredMhwNext =
70     MediaFactory<uint32_t, MhwInterfacesNext>::
71         Register<MhwInterfacesXe_Lpm_Plus_Next>((uint32_t)IGFX_ARROWLAKE);
72 
73 #ifdef _MMC_SUPPORTED
74 static bool arlRegisteredMmd =
75     MediaFactory<uint32_t, MmdDeviceNext>::
76     Register<MmdDeviceXe_Lpm_Plus_Next>((uint32_t)IGFX_ARROWLAKE);
77 #endif
78 
79 static bool arlRegisteredMcpy =
80     MediaFactory<uint32_t, McpyDeviceNext>::
81     Register<McpyDeviceXe_Lpm_Plus>((uint32_t)IGFX_ARROWLAKE);
82 
83 static bool arlRegisteredCodecHal =
84     MediaFactory<uint32_t, CodechalDeviceNext>::
85         Register<CodechalInterfacesXe_Lpm_Plus>((uint32_t)IGFX_ARROWLAKE);
86 
87 static bool arlRegisteredRenderHal =
88     MediaFactory<uint32_t, RenderHalDevice>::
89         Register<RenderHalInterfacesXe_Lpg>((uint32_t)IGFX_ARROWLAKE);
90 
91 static bool arlRegisteredHwInfo =
92     MediaFactory<uint32_t, MediaInterfacesHwInfoDevice>::
93     Register<MediaInterfacesHwInfoDeviceXe_Lpm_Plus>((uint32_t)IGFX_ARROWLAKE);
94 
95