From: Tom St Denis Date: Thu, 31 Aug 2017 13:31:01 +0000 (-0400) Subject: drm/amd/amdgpu: Tidy up gfx_v9_0_enable_gfx_static_mg_power_gating() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=7915c8fd7ec70f65c66c268d8d19f563b5a0162d;p=openwrt%2Fstaging%2Fblogic.git drm/amd/amdgpu: Tidy up gfx_v9_0_enable_gfx_static_mg_power_gating() Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 1a928f6dc801..22346bbe9a4c 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -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); }