diff options
| author | Christian König <[email protected]> | 2020-04-07 12:54:23 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2020-04-28 20:20:30 +0000 |
| commit | 9c466bcbda68d73c9ba26e8307b0dff11dd285d8 (patch) | |
| tree | 4f4765bb969023616471819d401cecc97324a350 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | |
| parent | drm/amdgpu: rename direct to immediate for VM updates (diff) | |
| download | kernel-9c466bcbda68d73c9ba26e8307b0dff11dd285d8.tar.gz kernel-9c466bcbda68d73c9ba26e8307b0dff11dd285d8.zip | |
drm/amdgpu: add new unlocked flag for PTE updates
For HMM support we need the ability to invalidate PTEs from
a MM callback where we can't lock the root PD.
Add a new flag to better support this instead of assuming
that all invalidation updates are unlocked.
Signed-off-by: Christian König <[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.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c index c78bcebd9378..8d9c6feba660 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c @@ -92,8 +92,8 @@ static int amdgpu_vm_sdma_commit(struct amdgpu_vm_update_params *p, { struct amdgpu_ib *ib = p->job->ibs; struct drm_sched_entity *entity; - struct dma_fence *f, *tmp; struct amdgpu_ring *ring; + struct dma_fence *f; int r; entity = p->immediate ? &p->vm->immediate : &p->vm->delayed; @@ -106,13 +106,13 @@ static int amdgpu_vm_sdma_commit(struct amdgpu_vm_update_params *p, if (r) goto error; - if (p->immediate) { - tmp = dma_fence_get(f); - swap(p->vm->last_immediate, f); + if (p->unlocked) { + struct dma_fence *tmp = dma_fence_get(f); + + swap(p->vm->last_unlocked, f); dma_fence_put(tmp); } else { - dma_resv_add_shared_fence(p->vm->root.base.bo->tbo.base.resv, - f); + amdgpu_bo_fence(p->vm->root.base.bo, f, true); } if (fence && !p->immediate) |
