Debian Codegraph @

media_driver/media_interface/media_interfaces_m12_adls/media_interfaces_g12_adls.cpp

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