diff options
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_atombios.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 87ead090c7d5..4d37b2d1ba74 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
@@ -1321,6 +1321,43 @@ bool radeon_atombios_get_ppll_ss_info(struct radeon_device *rdev, | |||
1321 | return false; | 1321 | return false; |
1322 | } | 1322 | } |
1323 | 1323 | ||
1324 | static void radeon_atombios_get_igp_ss_overrides(struct radeon_device *rdev, | ||
1325 | struct radeon_atom_ss *ss, | ||
1326 | int id) | ||
1327 | { | ||
1328 | struct radeon_mode_info *mode_info = &rdev->mode_info; | ||
1329 | int index = GetIndexIntoMasterTable(DATA, IntegratedSystemInfo); | ||
1330 | u16 data_offset, size; | ||
1331 | struct _ATOM_INTEGRATED_SYSTEM_INFO_V6 *igp_info; | ||
1332 | u8 frev, crev; | ||
1333 | u16 percentage = 0, rate = 0; | ||
1334 | |||
1335 | /* get any igp specific overrides */ | ||
1336 | if (atom_parse_data_header(mode_info->atom_context, index, &size, | ||
1337 | &frev, &crev, &data_offset)) { | ||
1338 | igp_info = (struct _ATOM_INTEGRATED_SYSTEM_INFO_V6 *) | ||
1339 | (mode_info->atom_context->bios + data_offset); | ||
1340 | switch (id) { | ||
1341 | case ASIC_INTERNAL_SS_ON_TMDS: | ||
1342 | percentage = le16_to_cpu(igp_info->usDVISSPercentage); | ||
1343 | rate = le16_to_cpu(igp_info->usDVISSpreadRateIn10Hz); | ||
1344 | break; | ||
1345 | case ASIC_INTERNAL_SS_ON_HDMI: | ||
1346 | percentage = le16_to_cpu(igp_info->usHDMISSPercentage); | ||
1347 | rate = le16_to_cpu(igp_info->usHDMISSpreadRateIn10Hz); | ||
1348 | break; | ||
1349 | case ASIC_INTERNAL_SS_ON_LVDS: | ||
1350 | percentage = le16_to_cpu(igp_info->usLvdsSSPercentage); | ||
1351 | rate = le16_to_cpu(igp_info->usLvdsSSpreadRateIn10Hz); | ||
1352 | break; | ||
1353 | } | ||
1354 | if (percentage) | ||
1355 | ss->percentage = percentage; | ||
1356 | if (rate) | ||
1357 | ss->rate = rate; | ||
1358 | } | ||
1359 | } | ||
1360 | |||
1324 | union asic_ss_info { | 1361 | union asic_ss_info { |
1325 | struct _ATOM_ASIC_INTERNAL_SS_INFO info; | 1362 | struct _ATOM_ASIC_INTERNAL_SS_INFO info; |
1326 | struct _ATOM_ASIC_INTERNAL_SS_INFO_V2 info_2; | 1363 | struct _ATOM_ASIC_INTERNAL_SS_INFO_V2 info_2; |
@@ -1385,6 +1422,8 @@ bool radeon_atombios_get_asic_ss_info(struct radeon_device *rdev, | |||
1385 | le16_to_cpu(ss_info->info_3.asSpreadSpectrum[i].usSpreadSpectrumPercentage); | 1422 | le16_to_cpu(ss_info->info_3.asSpreadSpectrum[i].usSpreadSpectrumPercentage); |
1386 | ss->type = ss_info->info_3.asSpreadSpectrum[i].ucSpreadSpectrumMode; | 1423 | ss->type = ss_info->info_3.asSpreadSpectrum[i].ucSpreadSpectrumMode; |
1387 | ss->rate = le16_to_cpu(ss_info->info_3.asSpreadSpectrum[i].usSpreadRateIn10Hz); | 1424 | ss->rate = le16_to_cpu(ss_info->info_3.asSpreadSpectrum[i].usSpreadRateIn10Hz); |
1425 | if (rdev->flags & RADEON_IS_IGP) | ||
1426 | radeon_atombios_get_igp_ss_overrides(rdev, ss, id); | ||
1388 | return true; | 1427 | return true; |
1389 | } | 1428 | } |
1390 | } | 1429 | } |