diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2017-03-24 14:47:18 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-03-29 23:55:44 -0400 |
commit | 2572c24ca9f4a427b876f3e7718097e9c4b9ddc7 (patch) | |
tree | 052bc8b918e78dd9b44f9326efa889f2fb2a8520 | |
parent | f2713e8c2a34711ed820a3095a7c5f4a0c85df1c (diff) |
drm/amdgpu/gfx9: use hweight for calculating num_rbs
Match what we do for other asics.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 7666add21519..6139dd079c70 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | |||
@@ -1231,7 +1231,7 @@ static u32 gfx_v9_0_get_rb_active_bitmap(struct amdgpu_device *adev) | |||
1231 | static void gfx_v9_0_setup_rb(struct amdgpu_device *adev) | 1231 | static void gfx_v9_0_setup_rb(struct amdgpu_device *adev) |
1232 | { | 1232 | { |
1233 | int i, j; | 1233 | int i, j; |
1234 | u32 data, tmp, num_rbs = 0; | 1234 | u32 data; |
1235 | u32 active_rbs = 0; | 1235 | u32 active_rbs = 0; |
1236 | u32 rb_bitmap_width_per_sh = adev->gfx.config.max_backends_per_se / | 1236 | u32 rb_bitmap_width_per_sh = adev->gfx.config.max_backends_per_se / |
1237 | adev->gfx.config.max_sh_per_se; | 1237 | adev->gfx.config.max_sh_per_se; |
@@ -1249,10 +1249,7 @@ static void gfx_v9_0_setup_rb(struct amdgpu_device *adev) | |||
1249 | mutex_unlock(&adev->grbm_idx_mutex); | 1249 | mutex_unlock(&adev->grbm_idx_mutex); |
1250 | 1250 | ||
1251 | adev->gfx.config.backend_enable_mask = active_rbs; | 1251 | adev->gfx.config.backend_enable_mask = active_rbs; |
1252 | tmp = active_rbs; | 1252 | adev->gfx.config.num_rbs = hweight32(active_rbs); |
1253 | while (tmp >>= 1) | ||
1254 | num_rbs++; | ||
1255 | adev->gfx.config.num_rbs = num_rbs; | ||
1256 | } | 1253 | } |
1257 | 1254 | ||
1258 | #define DEFAULT_SH_MEM_BASES (0x6000) | 1255 | #define DEFAULT_SH_MEM_BASES (0x6000) |