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 1/3] drm/amdgpu: track if a PD needs an update
Date: Fri, 14 Jul 2017 10:13:16 +0800 [thread overview]
Message-ID: <596828BC.4040104@amd.com> (raw)
In-Reply-To: <1499952313-2398-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
'if (parent->entries[pt_idx].addr == pt)' is good enough for condition
of need_update, adding previous Felix's optimization patch, then the
whole picture looks better than this one, IIRC.
Regards,
David Zhou
On 2017年07月13日 21:25, Christian König wrote:
> From: Christian König <christian.koenig@amd.com>
>
> That should reduce our command submission overhead quite a bit.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 ++++++-
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 1 +
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 55d1c7f..3f5863e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -173,6 +173,7 @@ static int amdgpu_vm_validate_level(struct amdgpu_vm_pt *parent,
> if (!parent->entries)
> return 0;
>
> + parent->needs_update = true;
> for (i = 0; i <= parent->last_entry_used; ++i) {
> struct amdgpu_vm_pt *entry = &parent->entries[i];
>
> @@ -351,6 +352,7 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev,
>
> entry->bo = pt;
> entry->addr = 0;
> + parent->needs_update = true;
> }
>
> if (level < adev->vm_manager.num_level) {
> @@ -361,6 +363,8 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev,
> sub_eaddr, level);
> if (r)
> return r;
> +
> + parent->needs_update |= entry->needs_update;
> }
> }
>
> @@ -1050,7 +1054,7 @@ static int amdgpu_vm_update_level(struct amdgpu_device *adev,
>
> int r;
>
> - if (!parent->entries)
> + if (!parent->entries || !parent->needs_update)
> return 0;
>
> memset(¶ms, 0, sizeof(params));
> @@ -1196,6 +1200,7 @@ static int amdgpu_vm_update_level(struct amdgpu_device *adev,
> return r;
> }
>
> + parent->needs_update = false;
> return 0;
>
> error_free:
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> index 3441ec5..c3dfd3e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> @@ -102,6 +102,7 @@ struct amdgpu_vm_pt {
> /* array of page tables, one for each directory entry */
> struct amdgpu_vm_pt *entries;
> unsigned last_entry_used;
> + bool needs_update;
> };
>
> struct amdgpu_vm {
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
prev parent reply other threads:[~2017-07-14 2:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-13 13:25 [PATCH 1/3] drm/amdgpu: track if a PD needs an update Christian König
[not found] ` <1499952313-2398-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-07-13 13:25 ` [PATCH 2/3] drm/amdgpu: only move VM BOs in the LRU during validation Christian König
[not found] ` <1499952313-2398-2-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-07-13 16:01 ` Felix Kuehling
2017-07-13 13:25 ` [PATCH 3/3] drm/amdgpu: only bind VM shadows after validation Christian König
[not found] ` <1499952313-2398-3-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-07-13 15:56 ` Felix Kuehling
2017-07-13 15:57 ` [PATCH 1/3] drm/amdgpu: track if a PD needs an update Felix Kuehling
2017-07-14 2:13 ` zhoucm1 [this message]
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=596828BC.4040104@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.