drm/amdgpu: add VM update fences back to the root PD v2
Subsystems (2)
PATCH 1/1 drm/amdgpu: add VM update fences back to the root PD v2
Add update fences to the root PD while mapping BOs.
Otherwise PDs freed during the mapping won't wait for updates to finish and can cause corruptions.
v2: rebased on drm-misc-next
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +12 -2
@@ -588,8 +588,8 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, { entry->priority =0 ; entry->tv.bo = &vm->root.base.bo->tbo; -/* One for TTM and one for the CS job */ - entry->tv.num_shared =2 ; +/* Two for VM updates, one for TTM and one for the CS job */ + entry->tv.num_shared =4 ; entry->user_pages =NULL ;list_add (&entry->tv.head, validated); }
@@ -1591,6 +1591,16 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, goto error_unlock; } +if (flags &AMDGPU_PTE_VALID ) { +struct amdgpu_bo *root = vm->root.base.bo; + +if (!dma_fence_is_signaled (vm->last_direct)) +amdgpu_bo_fence (root, vm->last_direct, true); + +if (!dma_fence_is_signaled (vm->last_delayed)) +amdgpu_bo_fence (root, vm->last_delayed, true); + } + r = vm->update_funcs->prepare (¶ms, owner, exclusive);if (r) goto error_unlock;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
I get this conflict on top of drm-next
++<<<<<<< HEAD
+ r = vm->update_funcs->prepare(¶ms, resv, sync_mode);
++=======
+ if (flags & AMDGPU_PTE_VALID) {
+ struct amdgpu_bo *root = vm->root.base.bo; +
+ if (!dma_fence_is_signaled(vm->last_direct)) + amdgpu_bo_fence(root, vm->last_direct, true); +
+ if (!dma_fence_is_signaled(vm->last_delayed)) + amdgpu_bo_fence(root, vm->last_delayed, true); + }
+
+ r = vm->update_funcs->prepare(¶ms, owner, exclusive); ++>>>>>>> drm/amdgpu: add VM update fences back to the root PD v2
Should I keep the prepare call before or after your block?
Tom
Quoted 35 lines · Christian König
Add update fences to the root PD while mapping BOs.
Otherwise PDs freed during the mapping won't wait for updates to finish and can cause corruptions.
v2: rebased on drm-misc-next
Signed-off-by Christian König <[email protected]>Fixes 90b69cdc5f159 drm/amdgpu: stop adding VM updates fences to the resv obj--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5
-2@@ -588,8 +588,8 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, { entry->priority =0 ; entry->tv.bo = &vm->root.base.bo->tbo; -/* One for TTM and one for the CS job */ - entry->tv.num_shared =2 ; +/* Two for VM updates, one for TTM and one for the CS job */ + entry->tv.num_shared =4 ; entry->user_pages =NULL ;list_add (&entry->tv.head, validated); }@@ -1591,6 +1591,16 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, goto error_unlock; } +if (flags &AMDGPU_PTE_VALID ) { +struct amdgpu_bo *root = vm->root.base.bo; +
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, · line 1606
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +7
-0+if (!dma_fence_is_signaled (vm->last_direct)) +amdgpu_bo_fence (root, vm->last_direct, true); + +if (!dma_fence_is_signaled (vm->last_delayed)) +amdgpu_bo_fence (root, vm->last_delayed, true); + } + r = vm->update_funcs->prepare (¶ms, owner, exclusive);if (r) goto error_unlock;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Ignore that my brain wasn't engaged in the process. It's clear where you wanted the prepare call.
Tom
Quoted 60 lines · Tom St Denis
I get this conflict on top of drm-next
++<<<<<<< HEAD
+ r =vm->update_funcs->prepare(¶ms, resv, sync_mode);
++=======
+ if (flags &AMDGPU_PTE_VALID) {
+ structamdgpu_bo*root =vm->root.base.bo;drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +10
-0+ + if (!dma_fence_is_signaled(vm->last_direct)) + amdgpu_bo_fence(root, vm->last_direct, true); + + if (!dma_fence_is_signaled(vm->last_delayed)) + amdgpu_bo_fence(root, vm->last_delayed, true); + } + + r = vm->update_funcs->prepare(¶ms, owner, exclusive); ++>>>>>>> drm/amdgpu: add VM update fences back to the root PD v2Should I keep the prepare call before or after your block?
Tom
Quoted 37 lines · Christian König
Add update fences to the root PD while mapping BOs.
Otherwise PDs freed during the mapping won't wait for updates to finish and can cause corruptions.
v2: rebased on drm-misc-next
Signed-off-by Christian König <[email protected]>Fixes 90b69cdc5f159 drm/amdgpu: stop adding VM updates fences to the resv obj---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c| 14 ++++++++++++--1 file changed, 12 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +6
-2@@ -588,8 +588,8 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, { entry->priority = 0; entry->tv.bo = &vm->root.base.bo->tbo; - /* One for TTM and one for the CS job */ - entry->tv.num_shared = 2; + /* Two for VM updates, one for TTM and one for the CS job */ + entry->tv.num_shared = 4; entry->user_pages = NULL; list_add(&entry->tv.head, validated); }@@ -1591,6 +1591,16 @@ static int amdgpu_vm_bo_update_mapping(structamdgpu_device *adev, goto error_unlock; } + if (flags & AMDGPU_PTE_VALID) { + struct amdgpu_bo *root = vm->root.base.bo; + + if (!dma_fence_is_signaled(vm->last_direct)) + amdgpu_bo_fence(root, vm->last_direct, true);
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5
-0+ + if (!dma_fence_is_signaled(vm->last_delayed)) + amdgpu_bo_fence(root, vm->last_delayed, true); + } + r = vm->update_funcs->prepare(¶ms, owner, exclusive); if (r)goto
error_unlock;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Doesn't build even with conflict resolved:
[root@raven linux]# make
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool
CHK include/generated/compile.h
CC [M] drivers/gpu/drm/amd/amdgpu/amdgpu_vm.odrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c: In function ‘amdgpu_vm_bo_update_mapping’:drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1612:41: error: ‘owner’ undeclared (first use in this function)
1612 | r = vm->update_funcs->prepare(¶ms, owner, exclusive);
| ^~~~~drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1612:41: note: each undeclared identifier is reported only once for each function it appears in drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1612:48: error: ‘exclusive’ undeclared (first use in this function)
1612 | r = vm->update_funcs->prepare(¶ms, owner, exclusive);
| ^~~~~~~~~
make[4]: *** [scripts/Makefile.build:266: drivers/gpu/drm/amd/amdgpu/amdgpu_vm.o] Error 1
make[3]: *** [scripts/Makefile.build:509: drivers/gpu/drm/amd/amdgpu] Error 2
make[2]: *** [scripts/Makefile.build:509: drivers/gpu/drm] Error 2
make[1]: *** [scripts/Makefile.build:509: drivers/gpu] Error 2
make: *** [Makefile:1649: drivers] Error 2
Should I just move to drm-misc-next?
tom
Quoted 35 lines · Christian König
Add update fences to the root PD while mapping BOs.
Otherwise PDs freed during the mapping won't wait for updates to finish and can cause corruptions.
v2: rebased on drm-misc-next
Signed-off-by Christian König <[email protected]>Fixes 90b69cdc5f159 drm/amdgpu: stop adding VM updates fences to the resv obj--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5
-2@@ -588,8 +588,8 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, { entry->priority =0 ; entry->tv.bo = &vm->root.base.bo->tbo; -/* One for TTM and one for the CS job */ - entry->tv.num_shared =2 ; +/* Two for VM updates, one for TTM and one for the CS job */ + entry->tv.num_shared =4 ; entry->user_pages =NULL ;list_add (&entry->tv.head, validated); }@@ -1591,6 +1591,16 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, goto error_unlock; } +if (flags &AMDGPU_PTE_VALID ) { +struct amdgpu_bo *root = vm->root.base.bo; +
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, · line 1606
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +7
-0+if (!dma_fence_is_signaled (vm->last_direct)) +amdgpu_bo_fence (root, vm->last_direct, true); + +if (!dma_fence_is_signaled (vm->last_delayed)) +amdgpu_bo_fence (root, vm->last_delayed, true); + } + r = vm->update_funcs->prepare (¶ms, owner, exclusive);if (r) goto error_unlock;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Well what branch are you trying to merge that into?
The conflict resolution should be simple, just keep the vm->update_funcs->prepare(...) line as it is in your branch.
When you get those errors then something went wrong in your rebase.
Christian.
Am 19.02.20 um 16:14 schrieb Tom St Denis:
Quoted 64 lines
Doesn't build even with conflict resolved:
[root@raven linux]# make
CALLscripts/checksyscalls.sh
CALLscripts/atomic/check-atomics.sh
DESCEND objtool
CHKinclude/generated/compile.h
CC [M]drivers/gpu/drm/amd/amdgpu/amdgpu_vm.odrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c: In function ‘amdgpu_vm_bo_update_mapping’:drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1612:41: error: ‘owner’ undeclared (first use in this function)
1612 | r =vm->update_funcs->prepare(¶ms, owner, exclusive);
| ^~~~~drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1612:41: note: each undeclared identifier is reported only once for each function it appears indrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1612:48: error: ‘exclusive’ undeclared (first use in this function)
1612 | r =vm->update_funcs->prepare(¶ms, owner, exclusive);
| ^~~~~~~~~
make[4]: *** [scripts/Makefile.build:266:drivers/gpu/drm/amd/amdgpu/amdgpu_vm.o] Error 1
make[3]: *** [scripts/Makefile.build:509:drivers/gpu/drm/amd/amdgpu] Error 2
make[2]: *** [scripts/Makefile.build:509:drivers/gpu/drm] Error 2
make[1]: *** [scripts/Makefile.build:509:drivers/gpu] Error 2
make: *** [Makefile:1649: drivers] Error 2Should I just move to drm-misc-next?
tom
Quoted 37 lines · Christian König
Add update fences to the root PD while mapping BOs.
Otherwise PDs freed during the mapping won't wait for updates to finish and can cause corruptions.
v2: rebased on drm-misc-next
Signed-off-by Christian König <[email protected]>Fixes 90b69cdc5f159 drm/amdgpu: stop adding VM updates fences to the resv obj---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c| 14 ++++++++++++--1 file changed, 12 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +6
-2@@ -588,8 +588,8 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, { entry->priority = 0; entry->tv.bo = &vm->root.base.bo->tbo; - /* One for TTM and one for the CS job */ - entry->tv.num_shared = 2; + /* Two for VM updates, one for TTM and one for the CS job */ + entry->tv.num_shared = 4; entry->user_pages = NULL; list_add(&entry->tv.head, validated); }@@ -1591,6 +1591,16 @@ static int amdgpu_vm_bo_update_mapping(structamdgpu_device *adev, goto error_unlock; } + if (flags & AMDGPU_PTE_VALID) { + struct amdgpu_bo *root = vm->root.base.bo; + + if (!dma_fence_is_signaled(vm->last_direct)) + amdgpu_bo_fence(root, vm->last_direct, true);
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5
-0+ + if (!dma_fence_is_signaled(vm->last_delayed)) + amdgpu_bo_fence(root, vm->last_delayed, true); + } + r = vm->update_funcs->prepare(¶ms, owner, exclusive); if (r)goto
error_unlock;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Tom St Denis
Acked-by Hawking ZhangThe tip of origin/amd-staging-drm-next for me is:
commit 7fd3b632e17e55c5ffd008f9f025754e7daa1b66
Refs: {origin/amd-staging-drm-next}, v5.4-rc7-2847-g7fd3b632e17e Author: Monk Liu <[email protected]>
AuthorDate: Thu Feb 6 23:55:58 2020 +0800
Commit: Monk Liu <[email protected]>
CommitDate: Wed Feb 19 13:33:02 2020 +0800
drm/amdgpu: fix colliding of preemption
what:
some os preemption path is messed up with world switch preemption
fix:
cleanup those logics so os preemption not mixed with world switch
this patch is a general fix for issues comes from SRIOV MCBP, but there is still UMD side issues not resovlved yet, so this patch cannot fix all world switch bug.
Which I had fetched just an hour ago.
Quoted 73 lines · Christian König
Well what branch are you trying to merge that into?
The conflict resolution should be simple, just keep the
vm->update_funcs->prepare(...)line as it is in your branch.When you get those errors then something went wrong in your rebase.
Christian.
Am 19.02.20 um 16:14 schrieb Tom St Denis:
Quoted 64 lines
Doesn't build even with conflict resolved:
[root@raven linux]# make
CALLscripts/checksyscalls.sh
CALLscripts/atomic/check-atomics.sh
DESCEND objtool
CHKinclude/generated/compile.h
CC [M]drivers/gpu/drm/amd/amdgpu/amdgpu_vm.odrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c: In function ‘amdgpu_vm_bo_update_mapping’:drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1612:41: error: ‘owner’ undeclared (first use in this function)
1612 | r =vm->update_funcs->prepare(¶ms, owner, exclusive);
| ^~~~~drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1612:41: note: each undeclared identifier is reported only once for each function it appears indrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1612:48: error: ‘exclusive’ undeclared (first use in this function)
1612 | r =vm->update_funcs->prepare(¶ms, owner, exclusive);
| ^~~~~~~~~
make[4]: *** [scripts/Makefile.build:266:drivers/gpu/drm/amd/amdgpu/amdgpu_vm.o] Error 1
make[3]: *** [scripts/Makefile.build:509:drivers/gpu/drm/amd/amdgpu] Error 2
make[2]: *** [scripts/Makefile.build:509:drivers/gpu/drm] Error 2
make[1]: *** [scripts/Makefile.build:509:drivers/gpu] Error 2
make: *** [Makefile:1649: drivers] Error 2Should I just move to drm-misc-next?
tom
Quoted 37 lines · Christian König
Add update fences to the root PD while mapping BOs.
Otherwise PDs freed during the mapping won't wait for updates to finish and can cause corruptions.
v2: rebased on drm-misc-next
Signed-off-by Christian König <[email protected]>Fixes 90b69cdc5f159 drm/amdgpu: stop adding VM updates fences to the resv obj---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c| 14 ++++++++++++--1 file changed, 12 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +6
-2@@ -588,8 +588,8 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, { entry->priority = 0; entry->tv.bo = &vm->root.base.bo->tbo; - /* One for TTM and one for the CS job */ - entry->tv.num_shared = 2; + /* Two for VM updates, one for TTM and one for the CS job */ + entry->tv.num_shared = 4; entry->user_pages = NULL; list_add(&entry->tv.head, validated); }@@ -1591,6 +1591,16 @@ static int amdgpu_vm_bo_update_mapping(structamdgpu_device *adev, goto error_unlock; } + if (flags & AMDGPU_PTE_VALID) { + struct amdgpu_bo *root = vm->root.base.bo; + + if (!dma_fence_is_signaled(vm->last_direct)) + amdgpu_bo_fence(root, vm->last_direct, true);
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5
-0+ + if (!dma_fence_is_signaled(vm->last_delayed)) + amdgpu_bo_fence(root, vm->last_delayed, true); + } + r = vm->update_funcs->prepare(¶ms, owner, exclusive); if (r)goto
error_unlock;
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
maintainerFor amd-staging-drm-next you need the first version of the patch.
For drm-misc-next or drm-next you need the second version of the patch.
We probably need to merge the patch through drm-misc-next anyway since there is also the patch which causes the problems.
Christian.
Am 19.02.20 um 16:47 schrieb Tom St Denis:
Quoted 21 lines
The tip of origin/amd-staging-drm-next for me is:
commit
7fd3b632e17e55c5ffd008f9f025754e7daa1b66
Refs: {origin/amd-staging-drm-next}, v5.4-rc7-2847-g7fd3b632e17e Author: Monk Liu <[email protected]>
AuthorDate: Thu Feb 6 23:55:58 2020 +0800
Commit: Monk Liu <[email protected]>
CommitDate: Wed Feb 19 13:33:02 2020 +0800drm/amdgpu: fix colliding of preemption
what:
some os preemption path is messed up with world switch preemptionfix:
cleanup those logics so os preemption not mixed with world switchthis patch is a general fix for issues comes from SRIOV MCBP, but there is still UMD side issues not resovlved yet, so this patch cannot fix all world switch bug.
Quoted 88 lines
Signed-off-by Monk Liu <[email protected]>Acked-by Hawking Zhang <[email protected]>Which I had fetched just an hour ago.
Quoted 82 lines · Christian König
Well what branch are you trying to merge that into?
The conflict resolution should be simple, just keep the
vm->update_funcs->prepare(...)line as it is in your branch.When you get those errors then something went wrong in your rebase.
Christian.
Am 19.02.20 um 16:14 schrieb Tom St Denis:
Quoted 72 lines
Doesn't build even with conflict resolved:
[root@raven linux]# make
CALLscripts/checksyscalls.sh
CALLscripts/atomic/check-atomics.sh
DESCEND objtool
CHKinclude/generated/compile.h
CC [M]drivers/gpu/drm/amd/amdgpu/amdgpu_vm.odrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c: In function ‘amdgpu_vm_bo_update_mapping’:drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1612:41: error: ‘owner’ undeclared (first use in this function)
1612 | r =vm->update_funcs->prepare(¶ms, owner, exclusive);
| ^~~~~drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1612:41: note: each undeclared identifier is reported only once for each function it appears indrivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1612:48: error: ‘exclusive’ undeclared (first use in this function)
1612 | r =vm->update_funcs->prepare(¶ms, owner, exclusive);
| ^~~~~~~~~
make[4]: *** [scripts/Makefile.build:266:drivers/gpu/drm/amd/amdgpu/amdgpu_vm.o] Error 1
make[3]: *** [scripts/Makefile.build:509:drivers/gpu/drm/amd/amdgpu] Error 2
make[2]: *** [scripts/Makefile.build:509:drivers/gpu/drm] Error 2
make[1]: *** [scripts/Makefile.build:509:drivers/gpu] Error 2
make: *** [Makefile:1649: drivers] Error 2Should I just move to drm-misc-next?
tom
Quoted 45 lines · Christian König
Add update fences to the root PD while mapping BOs.
Otherwise PDs freed during the mapping won't wait for updates to finish and can cause corruptions.
v2: rebased on drm-misc-next
Signed-off-by Christian König <[email protected]>Fixes 90b69cdc5f159 drm/amdgpu: stop adding VM updates fences to the resv obj---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c| 14 ++++++++++++--1 file changed, 12 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +11
-2@@ -588,8 +588,8 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, { entry->priority = 0; entry->tv.bo = &vm->root.base.bo->tbo; - /* One for TTM and one for the CS job */ - entry->tv.num_shared = 2; + /* Two for VM updates, one for TTM and one for the CS job */ + entry->tv.num_shared = 4; entry->user_pages = NULL; list_add(&entry->tv.head, validated); }@@ -1591,6 +1591,16 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, goto error_unlock; } + if (flags & AMDGPU_PTE_VALID) { + struct amdgpu_bo *root = vm->root.base.bo; + + if (!dma_fence_is_signaled(vm->last_direct)) + amdgpu_bo_fence(root, vm->last_direct, true); + + if (!dma_fence_is_signaled(vm->last_delayed)) + amdgpu_bo_fence(root, vm->last_delayed, true); + } + r = vm->update_funcs->prepare(¶ms, owner, exclusive); if (r)goto
error_unlock;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 19.02.20 um 16:02 schrieb Christian König:
Quoted 9 lines
Add update fences to the root PD while mapping BOs.
Otherwise PDs freed during the mapping won't wait for updates to finish and can cause corruptions.
v2: rebased on drm-misc-next
Signed-off-by Christian König <[email protected]>Fixes 90b69cdc5f159 drm/amdgpu: stop adding VM updates fences to the resv obj
Felix and Xinhui can I get an rb or at least Acked-by for this patch? It is a major problem for testing which needs to get fixed.
Thanks,
Christian.
Quoted 26 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5
-2@@ -588,8 +588,8 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, { entry->priority =0 ; entry->tv.bo = &vm->root.base.bo->tbo; -/* One for TTM and one for the CS job */ - entry->tv.num_shared =2 ; +/* Two for VM updates, one for TTM and one for the CS job */ + entry->tv.num_shared =4 ; entry->user_pages =NULL ;list_add (&entry->tv.head, validated); }@@ -1591,6 +1591,16 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, goto error_unlock; } +if (flags &AMDGPU_PTE_VALID ) { +struct amdgpu_bo *root = vm->root.base.bo; +
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, · line 1606
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +7
-0+if (!dma_fence_is_signaled (vm->last_direct)) +amdgpu_bo_fence (root, vm->last_direct, true); + +if (!dma_fence_is_signaled (vm->last_delayed)) +amdgpu_bo_fence (root, vm->last_delayed, true); + } + r = vm->update_funcs->prepare (¶ms, owner, exclusive);if (r) goto error_unlock;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Pan, Xinhui
Reviewed-byQuoted 45 lines
2020年2月25日 20:45,Christian König <[email protected]> 写道:
Am 19.02.20 um 16:02 schrieb Christian König:
Quoted 9 lines
Add update fences to the root PD while mapping BOs.
Otherwise PDs freed during the mapping won't wait for updates to finish and can cause corruptions.
v2: rebased on drm-misc-next
Signed-off-by Christian König <[email protected]>Fixes 90b69cdc5f159 drm/amdgpu: stop adding VM updates fences to the resv objFelix and Xinhui can I get an rb or at least Acked-by for this patch? It is a major problem for testing which needs to get fixed.
Thanks,
Christian.Quoted 27 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +6
-2@@ -588,8 +588,8 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, { entry->priority =0 ; entry->tv.bo = &vm->root.base.bo->tbo; -/* One for TTM and one for the CS job */ - entry->tv.num_shared =2 ; +/* Two for VM updates, one for TTM and one for the CS job */ + entry->tv.num_shared =4 ; entry->user_pages =NULL ;list_add (&entry->tv.head, validated); }@@ -1591,6 +1591,16 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, goto error_unlock; } + if (flags & AMDGPU_PTE_VALID) { +struct amdgpu_bo *root = vm->root.base.bo; + +if (!dma_fence_is_signaled (vm->last_direct)) +amdgpu_bo_fence (root, vm->last_direct, true);
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, · line 1606
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5
-0+ +if (!dma_fence_is_signaled (vm->last_delayed)) +amdgpu_bo_fence (root, vm->last_delayed, true); + } + r = vm->update_funcs->prepare (¶ms, owner, exclusive);if (r) goto error_unlock;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 9 lines · Christian König
Add update fences to the root PD while mapping BOs.
Otherwise PDs freed during the mapping won't wait for updates to finish and can cause corruptions.
v2: rebased on drm-misc-next
Signed-off-by Christian König <[email protected]>Fixes 90b69cdc5f159 drm/amdgpu: stop adding VM updates fences to the resv obj
Quoted 26 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5
-2@@ -588,8 +588,8 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, { entry->priority =0 ; entry->tv.bo = &vm->root.base.bo->tbo; -/* One for TTM and one for the CS job */ - entry->tv.num_shared =2 ; +/* Two for VM updates, one for TTM and one for the CS job */ + entry->tv.num_shared =4 ; entry->user_pages =NULL ;list_add (&entry->tv.head, validated); }@@ -1591,6 +1591,16 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, goto error_unlock; } +if (flags &AMDGPU_PTE_VALID ) { +struct amdgpu_bo *root = vm->root.base.bo; +
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, · line 1606
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +7
-0+if (!dma_fence_is_signaled (vm->last_direct)) +amdgpu_bo_fence (root, vm->last_direct, true); + +if (!dma_fence_is_signaled (vm->last_delayed)) +amdgpu_bo_fence (root, vm->last_delayed, true); + } + r = vm->update_funcs->prepare (¶ms, owner, exclusive);if (r) goto error_unlock;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx