mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
drm/amdgpu: fix using the reserved VMID with gang submit
We need to ensure that even when using a reserved VMID that the gang members can still run in parallel. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
b32563859d
commit
a6328c9c3d
@@ -6522,6 +6522,22 @@ void amdgpu_device_pcie_port_wreg(struct amdgpu_device *adev,
|
||||
spin_unlock_irqrestore(&adev->pcie_idx_lock, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_device_get_gang - return a reference to the current gang
|
||||
* @adev: amdgpu_device pointer
|
||||
*
|
||||
* Returns: A new reference to the current gang leader.
|
||||
*/
|
||||
struct dma_fence *amdgpu_device_get_gang(struct amdgpu_device *adev)
|
||||
{
|
||||
struct dma_fence *fence;
|
||||
|
||||
rcu_read_lock();
|
||||
fence = dma_fence_get_rcu_safe(&adev->gang_submit);
|
||||
rcu_read_unlock();
|
||||
return fence;
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_device_switch_gang - switch to a new gang
|
||||
* @adev: amdgpu_device pointer
|
||||
@@ -6538,10 +6554,7 @@ struct dma_fence *amdgpu_device_switch_gang(struct amdgpu_device *adev,
|
||||
|
||||
do {
|
||||
dma_fence_put(old);
|
||||
rcu_read_lock();
|
||||
old = dma_fence_get_rcu_safe(&adev->gang_submit);
|
||||
rcu_read_unlock();
|
||||
|
||||
old = amdgpu_device_get_gang(adev);
|
||||
if (old == gang)
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user