forked from intel/media-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmedia_sysinfo_bmg.cpp
205 lines (163 loc) · 6.23 KB
/
media_sysinfo_bmg.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
/*===================== begin_copyright_notice ==================================
Copyright (c) 2024, 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_sysinfo_bmg.cpp
//!
#include "igfxfmid.h"
#include "linux_system_info.h"
#include "skuwa_factory.h"
#include "linux_skuwa_debug.h"
#include "linux_media_skuwa.h"
#include "linux_shadow_skuwa.h"
#include "media_user_setting_specific.h"
//extern template class DeviceInfoFactory<GfxDeviceInfo>;
typedef DeviceInfoFactory<GfxDeviceInfo> base_fact;
#define THREADS_NUMBER_PER_EU 7
static bool InitBmgMediaSysInfo(struct GfxDeviceInfo *devInfo, MEDIA_GT_SYSTEM_INFO *sysInfo)
{
if ((devInfo == nullptr) || (sysInfo == nullptr))
{
DEVINFO_ERROR("null ptr is passed\n");
return false;
}
if (!sysInfo->SliceCount)
{
sysInfo->SliceCount = devInfo->SliceCount;
}
if (!sysInfo->SubSliceCount)
{
sysInfo->SubSliceCount = devInfo->SubSliceCount;
}
if (!sysInfo->EUCount)
{
sysInfo->EUCount = devInfo->EUCount;
}
sysInfo->L3BankCount = devInfo->L3BankCount;
sysInfo->VEBoxInfo.Instances.Bits.VEBox0Enabled = 1;
sysInfo->MaxEuPerSubSlice = devInfo->MaxEuPerSubSlice;
sysInfo->MaxSlicesSupported = sysInfo->SliceCount;
sysInfo->MaxSubSlicesSupported = sysInfo->SubSliceCount;
sysInfo->VEBoxInfo.NumberOfVEBoxEnabled = 0; /*Query the VEBox engine info from KMD*/
sysInfo->VDBoxInfo.NumberOfVDBoxEnabled = 0; /*Query the VDBox engine info from KMD*/
sysInfo->ThreadCount = sysInfo->EUCount * THREADS_NUMBER_PER_EU;
sysInfo->VEBoxInfo.IsValid = true;
sysInfo->VDBoxInfo.IsValid = true;
//Media driver does not set the other gtsysinfo fileds such as L3CacheSizeInKb, EdramSizeInKb and LLCCacheSizeInKb now.
//If needed in the future, query them from KMD.
return true;
}
static bool InitBmgShadowSku(struct GfxDeviceInfo *devInfo,
SHADOW_MEDIA_FEATURE_TABLE *skuTable,
struct LinuxDriverInfo *drvInfo)
{
if ((devInfo == nullptr) || (skuTable == nullptr) || (drvInfo == nullptr))
{
DEVINFO_ERROR("null ptr is passed\n");
return false;
}
skuTable->FtrVERing = 0;
if (drvInfo->hasVebox)
{
skuTable->FtrVERing = 1;
}
skuTable->FtrVcs2 = 0;
skuTable->FtrULT = 0;
skuTable->FtrPPGTT = 1;
skuTable->FtrIA32eGfxPTEs = 1;
skuTable->FtrDisplayYTiling = 1;
skuTable->FtrEDram = devInfo->hasERAM;
bool disableMMC = false;
skuTable->FtrE2ECompression = 1;
skuTable->FtrXe2Compression = 1;
// Disable MMC for all components if set reg key
MOS_USER_FEATURE_VALUE_DATA userFeatureData;
MOS_ZeroMemory(&userFeatureData, sizeof(userFeatureData));
MOS_UserFeature_ReadValue_ID(
nullptr,
__MEDIA_USER_FEATURE_VALUE_DISABLE_MMC_ID,
&userFeatureData,
(MOS_CONTEXT_HANDLE)nullptr);
if (userFeatureData.bData)
{
disableMMC = true;
}
if (disableMMC)
{
skuTable->FtrE2ECompression = 0;
skuTable->FtrXe2Compression = 0;
}
skuTable->FtrLinearCCS = 1;
skuTable->FtrTileY = 0;
skuTable->FtrLocalMemory = 1;
skuTable->FtrFlatPhysCCS = 1;
return true;
}
static bool InitBmgShadowWa(struct GfxDeviceInfo *devInfo,
SHADOW_MEDIA_WA_TABLE *waTable,
struct LinuxDriverInfo *drvInfo)
{
if ((devInfo == nullptr) || (waTable == nullptr) || (drvInfo == nullptr))
{
DEVINFO_ERROR("null ptr is passed\n");
return false;
}
/* by default PPGTT is enabled */
waTable->WaForceGlobalGTT = 0;
if (drvInfo->hasPpgtt == 0)
{
waTable->WaForceGlobalGTT = 1;
}
waTable->WaDisregardPlatformChecks = 1;
waTable->Wa4kAlignUVOffsetNV12LinearSurface = 1;
//source and recon surfaces need to be aligned to the LCU size
waTable->WaAlignYUVResourceToLCU = 1;
return true;
}
static struct GfxDeviceInfo bmgInfo = {
.platformType = PLATFORM_MOBILE,
.productFamily = IGFX_BMG,
.displayFamily = IGFX_UNKNOWN_CORE,
.renderFamily = IGFX_XE2_HPG_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 = InitBmgMediaSysInfo,
.InitShadowSku = InitBmgShadowSku,
.InitShadowWa = InitBmgShadowWa,
};
static bool bmgDevicee202 = DeviceInfoFactory<GfxDeviceInfo>::
RegisterDevice(0xe202, &bmgInfo);
static bool bmgDevicee20B = DeviceInfoFactory<GfxDeviceInfo>::
RegisterDevice(0xe20B, &bmgInfo);
static bool bmgDevicee20C = DeviceInfoFactory<GfxDeviceInfo>::
RegisterDevice(0xe20C, &bmgInfo);
static bool bmgDevicee20D = DeviceInfoFactory<GfxDeviceInfo>::
RegisterDevice(0xe20D, &bmgInfo);
static bool bmgDevicee212 = DeviceInfoFactory<GfxDeviceInfo>::
RegisterDevice(0xe212, &bmgInfo);
static bool bmgDevicee216 = DeviceInfoFactory<GfxDeviceInfo>::
RegisterDevice(0xe216, &bmgInfo);