aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2020-01-23 13:49:45 +0000
committerAlex Deucher <[email protected]>2020-02-05 04:30:39 +0000
commit9f3cc18d19b7b791b8f59bcae51f88e759f73146 (patch)
tree0d85acfa6e627c671c13f4640aae29f85d47fab1 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
parentdrm/amdgpu: simplify and fix amdgpu_sync_resv (diff)
downloadkernel-9f3cc18d19b7b791b8f59bcae51f88e759f73146.tar.gz
kernel-9f3cc18d19b7b791b8f59bcae51f88e759f73146.zip
drm/amdgpu: rework synchronization of VM updates v4
If provided we only sync to the BOs reservation object and no longer to the root PD. v2: update comment, cleanup amdgpu_bo_sync_wait_resv v3: use correct reservation object while clearing v4: fix typo in amdgpu_bo_sync_wait_resv Signed-off-by: Christian König <[email protected]> Tested-by: Tom St Denis <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
index ab6481751763..4cc7881f438c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
@@ -58,9 +58,9 @@ static int amdgpu_vm_sdma_map_table(struct amdgpu_bo *table)
* Negativ errno, 0 for success.
*/
static int amdgpu_vm_sdma_prepare(struct amdgpu_vm_update_params *p,
- void *owner, struct dma_fence *exclusive)
+ struct dma_resv *resv,
+ enum amdgpu_sync_mode sync_mode)
{
- struct amdgpu_bo *root = p->vm->root.base.bo;
unsigned int ndw = AMDGPU_VM_SDMA_MIN_NUM_DW;
int r;
@@ -70,17 +70,10 @@ static int amdgpu_vm_sdma_prepare(struct amdgpu_vm_update_params *p,
p->num_dw_left = ndw;
- /* Wait for moves to be completed */
- r = amdgpu_sync_fence(&p->job->sync, exclusive, false);
- if (r)
- return r;
-
- /* Don't wait for any submissions during page fault handling */
- if (p->direct)
+ if (!resv)
return 0;
- return amdgpu_sync_resv(p->adev, &p->job->sync, root->tbo.base.resv,
- AMDGPU_SYNC_NE_OWNER, owner);
+ return amdgpu_sync_resv(p->adev, &p->job->sync, resv, sync_mode, p->vm);
}
/**