All of lore.kernel.org
 help / color / mirror / Atom feed
From: zhoucm1 <david1.zhou-5C7GfCeVMHo@public.gmane.org>
To: "Christian König"
	<deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 2/4] drm/amdgpu: simplify VM shadow handling
Date: Thu, 1 Jun 2017 10:19:41 +0800	[thread overview]
Message-ID: <592F79BD.8020801@amd.com> (raw)
In-Reply-To: <1496234326-2581-2-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>



On 2017年05月31日 20:38, Christian König wrote:
> From: Christian König <christian.koenig@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@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@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(&params, start, last + 1, addr, flags);
> -	if (r)
> -		goto error_free;
> -	params.shadow = false;
>   	r = amdgpu_vm_frag_ptes(&params, start, last + 1, addr, flags);
>   	if (r)
>   		goto error_free;

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-06-01  2:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-31 12:38 [PATCH 1/4] drm/amdgpu: further cleanup amdgpu_vm_need_pipeline_sync Christian König
     [not found] ` <1496234326-2581-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-05-31 12:38   ` [PATCH 2/4] drm/amdgpu: simplify VM shadow handling Christian König
     [not found]     ` <1496234326-2581-2-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-06-01  2:19       ` zhoucm1 [this message]
2017-05-31 12:38   ` [PATCH 3/4] drm/amdgpu: increase fragmentation size for Vega10 Christian König
     [not found]     ` <1496234326-2581-3-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-06-01  3:04       ` zhoucm1
2017-05-31 12:38   ` [PATCH 4/4] drm/amdgpu: enable huge page handling in the VM v3 Christian König
     [not found]     ` <1496234326-2581-4-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-06-01  3:06       ` zhoucm1

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=592F79BD.8020801@amd.com \
    --to=david1.zhou-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.