drm/amd/amdgpu: Tidy up gfx_v9_0_enable_gfx_static_mg_power_gating()
authorTom St Denis <tom.stdenis@amd.com>
Thu, 31 Aug 2017 13:31:01 +0000 (09:31 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 31 Aug 2017 19:01:03 +0000 (15:01 -0400)
Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

index 1a928f6dc8011a26a5eaebd8f4b0350a1f060d39..22346bbe9a4c543802d08c73b91ad59d0e314422 100644 (file)
@@ -1913,10 +1913,9 @@ static void gfx_v9_0_enable_gfx_static_mg_power_gating(struct amdgpu_device *ade
        uint32_t data, default_data;
 
        default_data = data = RREG32(SOC15_REG_OFFSET(GC, 0, mmRLC_PG_CNTL));
-       if (enable == true)
-               data |= RLC_PG_CNTL__STATIC_PER_CU_PG_ENABLE_MASK;
-       else
-               data &= ~RLC_PG_CNTL__STATIC_PER_CU_PG_ENABLE_MASK;
+       data = REG_SET_FIELD(data, RLC_PG_CNTL,
+                            STATIC_PER_CU_PG_ENABLE,
+                            enable ? 1 : 0);
        if(default_data != data)
                WREG32(SOC15_REG_OFFSET(GC, 0, mmRLC_PG_CNTL), data);
 }