Debian Codegraph @

media_driver/media_interface/media_interfaces_m12_adlp/media_interfaces_g12_adlp.cpp

raw
1 /*
2 * Copyright (c) 2011-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_adlp.cpp
24 //! \brief Helps with Gen12 ADLP factory creation.
25 //!
26
27 #include "media_interfaces_g12_adlp.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 adlpRegisteredVphal =
39 MediaFactory<uint32_t, VphalDevice>::
40 Register<VphalInterfacesG12Tgllp>((uint32_t)IGFX_ALDERLAKE_P);
41
42 static bool adlpRegisteredMhw =
43 MediaFactory<uint32_t, MhwInterfaces>::
44 Register<MhwInterfacesG12Tgllp>((uint32_t)IGFX_ALDERLAKE_P);
45
46 static bool adlsRegisteredMmd =
47 MediaFactory<uint32_t, MmdDevice>::
48 Register<MmdDeviceG12Tgllp>((uint32_t)IGFX_ALDERLAKE_P);
49
50 static bool adlpRegisteredMcpy =
51 MediaFactory<uint32_t, McpyDevice>::
52 Register<McpyDeviceG12Tgllp>((uint32_t)IGFX_ALDERLAKE_P);
53
54 #define PLATFORM_INTEL_ADLP 23
55 #define GENX_TGLLP 12
56
57 static bool adlsRegisteredNv12ToP010 =
58 MediaFactory<uint32_t, Nv12ToP010Device>::
59 Register<Nv12ToP010DeviceG12Tgllp>((uint32_t)IGFX_ALDERLAKE_P);
60
61 static bool adlsRegisteredCodecHal =
62 MediaFactory<uint32_t, CodechalDevice>::
63 Register<CodechalInterfacesG12Tgllp>((uint32_t)IGFX_ALDERLAKE_P);
64
65 static bool adlsRegisteredCMHal =
66 MediaFactory<uint32_t, CMHalDevice>::
67 Register<CMHalInterfacesG12Adlp>((uint32_t)IGFX_ALDERLAKE_P);
68
69
70 MOS_STATUS CMHalInterfacesG12Adlp::Initialize(CM_HAL_STATE *pCmState)
71 {
72 if (pCmState == nullptr)
73 {
74 MHW_ASSERTMESSAGE("pCmState is nullptr.")
75 return MOS_STATUS_INVALID_PARAMETER;
76 }
77
78 m_cmhalDevice = MOS_New(CMHal, pCmState);
79 if (m_cmhalDevice == nullptr)
80 {
81 MHW_ASSERTMESSAGE("Create CM Hal interfaces failed.")
82 return MOS_STATUS_NO_SPACE;
83 }
84
85 m_cmhalDevice->SetGenPlatformInfo(PLATFORM_INTEL_ADLP, PLATFORM_INTEL_GT2, "TGLLP");
86 uint32_t cisaIDs[] = { GENX_TGLLP };
87 m_cmhalDevice->AddSupportedCisaIDs(cisaIDs, sizeof(cisaIDs)/sizeof(uint32_t));
88 m_cmhalDevice->m_l3Plane = TGL_L3_PLANE;
89 m_cmhalDevice->m_l3ConfigCount = TGL_L3_CONFIG_NUM;
90 return MOS_STATUS_SUCCESS;
91 }
92
93 static bool adlpRegisteredRenderHal =
94 MediaFactory<uint32_t, RenderHalDevice>::
95 Register<RenderHalInterfacesG12Tgllp>((uint32_t)IGFX_ALDERLAKE_P);
96
97 static bool adlpRegisteredDecodeHistogram =
98 MediaFactory<uint32_t, DecodeHistogramDevice>::
99 Register<DecodeHistogramDeviceG12Tgllp>((uint32_t)IGFX_ALDERLAKE_P);
100
101 static bool adlpRegisteredHwInfo =
102 MediaFactory<uint32_t, MediaInterfacesHwInfoDevice>::Register<MediaInterfacesHwInfoDeviceG12Tgllp>((uint32_t)IGFX_ALDERLAKE_P);