drm/amdkfd: Contain MMHUB number in mmhub_v9_4_setup_vm_pt_regs()
Subsystems (3)
PATCH 1/1 drm/amdkfd: Contain MMHUB number in mmhub_v9_4_setup_vm_pt_regs()
Adjust the exposed function prototype so that the caller does not need to know the MMHUB number.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 6 ++---- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.h | 8 -------- drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.c | 14 ++++++++++++-- drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.h | 2 ++ 4 files changed, 16 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +2 -4
@@ -40,7 +40,7 @@#include "soc15d.h" #include "mmhub_v1_0.h" #include "gfxhub_v1_0.h" -#include "gmc_v9_0.h" +#include "mmhub_v9_4.h" enum hqd_dequeue_request_type {
@@ -774,9 +774,7 @@ void kgd_gfx_v9_set_vm_context_page_table_base(struct kgd_dev *kgd, uint32_t vmi* on GFX8 and older. */ if (adev->asic_type ==CHIP_ARCTURUS ) { -/* Two MMHUBs */ -mmhub_v9_4_setup_vm_pt_regs (adev,0 , vmid, page_table_base); -mmhub_v9_4_setup_vm_pt_regs (adev,1 , vmid, page_table_base); +mmhub_v9_4_setup_vm_pt_regs (adev, vmid, page_table_base); }else mmhub_v1_0_setup_vm_pt_regs (adev, vmid, page_table_base);
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.h +0 -8
@@ -36,12 +36,4 @@extern const struct amd_ip_funcs gmc_v9_0_ip_funcs;extern const struct amdgpu_ip_block_version gmc_v9_0_ip_block; - -/* amdgpu_amdkfd*.c */ -void gfxhub_v1_0_setup_vm_pt_regs (struct amdgpu_device *adev,uint32_t vmid, -uint64_t value); -void mmhub_v1_0_setup_vm_pt_regs (struct amdgpu_device *adev,uint32_t vmid, -uint64_t value); -void mmhub_v9_4_setup_vm_pt_regs (struct amdgpu_device *adev,int hubid, -uint32_t vmid,uint64_t value);#endif
drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.c +12 -2
@@ -54,7 +54,7 @@ u64 mmhub_v9_4_get_fb_location(struct amdgpu_device *adev)return base; } -void mmhub_v9_4_setup_vm_pt_regs (struct amdgpu_device *adev,int hubid, +static void mmhub_v9_4_setup_hubid_vm_pt_regs (struct amdgpu_device *adev,int hubid,uint32_t vmid,uint64_t value) {/* two registers distance between mmVML2VC0_VM_CONTEXT0_* to
@@ -80,7 +80,7 @@ static void mmhub_v9_4_init_gart_aperture_regs(struct amdgpu_device *adev, {uint64_t pt_base =amdgpu_gmc_pd_addr (adev->gart.bo); -mmhub_v9_4_setup_vm_pt_regs (adev, hubid,0 , pt_base); +mmhub_v9_4_setup_hubid_vm_pt_regs (adev, hubid,0 , pt_base); WREG32_SOC15_OFFSET(MMHUB, 0, mmVML2VC0_VM_CONTEXT0_PAGE_TABLE_START_ADDR_LO32,
@@ -101,6 +101,16 @@ static void mmhub_v9_4_init_gart_aperture_regs(struct amdgpu_device *adev, (u32)(adev->gmc.gart_end >> 44)); } +void mmhub_v9_4_setup_vm_pt_regs (struct amdgpu_device *adev,uint32_t vmid, +uint64_t page_table_base) +{ +int i; + +for (i =0 ; i <MMHUB_NUM_INSTANCES ; i++) +mmhub_v9_4_setup_hubid_vm_pt_regs (adev, i, vmid, + page_table_base); +} +static void mmhub_v9_4_init_system_aperture_regs (struct amdgpu_device *adev,int hubid) {
drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.h +2 -0
@@ -34,5 +34,7 @@ void mmhub_v9_4_init(struct amdgpu_device *adev);int mmhub_v9_4_set_clockgating (struct amdgpu_device *adev,enum amd_clockgating_state state);void mmhub_v9_4_get_clockgating (struct amdgpu_device *adev,u32 *flags); +void mmhub_v9_4_setup_vm_pt_regs (struct amdgpu_device *adev,uint32_t vmid, +uint64_t page_table_base);#endif
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Official Use Only - Internal Distribution Only]
________________________________
From: amd-gfx <[email protected]> on behalf of Yong Zhao <[email protected]>
Sent: Tuesday, December 3, 2019 10:02 AM
To: [email protected] <[email protected]>
Cc: Zhao, Yong <[email protected]>
Subject: [PATCH] drm/amdkfd: Contain MMHUB number in mmhub_v9_4_setup_vm_pt_regs()
Adjust the exposed function prototype so that the caller does not need to know the MMHUB number.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 6 ++---- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.h | 8 -------- drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.c | 14 ++++++++++++-- drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.h | 2 ++ 4 files changed, 16 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +2 -4
@@ -40,7 +40,7 @@#include "soc15d.h" #include "mmhub_v1_0.h" #include "gfxhub_v1_0.h" -#include "gmc_v9_0.h" +#include "mmhub_v9_4.h" enum hqd_dequeue_request_type {
@@ -774,9 +774,7 @@ void kgd_gfx_v9_set_vm_context_page_table_base(struct kgd_dev *kgd, uint32_t vmi* on GFX8 and older. */ if (adev->asic_type ==CHIP_ARCTURUS ) { -/* Two MMHUBs */ -mmhub_v9_4_setup_vm_pt_regs (adev,0 , vmid, page_table_base); -mmhub_v9_4_setup_vm_pt_regs (adev,1 , vmid, page_table_base); +mmhub_v9_4_setup_vm_pt_regs (adev, vmid, page_table_base); }else mmhub_v1_0_setup_vm_pt_regs (adev, vmid, page_table_base);
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.h +0 -8
@@ -36,12 +36,4 @@extern const struct amd_ip_funcs gmc_v9_0_ip_funcs;extern const struct amdgpu_ip_block_version gmc_v9_0_ip_block; - -/* amdgpu_amdkfd*.c */ -void gfxhub_v1_0_setup_vm_pt_regs (struct amdgpu_device *adev,uint32_t vmid, -uint64_t value); -void mmhub_v1_0_setup_vm_pt_regs (struct amdgpu_device *adev,uint32_t vmid, -uint64_t value); -void mmhub_v9_4_setup_vm_pt_regs (struct amdgpu_device *adev,int hubid, -uint32_t vmid,uint64_t value);#endif
drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.c +12 -2
@@ -54,7 +54,7 @@ u64 mmhub_v9_4_get_fb_location(struct amdgpu_device *adev)return base; } -void mmhub_v9_4_setup_vm_pt_regs (struct amdgpu_device *adev,int hubid, +static void mmhub_v9_4_setup_hubid_vm_pt_regs (struct amdgpu_device *adev,int hubid,uint32_t vmid,uint64_t value) {/* two registers distance between mmVML2VC0_VM_CONTEXT0_* to
@@ -80,7 +80,7 @@ static void mmhub_v9_4_init_gart_aperture_regs(struct amdgpu_device *adev, {uint64_t pt_base =amdgpu_gmc_pd_addr (adev->gart.bo); -mmhub_v9_4_setup_vm_pt_regs (adev, hubid,0 , pt_base); +mmhub_v9_4_setup_hubid_vm_pt_regs (adev, hubid,0 , pt_base); WREG32_SOC15_OFFSET(MMHUB, 0, mmVML2VC0_VM_CONTEXT0_PAGE_TABLE_START_ADDR_LO32,
@@ -101,6 +101,16 @@ static void mmhub_v9_4_init_gart_aperture_regs(struct amdgpu_device *adev, (u32)(adev->gmc.gart_end >> 44)); } +void mmhub_v9_4_setup_vm_pt_regs (struct amdgpu_device *adev,uint32_t vmid, +uint64_t page_table_base) +{ +int i; + +for (i =0 ; i <MMHUB_NUM_INSTANCES ; i++) +mmhub_v9_4_setup_hubid_vm_pt_regs (adev, i, vmid, + page_table_base); +} +static void mmhub_v9_4_init_system_aperture_regs (struct amdgpu_device *adev,int hubid) {
drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.h +2 -0
@@ -34,5 +34,7 @@ void mmhub_v9_4_init(struct amdgpu_device *adev);int mmhub_v9_4_set_clockgating (struct amdgpu_device *adev,enum amd_clockgating_state state);void mmhub_v9_4_get_clockgating (struct amdgpu_device *adev,u32 *flags); +void mmhub_v9_4_setup_vm_pt_regs (struct amdgpu_device *adev,uint32_t vmid, +uint64_t page_table_base);#endif
--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7C9608263c072740ab896f08d77801dda7%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637109821901425333&sdata=rGrPTRkX%2BPpKangWPjP9b3ku11Wn9Ehf8ugGzlt0vN4%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx