To avoid changing the global lbpw module parameter directly.

Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 7abefb80f93d..138cc6c2caec 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -2499,26 +2499,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;
        }
 
        gfx_v9_0_rlc_start(adev);
-- 
2.13.6

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to