[PATCH 2/4] drm/amdgpu: simplify VM shadow handling
zhoucm1
david1.zhou at amd.com
Thu Jun 1 02:19:41 UTC 2017
On 2017年05月31日 20:38, Christian König wrote:
> From: Christian König <christian.koenig at amd.com>
>
> Now that we don't join PTE updates any more we don't need to call
> the update function twice for this.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>
Reviewed-by: Chunming Zhou <david1.zhou at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 21 +++++++--------------
> 1 file changed, 7 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index b5e62bd..b56e24a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -77,8 +77,6 @@ struct amdgpu_pte_update_params {
> void (*func)(struct amdgpu_pte_update_params *params, uint64_t pe,
> uint64_t addr, unsigned count, uint32_t incr,
> uint64_t flags);
> - /* indicate update pt or its shadow */
> - bool shadow;
> };
>
> /* Helper to disable partial resident texture feature from a fence callback */
> @@ -1181,20 +1179,20 @@ static int amdgpu_vm_update_ptes(struct amdgpu_pte_update_params *params,
> return -EINVAL;
> }
>
> - if (params->shadow) {
> - if (!pt->shadow)
> - return 0;
> - pt = pt->shadow;
> - }
> -
> if ((addr & ~mask) == (end & ~mask))
> nptes = end - addr;
> else
> nptes = AMDGPU_VM_PTE_COUNT(adev) - (addr & mask);
>
> + if (pt->shadow) {
> + pe_start = amdgpu_bo_gpu_offset(pt->shadow);
> + pe_start += (addr & mask) * 8;
> + params->func(params, pe_start, dst, nptes,
> + AMDGPU_GPU_PAGE_SIZE, flags);
> + }
> +
> pe_start = amdgpu_bo_gpu_offset(pt);
> pe_start += (addr & mask) * 8;
> -
> params->func(params, pe_start, dst, nptes,
> AMDGPU_GPU_PAGE_SIZE, flags);
>
> @@ -1392,11 +1390,6 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
> if (r)
> goto error_free;
>
> - params.shadow = true;
> - r = amdgpu_vm_frag_ptes(¶ms, start, last + 1, addr, flags);
> - if (r)
> - goto error_free;
> - params.shadow = false;
> r = amdgpu_vm_frag_ptes(¶ms, start, last + 1, addr, flags);
> if (r)
> goto error_free;
More information about the amd-gfx
mailing list