Commit 2572c24c authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu/gfx9: use hweight for calculating num_rbs

Match what we do for other asics.
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f2713e8c
...@@ -1231,7 +1231,7 @@ static u32 gfx_v9_0_get_rb_active_bitmap(struct amdgpu_device *adev) ...@@ -1231,7 +1231,7 @@ static u32 gfx_v9_0_get_rb_active_bitmap(struct amdgpu_device *adev)
static void gfx_v9_0_setup_rb(struct amdgpu_device *adev) static void gfx_v9_0_setup_rb(struct amdgpu_device *adev)
{ {
int i, j; int i, j;
u32 data, tmp, num_rbs = 0; u32 data;
u32 active_rbs = 0; u32 active_rbs = 0;
u32 rb_bitmap_width_per_sh = adev->gfx.config.max_backends_per_se / u32 rb_bitmap_width_per_sh = adev->gfx.config.max_backends_per_se /
adev->gfx.config.max_sh_per_se; adev->gfx.config.max_sh_per_se;
...@@ -1249,10 +1249,7 @@ static void gfx_v9_0_setup_rb(struct amdgpu_device *adev) ...@@ -1249,10 +1249,7 @@ static void gfx_v9_0_setup_rb(struct amdgpu_device *adev)
mutex_unlock(&adev->grbm_idx_mutex); mutex_unlock(&adev->grbm_idx_mutex);
adev->gfx.config.backend_enable_mask = active_rbs; adev->gfx.config.backend_enable_mask = active_rbs;
tmp = active_rbs; adev->gfx.config.num_rbs = hweight32(active_rbs);
while (tmp >>= 1)
num_rbs++;
adev->gfx.config.num_rbs = num_rbs;
} }
#define DEFAULT_SH_MEM_BASES (0x6000) #define DEFAULT_SH_MEM_BASES (0x6000)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment