Debian Codegraph @

media_driver/media_interface/media_interfaces_m12_adln/media_interfaces_g12_adln.cpp

raw
1 /*
2 * Copyright (c) 2011-2022, 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 //!
24 //! \file media_interfaces_g12_adln.cpp
25
26 //! \brief Helps with Gen12 ADL-N factory creation.
27 //!
28
29 #include "media_interfaces_g12_adln.h"
30
31 extern template class MediaFactory<uint32_t, MhwInterfaces>;
32 extern template class MediaFactory<uint32_t, MmdDevice>;
33 extern template class MediaFactory<uint32_t, CodechalDevice>;
34 extern template class MediaFactory<uint32_t, CMHalDevice>;
35 extern template class MediaFactory<uint32_t, VphalDevice>;
36 extern template class MediaFactory<uint32_t, RenderHalDevice>;
37 extern template class MediaFactory<uint32_t, Nv12ToP010Device>;
38 extern template class MediaFactory<uint32_t, DecodeHistogramDevice>;
39
40 static bool adlnRegisteredVphal =
41 MediaFactory<uint32_t, VphalDevice>::
42 Register<VphalInterfacesG12Tgllp>((uint32_t)IGFX_ALDERLAKE_N);
43
44 static bool adlnRegisteredMhw =
45 MediaFactory<uint32_t, MhwInterfaces>::
46 Register<MhwInterfacesG12Tgllp>((uint32_t)IGFX_ALDERLAKE_N);
47
48 static bool adlnRegisteredMmd =
49 MediaFactory<uint32_t, MmdDevice>::
50 Register<MmdDeviceG12Tgllp>((uint32_t)IGFX_ALDERLAKE_N);
51
52 static bool adlnRegisteredMcpy =
53 MediaFactory<uint32_t, McpyDevice>::
54 Register<McpyDeviceG12Tgllp>((uint32_t)IGFX_ALDERLAKE_N);
55
56 #define PLATFORM_INTEL_ADLN 24
57 #define GENX_TGLLP 12
58
59 static bool adlnRegisteredNv12ToP010 =
60 MediaFactory<uint32_t, Nv12ToP010Device>::
61 Register<Nv12ToP010DeviceG12Tgllp>((uint32_t)IGFX_ALDERLAKE_N);
62
63 static bool adlnRegisteredCodecHal =
64 MediaFactory<uint32_t, CodechalDevice>::
65 Register<CodechalInterfacesG12Tgllp>((uint32_t)IGFX_ALDERLAKE_N);
66
67 static bool adlnRegisteredCMHal =
68 MediaFactory<uint32_t, CMHalDevice>::
69 Register<CMHalInterfacesG12Adln>((uint32_t)IGFX_ALDERLAKE_N);
70
71
72 MOS_STATUS CMHalInterfacesG12Adln::Initialize(CM_HAL_STATE *pCmState)
73 {
74 if (pCmState == nullptr)
75 {
76 MHW_ASSERTMESSAGE("pCmState is nullptr.")
77 return MOS_STATUS_INVALID_PARAMETER;
78 }
79
80 m_cmhalDevice = MOS_New(CMHal, pCmState);
81 if (m_cmhalDevice == nullptr)
82 {
83 MHW_ASSERTMESSAGE("Create CM Hal interfaces failed.")
84 return MOS_STATUS_NO_SPACE;
85 }
86
87 m_cmhalDevice->SetGenPlatformInfo(PLATFORM_INTEL_ADLN, PLATFORM_INTEL_GT1, "TGLLP");
88 uint32_t cisaIDs[] = { GENX_TGLLP };
89 m_cmhalDevice->AddSupportedCisaIDs(cisaIDs, sizeof(cisaIDs)/sizeof(uint32_t));
90 m_cmhalDevice->m_l3Plane = TGL_L3_PLANE;
91 m_cmhalDevice->m_l3ConfigCount = TGL_L3_CONFIG_NUM;
92 return MOS_STATUS_SUCCESS;
93 }
94
95 static bool adlnRegisteredRenderHal =
96 MediaFactory<uint32_t, RenderHalDevice>::
97 Register<RenderHalInterfacesG12Tgllp>((uint32_t)IGFX_ALDERLAKE_N);
98
99 static bool adlnRegisteredDecodeHistogram =
100 MediaFactory<uint32_t, DecodeHistogramDevice>::
101 Register<DecodeHistogramDeviceG12Tgllp>((uint32_t)IGFX_ALDERLAKE_N);
102
103 static bool adlnRegisteredHwInfo =
104 MediaFactory<uint32_t, MediaInterfacesHwInfoDevice>::Register<MediaInterfacesHwInfoDeviceG12Tgllp>((uint32_t)IGFX_ALDERLAKE_N);
105