<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);">
Agree. That's much better actually.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Yong</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> Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Sent:</b> Monday, February 25, 2019 10:44 AM<br>
<b>To:</b> Zhao, Yong; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: Differentiate two set_pte_pde function pointers</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Am 21.02.19 um 23:58 schrieb Zhao, Yong:<br>
> There were two set_pte_pde function pointers in amdgpu_gmc_funcs and<br>
> amdgpu_vm_pte_funcs respectively. Because they are so similar, sometimes<br>
> it is confusing. So Rename the one in amdgpu_vm_pte_funcs to<br>
> write_pte_pde.<br>
<br>
NAK, we also already have a write_pte function. So this only increases <br>
the confusion.<br>
<br>
Instead we should rather just completely remove the gmc_*_set_pte_pde() <br>
functions because they actually do exactly the same on all generations.<br>
<br>
Christian.<br>
<br>
><br>
> Signed-off-by: Yong Zhao <Yong.Zhao@amd.com><br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 6 +++---<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 4 ++--<br>
> drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 6 +++---<br>
> drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 6 +++---<br>
> drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 6 +++---<br>
> drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 6 +++---<br>
> drivers/gpu/drm/amd/amdgpu/si_dma.c | 6 +++---<br>
> 7 files changed, 20 insertions(+), 20 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
> index 942b5ebc6dc2..fa86be694e48 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
> @@ -806,7 +806,7 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev,<br>
> if (level != AMDGPU_VM_PTB)<br>
> ats_value |= AMDGPU_PDE_PTE;<br>
> <br>
> - amdgpu_vm_set_pte_pde(adev, &job->ibs[0], addr, 0,<br>
> + amdgpu_vm_write_pte_pde(adev, &job->ibs[0], addr, 0,<br>
> ats_entries, 0, ats_value);<br>
> addr += ats_entries * 8;<br>
> }<br>
> @@ -818,7 +818,7 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev,<br>
> if (level == AMDGPU_VM_PTB && adev->asic_type >= CHIP_VEGA10)<br>
> value = AMDGPU_PTE_EXECUTABLE;<br>
> <br>
> - amdgpu_vm_set_pte_pde(adev, &job->ibs[0], addr, 0,<br>
> + amdgpu_vm_write_pte_pde(adev, &job->ibs[0], addr, 0,<br>
> entries, 0, value);<br>
> }<br>
> <br>
> @@ -1235,7 +1235,7 @@ static void amdgpu_vm_do_set_ptes(struct amdgpu_pte_update_params *params,<br>
> addr | flags, count, incr);<br>
> <br>
> } else {<br>
> - amdgpu_vm_set_pte_pde(params->adev, params->ib, pe, addr,<br>
> + amdgpu_vm_write_pte_pde(params->adev, params->ib, pe, addr,<br>
> count, incr, flags);<br>
> }<br>
> }<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h<br>
> index 81ff8177f092..7e345ec2671f 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h<br>
> @@ -161,7 +161,7 @@ struct amdgpu_vm_pte_funcs {<br>
> uint64_t value, unsigned count,<br>
> uint32_t incr);<br>
> /* for linear pte/pde updates without addr mapping */<br>
> - void (*set_pte_pde)(struct amdgpu_ib *ib,<br>
> + void (*write_pte_pde)(struct amdgpu_ib *ib,<br>
> uint64_t pe,<br>
> uint64_t addr, unsigned count,<br>
> uint32_t incr, uint64_t flags);<br>
> @@ -287,7 +287,7 @@ struct amdgpu_vm_manager {<br>
> <br>
> #define amdgpu_vm_copy_pte(adev, ib, pe, src, count) ((adev)->vm_manager.vm_pte_funcs->copy_pte((ib), (pe), (src), (count)))<br>
> #define amdgpu_vm_write_pte(adev, ib, pe, value, count, incr) ((adev)->vm_manager.vm_pte_funcs->write_pte((ib), (pe), (value), (count), (incr)))<br>
> -#define amdgpu_vm_set_pte_pde(adev, ib, pe, addr, count, incr, flags) ((adev)->vm_manager.vm_pte_funcs->set_pte_pde((ib), (pe), (addr), (count), (incr), (flags)))<br>
> +#define amdgpu_vm_write_pte_pde(adev, ib, pe, addr, count, incr, flags) ((adev)->vm_manager.vm_pte_funcs->write_pte_pde((ib), (pe), (addr), (count), (incr), (flags)))<br>
> <br>
> void amdgpu_vm_manager_init(struct amdgpu_device *adev);<br>
> void amdgpu_vm_manager_fini(struct amdgpu_device *adev);<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c<br>
> index 189599b694e8..07b874a44ddf 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c<br>
> @@ -769,7 +769,7 @@ static void cik_sdma_vm_write_pte(struct amdgpu_ib *ib, uint64_t pe,<br>
> }<br>
> <br>
> /**<br>
> - * cik_sdma_vm_set_pages - update the page tables using sDMA<br>
> + * cik_sdma_vm_write_pte_pde - update the page tables using sDMA<br>
> *<br>
> * @ib: indirect buffer to fill with commands<br>
> * @pe: addr of the page entry<br>
> @@ -780,7 +780,7 @@ static void cik_sdma_vm_write_pte(struct amdgpu_ib *ib, uint64_t pe,<br>
> *<br>
> * Update the page tables using sDMA (CIK).<br>
> */<br>
> -static void cik_sdma_vm_set_pte_pde(struct amdgpu_ib *ib, uint64_t pe,<br>
> +static void cik_sdma_vm_write_pte_pde(struct amdgpu_ib *ib, uint64_t pe,<br>
> uint64_t addr, unsigned count,<br>
> uint32_t incr, uint64_t flags)<br>
> {<br>
> @@ -1365,7 +1365,7 @@ static const struct amdgpu_vm_pte_funcs cik_sdma_vm_pte_funcs = {<br>
> .copy_pte = cik_sdma_vm_copy_pte,<br>
> <br>
> .write_pte = cik_sdma_vm_write_pte,<br>
> - .set_pte_pde = cik_sdma_vm_set_pte_pde,<br>
> + .write_pte_pde = cik_sdma_vm_write_pte_pde,<br>
> };<br>
> <br>
> static void cik_sdma_set_vm_pte_funcs(struct amdgpu_device *adev)<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c<br>
> index cca3552b36ed..3161871c1a57 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c<br>
> @@ -707,7 +707,7 @@ static void sdma_v2_4_vm_write_pte(struct amdgpu_ib *ib, uint64_t pe,<br>
> }<br>
> <br>
> /**<br>
> - * sdma_v2_4_vm_set_pte_pde - update the page tables using sDMA<br>
> + * sdma_v2_4_vm_write_pte_pde - update the page tables using sDMA<br>
> *<br>
> * @ib: indirect buffer to fill with commands<br>
> * @pe: addr of the page entry<br>
> @@ -718,7 +718,7 @@ static void sdma_v2_4_vm_write_pte(struct amdgpu_ib *ib, uint64_t pe,<br>
> *<br>
> * Update the page tables using sDMA (CIK).<br>
> */<br>
> -static void sdma_v2_4_vm_set_pte_pde(struct amdgpu_ib *ib, uint64_t pe,<br>
> +static void sdma_v2_4_vm_write_pte_pde(struct amdgpu_ib *ib, uint64_t pe,<br>
> uint64_t addr, unsigned count,<br>
> uint32_t incr, uint64_t flags)<br>
> {<br>
> @@ -1252,7 +1252,7 @@ static const struct amdgpu_vm_pte_funcs sdma_v2_4_vm_pte_funcs = {<br>
> .copy_pte = sdma_v2_4_vm_copy_pte,<br>
> <br>
> .write_pte = sdma_v2_4_vm_write_pte,<br>
> - .set_pte_pde = sdma_v2_4_vm_set_pte_pde,<br>
> + .write_pte_pde = sdma_v2_4_vm_write_pte_pde,<br>
> };<br>
> <br>
> static void sdma_v2_4_set_vm_pte_funcs(struct amdgpu_device *adev)<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c<br>
> index 0ce8331baeb2..e369013a6bce 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c<br>
> @@ -978,7 +978,7 @@ static void sdma_v3_0_vm_write_pte(struct amdgpu_ib *ib, uint64_t pe,<br>
> }<br>
> <br>
> /**<br>
> - * sdma_v3_0_vm_set_pte_pde - update the page tables using sDMA<br>
> + * sdma_v3_0_vm_write_pte_pde - update the page tables using sDMA<br>
> *<br>
> * @ib: indirect buffer to fill with commands<br>
> * @pe: addr of the page entry<br>
> @@ -989,7 +989,7 @@ static void sdma_v3_0_vm_write_pte(struct amdgpu_ib *ib, uint64_t pe,<br>
> *<br>
> * Update the page tables using sDMA (CIK).<br>
> */<br>
> -static void sdma_v3_0_vm_set_pte_pde(struct amdgpu_ib *ib, uint64_t pe,<br>
> +static void sdma_v3_0_vm_write_pte_pde(struct amdgpu_ib *ib, uint64_t pe,<br>
> uint64_t addr, unsigned count,<br>
> uint32_t incr, uint64_t flags)<br>
> {<br>
> @@ -1690,7 +1690,7 @@ static const struct amdgpu_vm_pte_funcs sdma_v3_0_vm_pte_funcs = {<br>
> .copy_pte = sdma_v3_0_vm_copy_pte,<br>
> <br>
> .write_pte = sdma_v3_0_vm_write_pte,<br>
> - .set_pte_pde = sdma_v3_0_vm_set_pte_pde,<br>
> + .write_pte_pde = sdma_v3_0_vm_write_pte_pde,<br>
> };<br>
> <br>
> static void sdma_v3_0_set_vm_pte_funcs(struct amdgpu_device *adev)<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c<br>
> index c816e55d43a9..e5e9eac1758d 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c<br>
> @@ -1343,7 +1343,7 @@ static void sdma_v4_0_vm_write_pte(struct amdgpu_ib *ib, uint64_t pe,<br>
> }<br>
> <br>
> /**<br>
> - * sdma_v4_0_vm_set_pte_pde - update the page tables using sDMA<br>
> + * sdma_v4_0_vm_write_pte_pde - update the page tables using sDMA<br>
> *<br>
> * @ib: indirect buffer to fill with commands<br>
> * @pe: addr of the page entry<br>
> @@ -1354,7 +1354,7 @@ static void sdma_v4_0_vm_write_pte(struct amdgpu_ib *ib, uint64_t pe,<br>
> *<br>
> * Update the page tables using sDMA (VEGA10).<br>
> */<br>
> -static void sdma_v4_0_vm_set_pte_pde(struct amdgpu_ib *ib,<br>
> +static void sdma_v4_0_vm_write_pte_pde(struct amdgpu_ib *ib,<br>
> uint64_t pe,<br>
> uint64_t addr, unsigned count,<br>
> uint32_t incr, uint64_t flags)<br>
> @@ -2088,7 +2088,7 @@ static const struct amdgpu_vm_pte_funcs sdma_v4_0_vm_pte_funcs = {<br>
> .copy_pte = sdma_v4_0_vm_copy_pte,<br>
> <br>
> .write_pte = sdma_v4_0_vm_write_pte,<br>
> - .set_pte_pde = sdma_v4_0_vm_set_pte_pde,<br>
> + .write_pte_pde = sdma_v4_0_vm_write_pte_pde,<br>
> };<br>
> <br>
> static void sdma_v4_0_set_vm_pte_funcs(struct amdgpu_device *adev)<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/si_dma.c b/drivers/gpu/drm/amd/amdgpu/si_dma.c<br>
> index f15f196684ba..4c1e1ce895f7 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/si_dma.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/si_dma.c<br>
> @@ -353,7 +353,7 @@ static void si_dma_vm_write_pte(struct amdgpu_ib *ib, uint64_t pe,<br>
> }<br>
> <br>
> /**<br>
> - * si_dma_vm_set_pte_pde - update the page tables using sDMA<br>
> + * si_dma_vm_write_pte_pde - update the page tables using sDMA<br>
> *<br>
> * @ib: indirect buffer to fill with commands<br>
> * @pe: addr of the page entry<br>
> @@ -364,7 +364,7 @@ static void si_dma_vm_write_pte(struct amdgpu_ib *ib, uint64_t pe,<br>
> *<br>
> * Update the page tables using sDMA (CIK).<br>
> */<br>
> -static void si_dma_vm_set_pte_pde(struct amdgpu_ib *ib,<br>
> +static void si_dma_vm_write_pte_pde(struct amdgpu_ib *ib,<br>
> uint64_t pe,<br>
> uint64_t addr, unsigned count,<br>
> uint32_t incr, uint64_t flags)<br>
> @@ -829,7 +829,7 @@ static const struct amdgpu_vm_pte_funcs si_dma_vm_pte_funcs = {<br>
> .copy_pte = si_dma_vm_copy_pte,<br>
> <br>
> .write_pte = si_dma_vm_write_pte,<br>
> - .set_pte_pde = si_dma_vm_set_pte_pde,<br>
> + .write_pte_pde = si_dma_vm_write_pte_pde,<br>
> };<br>
> <br>
> static void si_dma_set_vm_pte_funcs(struct amdgpu_device *adev)<br>
<br>
</div>
</span></font></div>
</body>
</html>