aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorTom St Denis <tom.stdenis@amd.com>2016-09-07 08:03:28 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-09-14 09:43:41 -0400
commitf166d9f297684faa153dabc2b8887f61bbe7858c (patch)
tree51fd18782131307966af3de8330b781e2b49e9d8 /drivers/gpu/drm/amd
parent075719c3cb79f309fc775a7f8f49d91a0351ceb3 (diff)
drm/amd/amdgpu: Remove double lock from gfx v6
The function gfx_v6_0_get_cu_info() was taking the grbm_idx_mutex which was then taken by a dependent function gfx_v6_0_get_cu_active_bitmap(). This patch removes the select from the parent function to avoid the double lock. Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
index a6b76170b9c5..a1484b8f7eb2 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
@@ -3193,13 +3193,11 @@ static void gfx_v6_0_get_cu_info(struct amdgpu_device *adev)
3193 3193
3194 memset(cu_info, 0, sizeof(*cu_info)); 3194 memset(cu_info, 0, sizeof(*cu_info));
3195 3195
3196 mutex_lock(&adev->grbm_idx_mutex);
3197 for (i = 0; i < adev->gfx.config.max_shader_engines; i++) { 3196 for (i = 0; i < adev->gfx.config.max_shader_engines; i++) {
3198 for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) { 3197 for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) {
3199 mask = 1; 3198 mask = 1;
3200 ao_bitmap = 0; 3199 ao_bitmap = 0;
3201 counter = 0; 3200 counter = 0;
3202 gfx_v6_0_select_se_sh(adev, i, j, 0xffffffff);
3203 bitmap = gfx_v6_0_get_cu_active_bitmap(adev, i, j); 3201 bitmap = gfx_v6_0_get_cu_active_bitmap(adev, i, j);
3204 cu_info->bitmap[i][j] = bitmap; 3202 cu_info->bitmap[i][j] = bitmap;
3205 3203
@@ -3215,8 +3213,6 @@ static void gfx_v6_0_get_cu_info(struct amdgpu_device *adev)
3215 ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8)); 3213 ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8));
3216 } 3214 }
3217 } 3215 }
3218 gfx_v6_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
3219 mutex_unlock(&adev->grbm_idx_mutex);
3220 3216
3221 cu_info->number = active_cu_number; 3217 cu_info->number = active_cu_number;
3222 cu_info->ao_cu_mask = ao_cu_mask; 3218 cu_info->ao_cu_mask = ao_cu_mask;