drm/amdgpu: PRT support for gfx9 (v2)
Subsystems (2)
PATCH v2 1/1 drm/amdgpu: PRT support for gfx9 (v2)
v2: unify PRT bit for all ASICs
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5 -0
@@ -1473,6 +1473,11 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,spin_unlock (&vm->status_lock);list_for_each_entry (mapping, &bo_va->invalids, list) { +if (mapping->flags &AMDGPU_PTE_PRT ) { + flags |=AMDGPU_PTE_PRT ; + flags &= ~AMDGPU_PTE_VALID ; + } + r = amdgpu_vm_bo_split_mapping(adev, exclusive, gtt_flags, pages_addr, vm, mapping, flags, mem,
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +2 -1
@@ -65,7 +65,8 @@#define AMDGPU_PTE_FRAG (x) ((x & 0x1fULL) << 7) -#define AMDGPU_PTE_PRT (1ULL << 63) +/* TILED for VEGA10, reserved for older ASICs */ +#define AMDGPU_PTE_PRT (1ULL << 51)/* VEGA10 only */ #define AMDGPU_PTE_MTYPE (a) ((uint64_t)a << 57)
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1492566809-7312-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org
Am 19.04.2017 um 03:53 schrieb Junwei Zhang:
Quoted 15 lines
v2: unify PRT bit for all ASICs
Signed-off-by Junwei Zhang <[email protected]>Acked-by David Zhou <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_bo_update(struct amdgpu_device *adev, · line 1479
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +4
-0@@ -1473,6 +1473,11 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,spin_unlock (&vm->status_lock);list_for_each_entry (mapping, &bo_va->invalids, list) { +if (mapping->flags &AMDGPU_PTE_PRT ) { + flags |=AMDGPU_PTE_PRT ; + flags &= ~AMDGPU_PTE_VALID ; + }
Please move that into amdgpu_vm_bo_split_mapping() where we apply the other flags as well.
Additional to that we need a check like "&& adev->asic_type >= CHIP_VEGA10" here.
Not nice to have that ASIC specifc code here, but we can clean that up later on.
Regards,
Christian.
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-0+ r = amdgpu_vm_bo_split_mapping(adev, exclusive, gtt_flags, pages_addr, vm, mapping, flags, mem,drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h line 72
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +2
-1@@ -65,7 +65,8 @@#define AMDGPU_PTE_FRAG (x) ((x & 0x1fULL) << 7) -#define AMDGPU_PTE_PRT (1ULL << 63) +/* TILED for VEGA10, reserved for older ASICs */ +#define AMDGPU_PTE_PRT (1ULL << 51)/* VEGA10 only */ #define AMDGPU_PTE_MTYPE (a) ((uint64_t)a << 57)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): b655c990-648a-1e0a-c22f-6cbd32010c71-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Quoted 11 lines · Christian König
Am 19.04.2017 um 03:53 schrieb Junwei Zhang:
Quoted 10 lines
v2: unify PRT bit for all ASICs
Signed-off-by Junwei Zhang <[email protected]>Acked-by David Zhou <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-)
Quoted 15 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_bo_update(struct amdgpu_device *adev, · line 1478
Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +4
-0@@ -1473,6 +1473,11 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,spin_unlock (&vm->status_lock);list_for_each_entry (mapping, &bo_va->invalids, list) { +if (mapping->flags &AMDGPU_PTE_PRT ) { + flags |=AMDGPU_PTE_PRT ; + flags &= ~AMDGPU_PTE_VALID ; + }Please move that into
amdgpu_vm_bo_split_mapping()where we apply the other flags as well.
Actually I tried this way at first.
But it invalidates the CLEAR op and any calling amdgpu_vm_clear_freed(), as the input flags 0 cannot clear the PTE TILED bit.
Quoted 4 lines
Additional to that we need a check like "&&
adev->asic_type>=CHIP_VEGA10" here.Not nice to have that ASIC specifc code here, but we can clean that up later on.
although that's reserved bit for older ASIC, it sounds reasonable.
Jerry
Quoted 4 lines
Regards,
Christian.
Quoted 18 lines
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-0+ r = amdgpu_vm_bo_split_mapping(adev, exclusive, gtt_flags, pages_addr, vm, mapping, flags, mem,drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h line 69
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +2
-1@@ -65,7 +65,8 @@#define AMDGPU_PTE_FRAG (x) ((x & 0x1fULL) << 7) -#define AMDGPU_PTE_PRT (1ULL << 63) +/* TILED for VEGA10, reserved for older ASICs */ +#define AMDGPU_PTE_PRT (1ULL << 51)/* VEGA10 only */ #define AMDGPU_PTE_MTYPE (a) ((uint64_t)a << 57)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
Am 19.04.2017 um 10:10 schrieb Zhang, Jerry (Junwei):
Quoted 29 lines · Christian König
Quoted 11 lines
Am 19.04.2017 um 03:53 schrieb Junwei Zhang:
Quoted 10 lines
v2: unify PRT bit for all ASICs
Signed-off-by Junwei Zhang <[email protected]>Acked-by David Zhou <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-)Quoted 16 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_bo_update(struct amdgpu_device · line 1479
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +4
-0@@ -1473,6 +1473,11 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,spin_unlock (&vm->status_lock);list_for_each_entry (mapping, &bo_va->invalids, list) { +if (mapping->flags &AMDGPU_PTE_PRT ) { + flags |=AMDGPU_PTE_PRT ; + flags &= ~AMDGPU_PTE_VALID ; + }Please move that into
amdgpu_vm_bo_split_mapping()where we apply the other flags as well.
Quoted 2 lines
Actually I tried this way at first.
But it invalidates the CLEAR op and any callingamdgpu_vm_clear_freed(), as the input flags 0 cannot clear the PTE TILED bit.
Good point, but calling amdgpu_vm_bo_split_mapping() from amdgpu_vm_clear_freed() is nonsense in the first place.
We can clear a whole PT with just a single command, no need for splitting it into smaller operations.
I'm going to send a patch to fix this in a minute.
Christian.
Quoted 32 lines
Quoted 5 lines
Additional to that we need a check like "&&
adev->asic_type>=CHIP_VEGA10" here.Not nice to have that ASIC specifc code here, but we can clean that up later on.
although that's reserved bit for older ASIC, it sounds reasonable.
Jerry
Quoted 22 lines
Regards,
Christian.Quoted 16 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-0+ r = amdgpu_vm_bo_split_mapping(adev, exclusive, gtt_flags, pages_addr, vm, mapping, flags, mem,drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +2
-1@@ -65,7 +65,8 @@#define AMDGPU_PTE_FRAG (x) ((x & 0x1fULL) << 7) -#define AMDGPU_PTE_PRT (1ULL << 63) +/* TILED for VEGA10, reserved for older ASICs */ +#define AMDGPU_PTE_PRT (1ULL << 51)/* VEGA10 only */ #define AMDGPU_PTE_MTYPE (a) ((uint64_t)a << 57)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 3f5eac3c-c7da-58e4-819e-a640785dbfdc-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Quoted 33 lines · Christian König
Am 19.04.2017 um 10:10 schrieb Zhang, Jerry (Junwei):
Quoted 28 lines · Christian König
Quoted 11 lines
Am 19.04.2017 um 03:53 schrieb Junwei Zhang:
Quoted 10 lines
v2: unify PRT bit for all ASICs
Signed-off-by Junwei Zhang <[email protected]>Acked-by David Zhou <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-)Quoted 15 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_bo_update(struct amdgpu_device *adev, · line 1478
Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +4
-0@@ -1473,6 +1473,11 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,spin_unlock (&vm->status_lock);list_for_each_entry (mapping, &bo_va->invalids, list) { +if (mapping->flags &AMDGPU_PTE_PRT ) { + flags |=AMDGPU_PTE_PRT ; + flags &= ~AMDGPU_PTE_VALID ; + }Please move that into
amdgpu_vm_bo_split_mapping()where we apply the other flags as well.Quoted 3 lines
Actually I tried this way at first.
But it invalidates the CLEAR op and any callingamdgpu_vm_clear_freed(), as the input flags 0 cannot clear the PTE TILED bit.
Quoted 7 lines
Good point, but calling
amdgpu_vm_bo_split_mapping()fromamdgpu_vm_clear_freed()is nonsense in the first place.We can clear a whole PT with just a single command, no need for splitting it into smaller operations.
I'm going to send a patch to fix this in a minute.
Thanks for your patch.
Based on that, I prepare the patch v3, it works on my side. Please help to check it.
Jerry
Quoted 38 lines
Christian.
Quoted 34 lines
Quoted 7 lines
Additional to that we need a check like "&&
adev->asic_type>=CHIP_VEGA10" here.Not nice to have that ASIC specifc code here, but we can clean that up later on.
although that's reserved bit for older ASIC, it sounds reasonable.
Jerry
Quoted 22 lines
Regards,
Christian.Quoted 16 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-0+ r = amdgpu_vm_bo_split_mapping(adev, exclusive, gtt_flags, pages_addr, vm, mapping, flags, mem,drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +2
-1@@ -65,7 +65,8 @@#define AMDGPU_PTE_FRAG (x) ((x & 0x1fULL) << 7) -#define AMDGPU_PTE_PRT (1ULL << 63) +/* TILED for VEGA10, reserved for older ASICs */ +#define AMDGPU_PTE_PRT (1ULL << 51)/* VEGA10 only */ #define AMDGPU_PTE_MTYPE (a) ((uint64_t)a << 57)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx