| 1 |
/* |
| 2 |
* Copyright (c) 2017, 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_sysinfo_g8.cpp |
| 24 |
//! |
| 25 |
|
| 26 |
#include "igfxfmid.h" |
| 27 |
#include "linux_system_info.h" |
| 28 |
#include "skuwa_factory.h" |
| 29 |
#include "linux_skuwa_debug.h" |
| 30 |
#include "linux_media_skuwa.h" |
| 31 |
#include "linux_shadow_skuwa.h" |
| 32 |
|
| 33 |
#define GEN8_THREADS_PER_EU 7 |
| 34 |
|
| 35 |
static bool InitBdwMediaSysInfo(struct GfxDeviceInfo *devInfo, MEDIA_GT_SYSTEM_INFO *sysInfo) |
| 36 |
{ |
| 37 |
if ((devInfo == nullptr) || (sysInfo == nullptr)) |
| 38 |
{ |
| 39 |
DEVINFO_ERROR("null ptr is passed\n"); |
| 40 |
return false; |
| 41 |
} |
| 42 |
|
| 43 |
if (!sysInfo->SliceCount) |
| 44 |
{ |
| 45 |
sysInfo->SliceCount = devInfo->SliceCount; |
| 46 |
} |
| 47 |
|
| 48 |
if (!sysInfo->SubSliceCount) |
| 49 |
{ |
| 50 |
sysInfo->SubSliceCount = devInfo->SubSliceCount; |
| 51 |
} |
| 52 |
|
| 53 |
if (!sysInfo->EUCount) |
| 54 |
{ |
| 55 |
sysInfo->EUCount = devInfo->EUCount; |
| 56 |
} |
| 57 |
|
| 58 |
sysInfo->L3CacheSizeInKb = devInfo->L3CacheSizeInKb; |
| 59 |
sysInfo->L3BankCount = devInfo->L3BankCount; |
| 60 |
sysInfo->VDBoxInfo.Instances.Bits.VDBox0Enabled = 1; |
| 61 |
sysInfo->VEBoxInfo.Instances.Bits.VEBox0Enabled = 1; |
| 62 |
sysInfo->MaxEuPerSubSlice = devInfo->MaxEuPerSubSlice; |
| 63 |
sysInfo->MaxSlicesSupported = sysInfo->SliceCount; |
| 64 |
sysInfo->MaxSubSlicesSupported = sysInfo->SubSliceCount; |
| 65 |
|
| 66 |
sysInfo->VEBoxInfo.NumberOfVEBoxEnabled = 1; |
| 67 |
sysInfo->VDBoxInfo.NumberOfVDBoxEnabled = 1; |
| 68 |
if (devInfo->eGTType == GTTYPE_GT3) |
| 69 |
{ |
| 70 |
sysInfo->VDBoxInfo.Instances.Bits.VDBox1Enabled = 1; |
| 71 |
sysInfo->VEBoxInfo.Instances.Bits.VEBox1Enabled = 1; |
| 72 |
sysInfo->VEBoxInfo.NumberOfVEBoxEnabled++; |
| 73 |
sysInfo->VDBoxInfo.NumberOfVDBoxEnabled++; |
| 74 |
} |
| 75 |
|
| 76 |
sysInfo->ThreadCount = sysInfo->EUCount * GEN8_THREADS_PER_EU; |
| 77 |
|
| 78 |
sysInfo->VEBoxInfo.IsValid = true; |
| 79 |
sysInfo->VDBoxInfo.IsValid = true; |
| 80 |
|
| 81 |
/* the GMM doesn't care the real size of ERAM/LLC. Instead it is used to |
| 82 |
* indicate whether the LLC/ERAM exists |
| 83 |
*/ |
| 84 |
if (devInfo->hasERAM) |
| 85 |
{ |
| 86 |
// 64M |
| 87 |
sysInfo->EdramSizeInKb = 64 * 1024; |
| 88 |
} |
| 89 |
if (devInfo->hasLLC) |
| 90 |
{ |
| 91 |
// 2M |
| 92 |
sysInfo->LLCCacheSizeInKb = 2 * 1024; |
| 93 |
} |
| 94 |
|
| 95 |
return true; |
| 96 |
} |
| 97 |
|
| 98 |
static bool InitBdwShadowSku(struct GfxDeviceInfo *devInfo, |
| 99 |
SHADOW_MEDIA_FEATURE_TABLE *skuTable, |
| 100 |
struct LinuxDriverInfo *drvInfo) |
| 101 |
{ |
| 102 |
if ((devInfo == nullptr) || (skuTable == nullptr) || (drvInfo == nullptr)) |
| 103 |
{ |
| 104 |
DEVINFO_ERROR("null ptr is passed\n"); |
| 105 |
return false; |
| 106 |
} |
| 107 |
|
| 108 |
skuTable->FtrVERing = 0; |
| 109 |
if (drvInfo->hasVebox) |
| 110 |
{ |
| 111 |
skuTable->FtrVERing = 1; |
| 112 |
} |
| 113 |
|
| 114 |
skuTable->FtrVcs2 = 0; |
| 115 |
if ((devInfo->eGTType == GTTYPE_GT3) && |
| 116 |
drvInfo->hasBsd2) |
| 117 |
{ |
| 118 |
skuTable->FtrVcs2 = 1; |
| 119 |
} |
| 120 |
|
| 121 |
skuTable->FtrULT = 0; |
| 122 |
|
| 123 |
skuTable->FtrPPGTT = 1; |
| 124 |
skuTable->FtrIA32eGfxPTEs = 1; |
| 125 |
|
| 126 |
skuTable->FtrEDram = devInfo->hasERAM; |
| 127 |
|
| 128 |
skuTable->FtrTileY = 1; |
| 129 |
|
| 130 |
return true; |
| 131 |
} |
| 132 |
|
| 133 |
static bool InitBdwShadowWa(struct GfxDeviceInfo *devInfo, |
| 134 |
SHADOW_MEDIA_WA_TABLE *waTable, |
| 135 |
struct LinuxDriverInfo *drvInfo) |
| 136 |
{ |
| 137 |
if ((devInfo == nullptr) || (waTable == nullptr) || (drvInfo == nullptr)) |
| 138 |
{ |
| 139 |
DEVINFO_ERROR("null ptr is passed\n"); |
| 140 |
return false; |
| 141 |
} |
| 142 |
|
| 143 |
/* by default PPGTT is enabled */ |
| 144 |
waTable->WaForceGlobalGTT = 0; |
| 145 |
if (drvInfo->hasPpgtt == 0) |
| 146 |
{ |
| 147 |
waTable->WaForceGlobalGTT = 1; |
| 148 |
} |
| 149 |
|
| 150 |
waTable->WaUseVAlign16OnTileXYBpp816 = 1; |
| 151 |
waTable->WaDisregardPlatformChecks = 1; |
| 152 |
|
| 153 |
return true; |
| 154 |
} |
| 155 |
|
| 156 |
static struct GfxDeviceInfo bdwGt1Info = { |
| 157 |
.platformType = PLATFORM_MOBILE, |
| 158 |
.productFamily = IGFX_BROADWELL, |
| 159 |
.displayFamily = IGFX_GEN8_CORE, |
| 160 |
.renderFamily = IGFX_GEN8_CORE, |
| 161 |
.mediaFamily = IGFX_UNKNOWN_CORE, |
| 162 |
.eGTType = GTTYPE_GT1, |
| 163 |
.L3CacheSizeInKb = 384, |
| 164 |
.L3BankCount = 2, |
| 165 |
.EUCount = 12, |
| 166 |
.SliceCount = 1, |
| 167 |
.SubSliceCount = 2, |
| 168 |
.MaxEuPerSubSlice = 6, |
| 169 |
.isLCIA = 0, |
| 170 |
.hasLLC = 1, |
| 171 |
.hasERAM = 0, |
| 172 |
.InitMediaSysInfo = InitBdwMediaSysInfo, |
| 173 |
.InitShadowSku = InitBdwShadowSku, |
| 174 |
.InitShadowWa = InitBdwShadowWa, |
| 175 |
}; |
| 176 |
|
| 177 |
static struct GfxDeviceInfo bdwGt2Info = { |
| 178 |
.platformType = PLATFORM_MOBILE, |
| 179 |
.productFamily = IGFX_BROADWELL, |
| 180 |
.displayFamily = IGFX_GEN8_CORE, |
| 181 |
.renderFamily = IGFX_GEN8_CORE, |
| 182 |
.mediaFamily = IGFX_UNKNOWN_CORE, |
| 183 |
.eGTType = GTTYPE_GT2, |
| 184 |
.L3CacheSizeInKb = 768, |
| 185 |
.L3BankCount = 4, |
| 186 |
.EUCount = 23, |
| 187 |
.SliceCount = 1, |
| 188 |
.SubSliceCount = 3, |
| 189 |
.MaxEuPerSubSlice = 8, |
| 190 |
.isLCIA = 0, |
| 191 |
.hasLLC = 1, |
| 192 |
.hasERAM = 0, |
| 193 |
.InitMediaSysInfo = InitBdwMediaSysInfo, |
| 194 |
.InitShadowSku = InitBdwShadowSku, |
| 195 |
.InitShadowWa = InitBdwShadowWa, |
| 196 |
}; |
| 197 |
|
| 198 |
static struct GfxDeviceInfo bdwGt3Info = { |
| 199 |
.platformType = PLATFORM_MOBILE, |
| 200 |
.productFamily = IGFX_BROADWELL, |
| 201 |
.displayFamily = IGFX_GEN8_CORE, |
| 202 |
.renderFamily = IGFX_GEN8_CORE, |
| 203 |
.mediaFamily = IGFX_UNKNOWN_CORE, |
| 204 |
.eGTType = GTTYPE_GT3, |
| 205 |
.L3CacheSizeInKb = 1536, |
| 206 |
.L3BankCount = 8, |
| 207 |
.EUCount = 48, |
| 208 |
.SliceCount = 2, |
| 209 |
.SubSliceCount = 6, |
| 210 |
.MaxEuPerSubSlice = 8, |
| 211 |
.isLCIA = 0, |
| 212 |
.hasLLC = 1, |
| 213 |
.hasERAM = 0, |
| 214 |
.InitMediaSysInfo = InitBdwMediaSysInfo, |
| 215 |
.InitShadowSku = InitBdwShadowSku, |
| 216 |
.InitShadowWa = InitBdwShadowWa, |
| 217 |
}; |
| 218 |
|
| 219 |
static struct GfxDeviceInfo bdwGt3eInfo = { |
| 220 |
.platformType = PLATFORM_MOBILE, |
| 221 |
.productFamily = IGFX_BROADWELL, |
| 222 |
.displayFamily = IGFX_GEN8_CORE, |
| 223 |
.renderFamily = IGFX_GEN8_CORE, |
| 224 |
.mediaFamily = IGFX_UNKNOWN_CORE, |
| 225 |
.eGTType = GTTYPE_GT3, |
| 226 |
.L3CacheSizeInKb = 1536, |
| 227 |
.L3BankCount = 8, |
| 228 |
.EUCount = 48, |
| 229 |
.SliceCount = 2, |
| 230 |
.SubSliceCount = 6, |
| 231 |
.MaxEuPerSubSlice = 8, |
| 232 |
.isLCIA = 0, |
| 233 |
.hasLLC = 1, |
| 234 |
.hasERAM = 1, |
| 235 |
.InitMediaSysInfo = InitBdwMediaSysInfo, |
| 236 |
.InitShadowSku = InitBdwShadowSku, |
| 237 |
.InitShadowWa = InitBdwShadowWa, |
| 238 |
}; |
| 239 |
|
| 240 |
//extern template class DeviceInfoFactory<GfxDeviceInfo>; |
| 241 |
typedef DeviceInfoFactory<GfxDeviceInfo> base_fact; |
| 242 |
|
| 243 |
static bool bdwDevice1602 = DeviceInfoFactory<GfxDeviceInfo>:: |
| 244 |
RegisterDevice(0x1602, &bdwGt1Info); |
| 245 |
|
| 246 |
static bool bdwDevice1606 = DeviceInfoFactory<GfxDeviceInfo>:: |
| 247 |
RegisterDevice(0x1606, &bdwGt1Info); |
| 248 |
|
| 249 |
static bool bdwDevice160a = DeviceInfoFactory<GfxDeviceInfo>:: |
| 250 |
RegisterDevice(0x160a, &bdwGt1Info); |
| 251 |
|
| 252 |
static bool bdwDevice160d = DeviceInfoFactory<GfxDeviceInfo>:: |
| 253 |
RegisterDevice(0x160d, &bdwGt1Info); |
| 254 |
|
| 255 |
static bool bdwDevice160e = DeviceInfoFactory<GfxDeviceInfo>:: |
| 256 |
RegisterDevice(0x160e, &bdwGt1Info); |
| 257 |
|
| 258 |
static bool bdwDevice160b = DeviceInfoFactory<GfxDeviceInfo>:: |
| 259 |
RegisterDevice(0x160b, &bdwGt1Info); |
| 260 |
|
| 261 |
static bool bdwDevice1612 = DeviceInfoFactory<GfxDeviceInfo>:: |
| 262 |
RegisterDevice(0x1612, &bdwGt2Info); |
| 263 |
|
| 264 |
static bool bdwDevice1616 = DeviceInfoFactory<GfxDeviceInfo>:: |
| 265 |
RegisterDevice(0x1616, &bdwGt2Info); |
| 266 |
|
| 267 |
static bool bdwDevice161a = DeviceInfoFactory<GfxDeviceInfo>:: |
| 268 |
RegisterDevice(0x161a, &bdwGt2Info); |
| 269 |
|
| 270 |
static bool bdwDevice161d = DeviceInfoFactory<GfxDeviceInfo>:: |
| 271 |
RegisterDevice(0x161d, &bdwGt2Info); |
| 272 |
|
| 273 |
static bool bdwDevice161e = DeviceInfoFactory<GfxDeviceInfo>:: |
| 274 |
RegisterDevice(0x161e, &bdwGt2Info); |
| 275 |
|
| 276 |
static bool bdwDevice161b = DeviceInfoFactory<GfxDeviceInfo>:: |
| 277 |
RegisterDevice(0x161b, &bdwGt2Info); |
| 278 |
|
| 279 |
static bool bdwDevice1622 = DeviceInfoFactory<GfxDeviceInfo>:: |
| 280 |
RegisterDevice(0x1622, &bdwGt3eInfo); |
| 281 |
|
| 282 |
static bool bdwDevice1626 = DeviceInfoFactory<GfxDeviceInfo>:: |
| 283 |
RegisterDevice(0x1626, &bdwGt3Info); |
| 284 |
|
| 285 |
static bool bdwDevice162b = DeviceInfoFactory<GfxDeviceInfo>:: |
| 286 |
RegisterDevice(0x162b, &bdwGt3Info); |
| 287 |
|
| 288 |
static bool bdwDevice162a = DeviceInfoFactory<GfxDeviceInfo>:: |
| 289 |
RegisterDevice(0x162a, &bdwGt3eInfo); |
| 290 |
|
| 291 |
static bool bdwDevice162d = DeviceInfoFactory<GfxDeviceInfo>:: |
| 292 |
RegisterDevice(0x162d, &bdwGt3Info); |
| 293 |
|
| 294 |
static bool bdwDevice162e = DeviceInfoFactory<GfxDeviceInfo>:: |
| 295 |
RegisterDevice(0x162e, &bdwGt3Info); |
| 296 |
|
| 297 |
/* Whether GT4 is needed? */ |
| 298 |
static bool bdwDevice163b = DeviceInfoFactory<GfxDeviceInfo>:: |
| 299 |
RegisterDevice(0x163b, &bdwGt3eInfo); |