drm/amdgpu/gfx9: rework lbpw enable code
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 8 Nov 2018 21:34:48 +0000 (16:34 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Nov 2018 21:29:54 +0000 (16:29 -0500)
To avoid changing the global lbpw module parameter directly.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

index d6783ba2c9d04402fd2ea2e94caf9f40cb012c30..c27caa144c576089eb6ea795009bea4b5bf966a7 100644 (file)
@@ -2400,26 +2400,21 @@ static int gfx_v9_0_rlc_resume(struct amdgpu_device *adev)
                        return r;
        }
 
-       if (amdgpu_lbpw == -1) {
-               switch (adev->asic_type) {
-               case CHIP_RAVEN:
-                       amdgpu_lbpw = 1;
-                       break;
-               case CHIP_VEGA20:
-                       amdgpu_lbpw = 0;
-                       break;
-               default:
-                       amdgpu_lbpw = 0;
-                       break;
-               }
-       }
-
-       if (adev->asic_type == CHIP_RAVEN ||
-           adev->asic_type == CHIP_VEGA20) {
-               if (amdgpu_lbpw != 0)
+       switch (adev->asic_type) {
+       case CHIP_RAVEN:
+               if (amdgpu_lbpw == 0)
+                       gfx_v9_0_enable_lbpw(adev, false);
+               else
+                       gfx_v9_0_enable_lbpw(adev, true);
+               break;
+       case CHIP_VEGA20:
+               if (amdgpu_lbpw > 0)
                        gfx_v9_0_enable_lbpw(adev, true);
                else
                        gfx_v9_0_enable_lbpw(adev, false);
+               break;
+       default:
+               break;
        }
 
        adev->gfx.rlc.funcs->start(adev);