summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
diff options
context:
space:
mode:
authorTom St Denis <tom.stdenis@amd.com>2016-02-08 17:34:19 (GMT)
committerAlex Deucher <alexander.deucher@amd.com>2016-02-12 20:29:47 (GMT)
commit6d1d6831814418b1348db83c1d90042a3b017efe (patch)
tree00e11807f676489ba458c3910aee392952193712 /drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
parentd3a7207bdbf5daeee962b376b807cab6778d0cbc (diff)
downloadlinux-6d1d6831814418b1348db83c1d90042a3b017efe.tar.xz
drm/amdgpu/gfx7: LOC reduction in gfx_v7_0_setup_rb
Reduce for loop with bitmask to simple complement and mask Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
index 5e858ca..3aaa0f9 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
@@ -1648,7 +1648,7 @@ static void gfx_v7_0_setup_rb(struct amdgpu_device *adev,
u32 max_rb_num_per_se)
{
int i, j;
- u32 data, mask;
+ u32 data;
u32 disabled_rbs = 0;
u32 enabled_rbs = 0;
@@ -1666,12 +1666,7 @@ static void gfx_v7_0_setup_rb(struct amdgpu_device *adev,
gfx_v7_0_select_se_sh(adev, 0xffffffff, 0xffffffff);
mutex_unlock(&adev->grbm_idx_mutex);
- mask = 1;
- for (i = 0; i < max_rb_num_per_se * se_num; i++) {
- if (!(disabled_rbs & mask))
- enabled_rbs |= mask;
- mask <<= 1;
- }
+ enabled_rbs = (~disabled_rbs) & ((1UL<<(max_rb_num_per_se*se_num))-1);
adev->gfx.config.backend_enable_mask = enabled_rbs;