drm/amdgpu: Export function to flush TLB of specific vm hub
Subsystems (3)
PATCH 1/2 drm/amdgpu: Export function to flush TLB of specific vm hub
This is for kfd to reuse amdgpu TLB invalidation function. There is already a gmc function flush_gpu_tlb to flush TLB on all vm hub. On gfx10, kfd only needs to flush TLB on gfx hub but not on mm hub. So export a function for KFD flush TLB only on gfx hub.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 4 ++++ drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 1 + 2 files changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +4 -0
@@ -88,6 +88,9 @@ struct amdgpu_vmhub {* GPU MC structures, functions & helpers */ struct amdgpu_gmc_funcs { +/* flush vm tlb of specific hub */ +void (*flush_vm_hub)(struct amdgpu_device *adev,uint32_t vmid, +unsigned int vmhub,uint32_t flush_type);/* flush the vm tlb via mmio */ void (*flush_gpu_tlb)(struct amdgpu_device *adev,uint32_t vmid,uint32_t flush_type);
@@ -180,6 +183,7 @@ struct amdgpu_gmc {struct ras_common_if *ras_if; }; +#define amdgpu_gmc_flush_vm_hub (adev, vmid, vmhub, type) ((adev)->gmc.gmc_funcs->flush_vm_hub((adev), (vmid), (vmhub), (type)))#define amdgpu_gmc_flush_gpu_tlb (adev, vmid, type) (adev)->gmc.gmc_funcs->flush_gpu_tlb((adev), (vmid), (type))#define amdgpu_gmc_emit_flush_gpu_tlb (r, vmid, addr) (r)->adev->gmc.gmc_funcs->emit_flush_gpu_tlb((r), (vmid), (addr))#define amdgpu_gmc_emit_pasid_mapping (r, vmid, pasid) (r)->adev->gmc.gmc_funcs->emit_pasid_mapping((r), (vmid), (pasid))
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +1 -0
@@ -416,6 +416,7 @@ static void gmc_v10_0_get_vm_pde(struct amdgpu_device *adev, int level, }static const struct amdgpu_gmc_funcs gmc_v10_0_gmc_funcs = { + .flush_vm_hub = gmc_v10_0_flush_vm_hub, .flush_gpu_tlb = gmc_v10_0_flush_gpu_tlb, .emit_flush_gpu_tlb = gmc_v10_0_emit_flush_gpu_tlb, .emit_pasid_mapping = gmc_v10_0_emit_pasid_mapping,
Signature · 6 lines
2.7.4 _______________________________________________ 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): 1564761834-19210-1-git-send-email-Oak.Zeng-5C7GfCeVMHo@public.gmane.org
PATCH 2/2 drm/amdkfd/gfx10: Calling amdgpu functions to invalidate TLB
Calling amdgpu function to invalidate TLB, instead of using a kfd implementation. Delete the kfd local TLB invalidation implementation.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c | 41 ++-------------------- 1 file changed, 3 insertions(+), 38 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c +3 -38
@@ -802,42 +802,6 @@ static uint16_t get_atc_vmid_pasid_mapping_pasid(struct kgd_dev *kgd,return reg &ATC_VMID0_PASID_MAPPING__PASID_MASK ; } -static void write_vmid_invalidate_request (struct kgd_dev *kgd,uint8_t vmid) -{ -struct amdgpu_device *adev = (struct amdgpu_device *) kgd; -uint32_t req = (1 << vmid) | - (0 <<GCVM_INVALIDATE_ENG0_REQ__FLUSH_TYPE__SHIFT ) |/* legacy */ -GCVM_INVALIDATE_ENG0_REQ__INVALIDATE_L2_PTES_MASK | -GCVM_INVALIDATE_ENG0_REQ__INVALIDATE_L2_PDE0_MASK | -GCVM_INVALIDATE_ENG0_REQ__INVALIDATE_L2_PDE1_MASK | -GCVM_INVALIDATE_ENG0_REQ__INVALIDATE_L2_PDE2_MASK | -GCVM_INVALIDATE_ENG0_REQ__INVALIDATE_L1_PTES_MASK ; - -mutex_lock (&adev->srbm_mutex); - -/* Use light weight invalidation. -* -* TODO 1: agree on the right set of invalidation registers for -* KFD use. Use the last one for now. Invalidate only GCHUB as -* SDMA is now moved to GCHUB -* -* TODO 2: support range-based invalidation, requires kfg2kgd -* interface change -*/ -WREG32 (SOC15_REG_OFFSET (GC ,0 , mmGCVM_INVALIDATE_ENG0_ADDR_RANGE_LO32), -0xffffffff ); -WREG32 (SOC15_REG_OFFSET (GC ,0 , mmGCVM_INVALIDATE_ENG0_ADDR_RANGE_HI32), -0x0000001f ); - -WREG32 (SOC15_REG_OFFSET (GC ,0 , mmGCVM_INVALIDATE_ENG0_REQ), req); - -while (!(RREG32 (SOC15_REG_OFFSET (GC ,0 , mmGCVM_INVALIDATE_ENG0_ACK)) & - (1 << vmid))) -cpu_relax (); - -mutex_unlock (&adev->srbm_mutex); -} -static int invalidate_tlbs_with_kiq (struct amdgpu_device *adev,uint16_t pasid) {signed long r;
@@ -878,7 +842,8 @@ static int invalidate_tlbs(struct kgd_dev *kgd, uint16_t pasid)if (get_atc_vmid_pasid_mapping_valid (kgd, vmid)) {if (get_atc_vmid_pasid_mapping_pasid (kgd, vmid) == pasid) { -write_vmid_invalidate_request (kgd, vmid); +amdgpu_gmc_flush_vm_hub (adev, vmid, +AMDGPU_GFXHUB_0 ,0 );break ; } }
@@ -896,7 +861,7 @@ static int invalidate_tlbs_vmid(struct kgd_dev *kgd, uint16_t vmid)return 0 ; } -write_vmid_invalidate_request (kgd, vmid); +amdgpu_gmc_flush_vm_hub (adev, vmid,AMDGPU_GFXHUB_0 ,0 );return 0 ; }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 02.08.19 um 18:04 schrieb Zeng, Oak:
Quoted 5 lines
This is for kfd to reuse amdgpu TLB invalidation function. There is already a gmc function
flush_gpu_tlbto flush TLB on all vm hub. On gfx10, kfd only needs to flush TLB on gfx hub but not on mm hub. So export a function for KFD flush TLB only on gfx hub.
I would rather go ahead and add another parameter to flush_gpu_tlb to note which hub needs flushing.
We can probably easily extend the few callers to flush all hubs needed.
Christian.
Quoted 35 lines
Change-Id I58ff00969f88438cfd3dc7e9deb7bff0c1bb4133Signed-off-by Oak Zeng <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 4 ++++ drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 1 + 2 files changed, 5 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +4
-0@@ -88,6 +88,9 @@ struct amdgpu_vmhub {* GPU MC structures, functions & helpers */ struct amdgpu_gmc_funcs { +/* flush vm tlb of specific hub */ +void (*flush_vm_hub)(struct amdgpu_device *adev,uint32_t vmid, +unsigned int vmhub,uint32_t flush_type);/* flush the vm tlb via mmio */ void (*flush_gpu_tlb)(struct amdgpu_device *adev,uint32_t vmid,uint32_t flush_type);@@ -180,6 +183,7 @@ struct amdgpu_gmc {struct ras_common_if *ras_if; }; +#define amdgpu_gmc_flush_vm_hub (adev, vmid, vmhub, type) ((adev)->gmc.gmc_funcs->flush_vm_hub((adev), (vmid), (vmhub), (type)))#define amdgpu_gmc_flush_gpu_tlb (adev, vmid, type) (adev)->gmc.gmc_funcs->flush_gpu_tlb((adev), (vmid), (type))#define amdgpu_gmc_emit_flush_gpu_tlb (r, vmid, addr) (r)->adev->gmc.gmc_funcs->emit_flush_gpu_tlb((r), (vmid), (addr))#define amdgpu_gmc_emit_pasid_mapping (r, vmid, pasid) (r)->adev->gmc.gmc_funcs->emit_pasid_mapping((r), (vmid), (pasid))drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c static void gmc_v10_0_get_vm_pde(struct amdgpu_device *adev, int level, · line 422
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +1
-0@@ -416,6 +416,7 @@ static void gmc_v10_0_get_vm_pde(struct amdgpu_device *adev, int level, }static const struct amdgpu_gmc_funcs gmc_v10_0_gmc_funcs = { + .flush_vm_hub = gmc_v10_0_flush_vm_hub, .flush_gpu_tlb = gmc_v10_0_flush_gpu_tlb, .emit_flush_gpu_tlb = gmc_v10_0_emit_flush_gpu_tlb, .emit_pasid_mapping = gmc_v10_0_emit_pasid_mapping,
_______________________________________________
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): 855377a1-69ca-891e-1dad-5b93f57671da-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Ok, will do it.
BTW, does those codes below really needed, in function gmc_v10_0_flush_gpu_tlb. I think if we have the bug, then before below codes, when we flush TLB of gfxhub through mmio, it has already triggered the bug. Also as we already invalidated tlb on both mm and gfx hub (in the same function gmc_v10_0_flush_gpu_tlb), what is the point of below codes? Does the coded below invalidate TLB on both mm and gfx hub? Also @Zhang, Hawking@Deucher, Alexander
/* The SDMA on Navi has a bug which can theoretically result in memory * corruption if an invalidation happens at the same time as an VA * translation. Avoid this by doing the invalidation from the SDMA * itself. */ r = amdgpu_job_alloc_with_ib(adev, 16 * 4, &job); if (r) goto error_alloc; job->vm_pd_addr = amdgpu_gmc_pd_addr(adev->gart.bo); job->vm_needs_flush = true; amdgpu_ring_pad_ib(ring, &job->ibs[0]); r = amdgpu_job_submit(job, &adev->mman.entity, AMDGPU_FENCE_OWNER_UNDEFINED, &fence);
Regards,
Oak
-----Original Message-----
From: Christian König <[email protected]>
Sent: Monday, August 5, 2019 5:37 AM
To: Zeng, Oak <[email protected]>; [email protected]
Cc: Kuehling, Felix <[email protected]>; Zhou1, Tao <[email protected]>; Liu, Shaoyun <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Export function to flush TLB of specific vm hub
Am 02.08.19 um 18:04 schrieb Zeng, Oak:
Quoted 4 lines
This is for kfd to reuse amdgpu TLB invalidation function. There is already a gmc function
flush_gpu_tlbto flush TLB on all vm hub. On gfx10, kfd only needs to flush TLB on gfx hub but not on mm hub. So export a function for KFD flush TLB only on gfx hub.
I would rather go ahead and add another parameter to flush_gpu_tlb to note which hub needs flushing.
We can probably easily extend the few callers to flush all hubs needed.
Christian.
Quoted 40 lines
Change-Id I58ff00969f88438cfd3dc7e9deb7bff0c1bb4133Signed-off-by Oak Zeng <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 4 ++++ drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 1 + 2 files changed, 5 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +3
-0@@ -88,6 +88,9 @@ struct amdgpu_vmhub {* GPU MC structures, functions & helpers */ struct amdgpu_gmc_funcs { +/* flush vm tlb of specific hub */ +void (*flush_vm_hub)(struct amdgpu_device *adev,uint32_t vmid, +unsigned int vmhub,uint32_t flush_type);/* flush the vm tlb via mmio */ void (*flush_gpu_tlb)(struct amdgpu_device *adev, uint32_t vmid, uint32_t flush_type); @@ -180,6 +183,7 @@struct
amdgpu_gmc{
structras_common_if*ras_if;
};drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +3
-0+#define amdgpu_gmc_flush_vm_hub (adev, vmid, vmhub, type) +((adev)->gmc.gmc_funcs->flush_vm_hub((adev), (vmid), (vmhub), +(type)))#define amdgpu_gmc_flush_gpu_tlb (adev, vmid, type) (adev)->gmc.gmc_funcs->flush_gpu_tlb((adev), (vmid), (type))#define amdgpu_gmc_emit_flush_gpu_tlb (r, vmid, addr) (r)->adev->gmc.gmc_funcs->emit_flush_gpu_tlb((r), (vmid), (addr))#define amdgpu_gmc_emit_pasid_mapping (r, vmid, pasid)(r)->adev->gmc.gmc_funcs->emit_pasid_mapping((r), (vmid), (pasid))
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c static void gmc_v10_0_get_vm_pde(struct amdgpu_device *adev, int level, · line 422
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +1
-0@@ -416,6 +416,7 @@ static void gmc_v10_0_get_vm_pde(struct amdgpu_device *adev, int level, }static const struct amdgpu_gmc_funcs gmc_v10_0_gmc_funcs = { + .flush_vm_hub = gmc_v10_0_flush_vm_hub, .flush_gpu_tlb = gmc_v10_0_flush_gpu_tlb, .emit_flush_gpu_tlb = gmc_v10_0_emit_flush_gpu_tlb, .emit_pasid_mapping = gmc_v10_0_emit_pasid_mapping,
_______________________________________________
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): BL0PR12MB2580778BFD71E211AC18CFAF80D40-b4cIHhjg/p/[email protected]
Quoted 1 line
Does the coded below invalidate TLB on both mm and gfx hub?
No, just the gfx hub. The VMHUBs on Navi are unfortunately really buggy, so we had to do a lot of workarounds to get them into a state where they actually did what was expected from them.
One major issue for example is that you can't do MMIO based VM invalidation when the engine is busy. To work around this we do the invalidation with the (IIRC) SDMA engine as soon as that one is working.
The is the code you are noting below.
Regards,
Christian.
Am 07.08.19 um 04:40 schrieb Zeng, Oak:
Quoted 81 lines
Ok, will do it.
BTW, does those codes below really needed, in function
gmc_v10_0_flush_gpu_tlb. I think if we have the bug, then before below codes, when we flush TLB of gfxhub through mmio, it has already triggered the bug. Also as we already invalidated tlb on both mm and gfx hub (in the same functiongmc_v10_0_flush_gpu_tlb), what is the point of below codes? Does the coded below invalidate TLB on both mm and gfx hub? Also @Zhang, Hawking@Deucher, Alexander/* The SDMA on Navi has a bug which can theoretically result in memory * corruption if an invalidation happens at the same time as an VA * translation. Avoid this by doing the invalidation from the SDMA * itself. */ r = amdgpu_job_alloc_with_ib(adev, 16 * 4, &job); if (r) goto error_alloc; job->vm_pd_addr = amdgpu_gmc_pd_addr(adev->gart.bo); job->vm_needs_flush = true; amdgpu_ring_pad_ib(ring, &job->ibs[0]); r = amdgpu_job_submit(job, &adev->mman.entity, AMDGPU_FENCE_OWNER_UNDEFINED, &fence);Regards,
Oak-----Original Message-----
From: Christian König <[email protected]>
Sent: Monday, August 5, 2019 5:37 AM
To: Zeng, Oak <[email protected]>; [email protected]
Cc: Kuehling, Felix <[email protected]>; Zhou1, Tao <[email protected]>; Liu, Shaoyun <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Export function to flush TLB of specific vm hubAm 02.08.19 um 18:04 schrieb Zeng, Oak:
Quoted 4 lines
This is for kfd to reuse amdgpu TLB invalidation function. There is already a gmc function
flush_gpu_tlbto flush TLB on all vm hub. On gfx10, kfd only needs to flush TLB on gfx hub but not on mm hub. So export a function for KFD flush TLB only on gfx hub.I would rather go ahead and add another parameter to
flush_gpu_tlbto note which hub needs flushing.We can probably easily extend the few callers to flush all hubs needed.
Christian.
Quoted 41 lines
Change-Id I58ff00969f88438cfd3dc7e9deb7bff0c1bb4133Signed-off-by Oak Zeng <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 4 ++++ drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 1 + 2 files changed, 5 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +3
-0@@ -88,6 +88,9 @@ struct amdgpu_vmhub {* GPU MC structures, functions & helpers */ struct amdgpu_gmc_funcs { +/* flush vm tlb of specific hub */ +void (*flush_vm_hub)(struct amdgpu_device *adev,uint32_t vmid, +unsigned int vmhub,uint32_t flush_type);/* flush the vm tlb via mmio */ void (*flush_gpu_tlb)(struct amdgpu_device *adev, uint32_t vmid, uint32_t flush_type); @@ -180,6 +183,7 @@struct amdgpu_gmc { struct ras_common_if *ras_if; };drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +3
-0+#define amdgpu_gmc_flush_vm_hub (adev, vmid, vmhub, type) +((adev)->gmc.gmc_funcs->flush_vm_hub ((adev), (vmid), (vmhub), +(type)))#define amdgpu_gmc_flush_gpu_tlb (adev, vmid, type) (adev)->gmc.gmc_funcs->flush_gpu_tlb((adev), (vmid), (type))#define amdgpu_gmc_emit_flush_gpu_tlb (r, vmid, addr) (r)->adev->gmc.gmc_funcs->emit_flush_gpu_tlb((r), (vmid), (addr))#define amdgpu_gmc_emit_pasid_mapping (r, vmid, pasid)(r)->adev->gmc.gmc_funcs->emit_pasid_mapping((r), (vmid), (pasid))
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +0
-0@@ -416,6 +416,7 @@ static void gmc_v10_0_get_vm_pde(struct amdgpu_device *adev, int level, }
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c static void gmc_v10_0_get_vm_pde(struct amdgpu_device *adev, int level, · line 422
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +1
-0static const struct amdgpu_gmc_funcs gmc_v10_0_gmc_funcs = { + .flush_vm_hub = gmc_v10_0_flush_vm_hub, .flush_gpu_tlb = gmc_v10_0_flush_gpu_tlb, .emit_flush_gpu_tlb = gmc_v10_0_emit_flush_gpu_tlb, .emit_pasid_mapping = gmc_v10_0_emit_pasid_mapping,_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
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): 65784ad0-7693-9c98-82ee-66713c99f49b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Thanks. I realized I didn't read the code careful enough...The workaround is only for navi10 and navi12 - I didn't read this correctly and was thinking gfxhub tlb invalidation was done twice.
I understand the codes now. I think the HW SDMA bug has been fixed in navi14 so we don't need that WA for 14.
Regards,
Oak
-----Original Message-----
From: Christian König <[email protected]>
Sent: Wednesday, August 7, 2019 4:51 AM
To: Zeng, Oak <[email protected]>; Kuehling, Felix <[email protected]>; Koenig, Christian <[email protected]>; [email protected]; Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>
Cc: Zhou1, Tao <[email protected]>; Liu, Shaoyun <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Export function to flush TLB of specific vm hub
Quoted 1 line
Does the coded below invalidate TLB on both mm and gfx hub?
No, just the gfx hub. The VMHUBs on Navi are unfortunately really buggy, so we had to do a lot of workarounds to get them into a state where they actually did what was expected from them.
One major issue for example is that you can't do MMIO based VM invalidation when the engine is busy. To work around this we do the invalidation with the (IIRC) SDMA engine as soon as that one is working.
The is the code you are noting below.
Regards,
Christian.
Am 07.08.19 um 04:40 schrieb Zeng, Oak:
Quoted 89 lines
Ok, will do it.
BTW, does those codes below really needed, in function
gmc_v10_0_flush_gpu_tlb. I think if we have the bug, then before below codes, when we flush TLB of gfxhub through mmio, it has already triggered the bug. Also as we already invalidated tlb on both mm and gfx hub (in the same functiongmc_v10_0_flush_gpu_tlb), what is the point of below codes? Does the coded below invalidate TLB on both mm and gfx hub? Also @Zhang, Hawking@Deucher, Alexander/* The SDMA on Navi has a bug which can theoretically result in memory * corruption if an invalidation happens at the same time as an VA * translation. Avoid this by doing the invalidation from the SDMA * itself. */ r = amdgpu_job_alloc_with_ib(adev, 16 * 4, &job); if (r) goto error_alloc; job->vm_pd_addr = amdgpu_gmc_pd_addr(adev->gart.bo); job->vm_needs_flush = true; amdgpu_ring_pad_ib(ring, &job->ibs[0]); r = amdgpu_job_submit(job, &adev->mman.entity, AMDGPU_FENCE_OWNER_UNDEFINED, &fence);Regards,
Oak-----Original Message-----
From: Christian König <[email protected]>
Sent: Monday, August 5, 2019 5:37 AM
To: Zeng, Oak <[email protected]>; [email protected]
Cc: Kuehling, Felix <[email protected]>; Zhou1, Tao <[email protected]>; Liu, Shaoyun <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Export function to flush TLB of specific vm hubAm 02.08.19 um 18:04 schrieb Zeng, Oak:
Quoted 4 lines
This is for kfd to reuse amdgpu TLB invalidation function. There is already a gmc function
flush_gpu_tlbto flush TLB on all vm hub. On gfx10, kfd only needs to flush TLB on gfx hub but not on mm hub. So export a function for KFD flush TLB only on gfx hub.I would rather go ahead and add another parameter to
flush_gpu_tlbto note which hub needs flushing.We can probably easily extend the few callers to flush all hubs needed.
Christian.
Quoted 41 lines
Change-Id I58ff00969f88438cfd3dc7e9deb7bff0c1bb4133Signed-off-by Oak Zeng <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 4 ++++ drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 1 + 2 files changed, 5 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +3
-0@@ -88,6 +88,9 @@ struct amdgpu_vmhub {* GPU MC structures, functions & helpers */ struct amdgpu_gmc_funcs { +/* flush vm tlb of specific hub */ +void (*flush_vm_hub)(struct amdgpu_device *adev,uint32_t vmid, +unsigned int vmhub,uint32_t flush_type);/* flush the vm tlb via mmio */ void (*flush_gpu_tlb)(struct amdgpu_device *adev, uint32_t vmid, uint32_t flush_type); @@ -180,6 +183,7 @@struct amdgpu_gmc { struct ras_common_if *ras_if; };drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +3
-0+#define amdgpu_gmc_flush_vm_hub (adev, vmid, vmhub, type) +((adev)->gmc.gmc_funcs->flush_vm_hub((adev), (vmid), (vmhub), +(type)))#define amdgpu_gmc_flush_gpu_tlb (adev, vmid, type) (adev)->gmc.gmc_funcs->flush_gpu_tlb((adev), (vmid), (type))#define amdgpu_gmc_emit_flush_gpu_tlb (r, vmid, addr) (r)->adev->gmc.gmc_funcs->emit_flush_gpu_tlb((r), (vmid), (addr))#define amdgpu_gmc_emit_pasid_mapping (r, vmid, pasid)(r)->adev->gmc.gmc_funcs->emit_pasid_mapping((r), (vmid), (pasid))
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +0
-0@@ -416,6 +416,7 @@ static void gmc_v10_0_get_vm_pde(struct amdgpu_device *adev, int level, }
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c static void gmc_v10_0_get_vm_pde(struct amdgpu_device *adev, int level, · line 422
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +1
-0static const struct amdgpu_gmc_funcs gmc_v10_0_gmc_funcs = { + .flush_vm_hub = gmc_v10_0_flush_vm_hub, .flush_gpu_tlb = gmc_v10_0_flush_gpu_tlb, .emit_flush_gpu_tlb = gmc_v10_0_emit_flush_gpu_tlb, .emit_pasid_mapping = gmc_v10_0_emit_pasid_mapping,_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx