drm/radeon: fix firmware info version checks
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 27 Jul 2016 19:28:56 +0000 (15:28 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 28 Jul 2016 14:07:07 +0000 (10:07 -0400)
Some of the checks didn't handle frev 2 tables properly.

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

index f8097a0e7a79176026a4f17bdd19e3b03483f445..5df3ec73021b522fddae1b8368e68058ae7c93c5 100644 (file)
@@ -1155,7 +1155,7 @@ bool radeon_atom_get_clock_info(struct drm_device *dev)
                    le16_to_cpu(firmware_info->info.usReferenceClock);
                p1pll->reference_div = 0;
 
-               if (crev < 2)
+               if ((frev < 2) && (crev < 2))
                        p1pll->pll_out_min =
                                le16_to_cpu(firmware_info->info.usMinPixelClockPLL_Output);
                else
@@ -1164,7 +1164,7 @@ bool radeon_atom_get_clock_info(struct drm_device *dev)
                p1pll->pll_out_max =
                    le32_to_cpu(firmware_info->info.ulMaxPixelClockPLL_Output);
 
-               if (crev >= 4) {
+               if (((frev < 2) && (crev >= 4)) || (frev >= 2)) {
                        p1pll->lcd_pll_out_min =
                                le16_to_cpu(firmware_info->info_14.usLcdMinPixelClockPLL_Output) * 100;
                        if (p1pll->lcd_pll_out_min == 0)