mirror of
https://github.com/torvalds/linux.git
synced 2026-04-29 20:12:38 -04:00
drm/amdgpu: Move kiq ring lock out of virt structure
The usage of kiq should not depend on the virtualization. Signed-off-by: Shaoyun Liu <Shaoyun.Liu@amd.com> Reviewed-by:Andres Rodriquez <andresx7@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
b98b8dbc39
commit
cdf6adb28f
@@ -108,7 +108,6 @@ void amdgpu_virt_init_setting(struct amdgpu_device *adev)
|
||||
adev->cg_flags = 0;
|
||||
adev->pg_flags = 0;
|
||||
|
||||
mutex_init(&adev->virt.lock_kiq);
|
||||
mutex_init(&adev->virt.lock_reset);
|
||||
}
|
||||
|
||||
@@ -122,12 +121,12 @@ uint32_t amdgpu_virt_kiq_rreg(struct amdgpu_device *adev, uint32_t reg)
|
||||
|
||||
BUG_ON(!ring->funcs->emit_rreg);
|
||||
|
||||
mutex_lock(&adev->virt.lock_kiq);
|
||||
mutex_lock(&kiq->ring_mutex);
|
||||
amdgpu_ring_alloc(ring, 32);
|
||||
amdgpu_ring_emit_rreg(ring, reg);
|
||||
amdgpu_fence_emit(ring, &f);
|
||||
amdgpu_ring_commit(ring);
|
||||
mutex_unlock(&adev->virt.lock_kiq);
|
||||
mutex_unlock(&kiq->ring_mutex);
|
||||
|
||||
r = dma_fence_wait(f, false);
|
||||
if (r)
|
||||
@@ -148,12 +147,12 @@ void amdgpu_virt_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v)
|
||||
|
||||
BUG_ON(!ring->funcs->emit_wreg);
|
||||
|
||||
mutex_lock(&adev->virt.lock_kiq);
|
||||
mutex_lock(&kiq->ring_mutex);
|
||||
amdgpu_ring_alloc(ring, 32);
|
||||
amdgpu_ring_emit_wreg(ring, reg, v);
|
||||
amdgpu_fence_emit(ring, &f);
|
||||
amdgpu_ring_commit(ring);
|
||||
mutex_unlock(&adev->virt.lock_kiq);
|
||||
mutex_unlock(&kiq->ring_mutex);
|
||||
|
||||
r = dma_fence_wait(f, false);
|
||||
if (r)
|
||||
|
||||
Reference in New Issue
Block a user