drm/amdgpu: fix firmware info version checks
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 27 Jul 2016 19:31:59 +0000 (15:31 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Aug 2016 16:09:22 +0000 (18:09 +0200)
commit a8a04c994d41a489eb0f2899893209e04e030153 upstream.

Some of the checks didn't handle frev 2 tables properly.
amdgpu doesn't support any tables pre-frev 2, so drop
the checks.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c

index 9416e0f5c1db2bf8c5601ddee999b1ade5efabc0..0aaa457a17101348cc4df13481af15eb9b55e8f8 100644 (file)
@@ -566,28 +566,19 @@ int amdgpu_atombios_get_clock_info(struct amdgpu_device *adev)
                    le16_to_cpu(firmware_info->info.usReferenceClock);
                ppll->reference_div = 0;
 
-               if (crev < 2)
-                       ppll->pll_out_min =
-                               le16_to_cpu(firmware_info->info.usMinPixelClockPLL_Output);
-               else
-                       ppll->pll_out_min =
-                               le32_to_cpu(firmware_info->info_12.ulMinPixelClockPLL_Output);
+               ppll->pll_out_min =
+                       le32_to_cpu(firmware_info->info_12.ulMinPixelClockPLL_Output);
                ppll->pll_out_max =
                    le32_to_cpu(firmware_info->info.ulMaxPixelClockPLL_Output);
 
-               if (crev >= 4) {
-                       ppll->lcd_pll_out_min =
-                               le16_to_cpu(firmware_info->info_14.usLcdMinPixelClockPLL_Output) * 100;
-                       if (ppll->lcd_pll_out_min == 0)
-                               ppll->lcd_pll_out_min = ppll->pll_out_min;
-                       ppll->lcd_pll_out_max =
-                               le16_to_cpu(firmware_info->info_14.usLcdMaxPixelClockPLL_Output) * 100;
-                       if (ppll->lcd_pll_out_max == 0)
-                               ppll->lcd_pll_out_max = ppll->pll_out_max;
-               } else {
+               ppll->lcd_pll_out_min =
+                       le16_to_cpu(firmware_info->info_14.usLcdMinPixelClockPLL_Output) * 100;
+               if (ppll->lcd_pll_out_min == 0)
                        ppll->lcd_pll_out_min = ppll->pll_out_min;
+               ppll->lcd_pll_out_max =
+                       le16_to_cpu(firmware_info->info_14.usLcdMaxPixelClockPLL_Output) * 100;
+               if (ppll->lcd_pll_out_max == 0)
                        ppll->lcd_pll_out_max = ppll->pll_out_max;
-               }
 
                if (ppll->pll_out_min == 0)
                        ppll->pll_out_min = 64800;