<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Kuehling, Felix <Felix.Kuehling@amd.com><br>
<b>Sent:</b> Thursday, September 26, 2019 6:26 PM<br>
<b>To:</b> Zhao, Yong <Yong.Zhao@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Subject:</b> Re: [PATCH 1/3] drm/amdgpu: Export setup_vm_pt_regs() logic for gfxhub 2.0</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">For GFXv9 you made an equivalent change for both GFXHub and MMHub
<br>
("drm/amdgpu: Expose *_setup_vm_pt_regs for kfd to use"). Your GFXv9 <br>
commit was also reviewed by Alex and Christian. You should get at least <br>
one of them to Ack or Review this change.<br>
<br>
For GFXv10 you're only changing the GFXHub. I suspect that's because KFD <br>
doesn't care about MMHub on GFXv10. That's fine with me.<br>
<br>
You can add<br>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com><br>
<br>
Thanks,<br>
Felix<br>
<br>
On 2019-09-25 2:15 p.m., Zhao, Yong wrote:<br>
> The KFD code will call this function later.<br>
><br>
> Change-Id: I88a53368cdee719b2c75393e5cdbd8290584548e<br>
> Signed-off-by: Yong Zhao <Yong.Zhao@amd.com><br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c | 20 ++++++++++++--------<br>
> drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.h | 2 ++<br>
> 2 files changed, 14 insertions(+), 8 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c<br>
> index a9238735d361..b601c6740ef5 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c<br>
> @@ -46,21 +46,25 @@ u64 gfxhub_v2_0_get_mc_fb_offset(struct amdgpu_device *adev)<br>
> return (u64)RREG32_SOC15(GC, 0, mmGCMC_VM_FB_OFFSET) << 24;<br>
> }<br>
> <br>
> -static void gfxhub_v2_0_init_gart_pt_regs(struct amdgpu_device *adev)<br>
> +void gfxhub_v2_0_setup_vm_pt_regs(struct amdgpu_device *adev, uint32_t vmid,<br>
> + uint64_t page_table_base)<br>
> {<br>
> - uint64_t value = amdgpu_gmc_pd_addr(adev->gart.bo);<br>
> + /* two registers distance between mmGCVM_CONTEXT0_* to mmGCVM_CONTEXT1_* */<br>
> + int offset = mmGCVM_CONTEXT1_PAGE_TABLE_BASE_ADDR_LO32<br>
> + - mmGCVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32;<br>
> <br>
> + WREG32_SOC15_OFFSET(GC, 0, mmGCVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32,<br>
> + offset * vmid, lower_32_bits(page_table_base));<br>
> <br>
> - WREG32_SOC15(GC, 0, mmGCVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32,<br>
> - lower_32_bits(value));<br>
> -<br>
> - WREG32_SOC15(GC, 0, mmGCVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32,<br>
> - upper_32_bits(value));<br>
> + WREG32_SOC15_OFFSET(GC, 0, mmGCVM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32,<br>
> + offset * vmid, upper_32_bits(page_table_base));<br>
> }<br>
> <br>
> static void gfxhub_v2_0_init_gart_aperture_regs(struct amdgpu_device *adev)<br>
> {<br>
> - gfxhub_v2_0_init_gart_pt_regs(adev);<br>
> + uint64_t pt_base = amdgpu_gmc_pd_addr(adev->gart.bo);<br>
> +<br>
> + gfxhub_v2_0_setup_vm_pt_regs(adev, 0, pt_base);<br>
> <br>
> WREG32_SOC15(GC, 0, mmGCVM_CONTEXT0_PAGE_TABLE_START_ADDR_LO32,<br>
> (u32)(adev->gmc.gart_start >> 12));<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.h b/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.h<br>
> index 06807940748b..392b8cd94fc0 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.h<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.h<br>
> @@ -31,5 +31,7 @@ void gfxhub_v2_0_set_fault_enable_default(struct amdgpu_device *adev,<br>
> bool value);<br>
> void gfxhub_v2_0_init(struct amdgpu_device *adev);<br>
> u64 gfxhub_v2_0_get_mc_fb_offset(struct amdgpu_device *adev);<br>
> +void gfxhub_v2_0_setup_vm_pt_regs(struct amdgpu_device *adev, uint32_t vmid,<br>
> + uint64_t page_table_base);<br>
> <br>
> #endif<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></div>
</span></font></div>
</body>
</html>