summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
diff options
context:
space:
mode:
authorAlex Deucher2016-02-24 16:06:06 +0100
committerAlex Deucher2016-02-25 23:44:57 +0100
commitaac1e3caac343c05ab550fa611489bd206aa8a7b (patch)
tree5a57da8ff80e4af80c2da6c9c789d09bc71cd2db /drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
parentMerge branch 'drm-rockchip-next-2016-02-18' of https://github.com/markyzq/ker... (diff)
downloadkernel-qcow2-linux-aac1e3caac343c05ab550fa611489bd206aa8a7b.tar.gz
kernel-qcow2-linux-aac1e3caac343c05ab550fa611489bd206aa8a7b.tar.xz
kernel-qcow2-linux-aac1e3caac343c05ab550fa611489bd206aa8a7b.zip
drm/amdgpu/gfx: fix off by one in rb rework (v2)
When I reworked this code, I messed up num rb count. v2: use hweight32 Reviewed-by: Ken Wang <Qingquing.Wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 10c865087d0a..71d536e595a2 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -2613,7 +2613,7 @@ static u32 gfx_v8_0_get_rb_active_bitmap(struct amdgpu_device *adev)
static void gfx_v8_0_setup_rb(struct amdgpu_device *adev)
{
int i, j;
- u32 data, tmp, num_rbs = 0;
+ u32 data;
u32 active_rbs = 0;
mutex_lock(&adev->grbm_idx_mutex);
@@ -2629,10 +2629,7 @@ static void gfx_v8_0_setup_rb(struct amdgpu_device *adev)
mutex_unlock(&adev->grbm_idx_mutex);
adev->gfx.config.backend_enable_mask = active_rbs;
- tmp = active_rbs;
- while (tmp >>= 1)
- num_rbs++;
- adev->gfx.config.num_rbs = num_rbs;
+ adev->gfx.config.num_rbs = hweight32(active_rbs);
}
/**