All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: "Christian König"
	<deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amdgpu: fix amdgpu_vm_clear_freed
Date: Thu, 20 Apr 2017 13:49:09 +0800	[thread overview]
Message-ID: <58F84BD5.5020208@amd.com> (raw)
In-Reply-To: <1492610826-1874-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>

On 04/19/2017 10:07 PM, Christian König wrote:
> From: Christian König <christian.koenig@amd.com>
>
> Use amdgpu_vm_bo_update_mapping() instead of amdgpu_vm_bo_split_mapping() here.
>
> We don't want any flags set in the cleared areas and splitting
> should be unnecessary.

Yeah, the mappings in the freed list are split already, I think.

>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 9017b51..27af436 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1631,8 +1631,9 @@ int amdgpu_vm_clear_freed(struct amdgpu_device *adev,
>   			struct amdgpu_bo_va_mapping, list);
>   		list_del(&mapping->list);
>
> -		r = amdgpu_vm_bo_split_mapping(adev, NULL, 0, NULL, vm, mapping,
> -					       0, 0, &f);
> +		r = amdgpu_vm_bo_update_mapping(adev, NULL, 0, NULL, vm,
> +						mapping->start, mapping->last,
> +						0, 0, &f);

We may also pass the offset for updating.
+		r = amdgpu_vm_bo_update_mapping(adev, NULL, 0, NULL, vm,
+						mapping->start, mapping->last,
+						0, mapping->offset, &f);

Jerry

>   		amdgpu_vm_free_mapping(adev, vm, mapping, f);
>   		if (r) {
>   			fence_put(f);
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-04-20  5:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 14:07 [PATCH] drm/amdgpu: fix amdgpu_vm_clear_freed Christian König
     [not found] ` <1492610826-1874-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-19 16:21   ` Deucher, Alexander
2017-04-20  5:49   ` Zhang, Jerry (Junwei) [this message]
     [not found]     ` <58F84BD5.5020208-5C7GfCeVMHo@public.gmane.org>
2017-04-20  6:12       ` Zhang, Jerry (Junwei)

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=58F84BD5.5020208@amd.com \
    --to=jerry.zhang-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.