Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu/gfx10: unlock srbm_mutex after queue programming finish

srbm_mutex is to guarantee atomicity for r/w of gfx indexed registers

Signed-off-by: Xiaojie Yuan <xiaojie.yuan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Xiaojie Yuan and committed by
Alex Deucher
fa2b93e3 f0312f45

+3 -2
+3 -2
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
··· 2825 2825 /* Init gfx ring 0 for pipe 0 */ 2826 2826 mutex_lock(&adev->srbm_mutex); 2827 2827 gfx_v10_0_cp_gfx_switch_pipe(adev, PIPE_ID0); 2828 - mutex_unlock(&adev->srbm_mutex); 2828 + 2829 2829 /* Set ring buffer size */ 2830 2830 ring = &adev->gfx.gfx_ring[0]; 2831 2831 rb_bufsz = order_base_2(ring->ring_size / 8); ··· 2863 2863 WREG32_SOC15(GC, 0, mmCP_RB_ACTIVE, 1); 2864 2864 2865 2865 gfx_v10_0_cp_gfx_set_doorbell(adev, ring); 2866 + mutex_unlock(&adev->srbm_mutex); 2866 2867 2867 2868 /* Init gfx ring 1 for pipe 1 */ 2868 2869 mutex_lock(&adev->srbm_mutex); 2869 2870 gfx_v10_0_cp_gfx_switch_pipe(adev, PIPE_ID1); 2870 - mutex_unlock(&adev->srbm_mutex); 2871 2871 ring = &adev->gfx.gfx_ring[1]; 2872 2872 rb_bufsz = order_base_2(ring->ring_size / 8); 2873 2873 tmp = REG_SET_FIELD(0, CP_RB1_CNTL, RB_BUFSZ, rb_bufsz); ··· 2897 2897 WREG32_SOC15(GC, 0, mmCP_RB1_ACTIVE, 1); 2898 2898 2899 2899 gfx_v10_0_cp_gfx_set_doorbell(adev, ring); 2900 + mutex_unlock(&adev->srbm_mutex); 2900 2901 2901 2902 /* Switch to pipe 0 */ 2902 2903 mutex_lock(&adev->srbm_mutex);