drm/radeon: check firmware overrides for mclk/sclk ss
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 19 Aug 2013 23:06:19 +0000 (19:06 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 30 Aug 2013 20:31:02 +0000 (16:31 -0400)
Check the overrides in the firmware info table before
enabling spread spectrum on the engine or memory clocks.

Some boards may have valid spread spectrum tables, but
shouldn't necessarily have it enabled.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_atombios.c

index 7ba439e9f30f94ce77cda5936caf7769fa82fc32..4ac5f4027620c69c638b316822d5ab481b2f8810 100644 (file)
@@ -1480,6 +1480,15 @@ bool radeon_atombios_get_asic_ss_info(struct radeon_device *rdev,
        uint8_t frev, crev;
        int i, num_indices;
 
+       if (id == ASIC_INTERNAL_MEMORY_SS) {
+               if (!(rdev->mode_info.firmware_flags & ATOM_BIOS_INFO_MEMORY_CLOCK_SS_SUPPORT))
+                       return false;
+       }
+       if (id == ASIC_INTERNAL_ENGINE_SS) {
+               if (!(rdev->mode_info.firmware_flags & ATOM_BIOS_INFO_ENGINE_CLOCK_SS_SUPPORT))
+                       return false;
+       }
+
        memset(ss, 0, sizeof(struct radeon_atom_ss));
        if (atom_parse_data_header(mode_info->atom_context, index, &size,
                                   &frev, &crev, &data_offset)) {