From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: Felix Kuehling <Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: kent.russell-5C7GfCeVMHo@public.gmane.org
Subject: Re: [PATCH 1/1] drm/amdgpu: Fix compute VM BO params after rebase
Date: Thu, 6 Sep 2018 09:48:50 +0800 [thread overview]
Message-ID: <5B908782.8030301@amd.com> (raw)
In-Reply-To: <1536193713-4016-1-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
On 09/06/2018 08:28 AM, Felix Kuehling wrote:
> The intent of two commits was lost in the last rebase:
>
> 810955b drm/amdgpu: Fix acquiring VM on large-BAR systems
> b5d21aa drm/amdgpu: Don't use shadow BO for compute context
>
> This commit restores the original behaviour:
> * Don't set AMDGPU_GEM_CREATE_NO_CPU_ACCESS for page directories
> to allow them to be reused for compute VMs
> * Don't create shadow BOs for page tables in compute VMs
>
> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Personally making no_shadow -> shadow looks more simple.
anyway, that patches restoring what it's missing.
Acked-by: Junwei Zhang <Jerry.Zhang@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index ea5e277..5e7a3de 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -577,10 +577,13 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev,
> *
> * @adev: amdgpu_device pointer
> * @vm: requesting vm
> + * @level: level in the page table hierarchy
> + * @no_shadow: disable creation of shadow BO for this VM
> * @bp: resulting BO allocation parameters
> */
> static void amdgpu_vm_bo_param(struct amdgpu_device *adev, struct amdgpu_vm *vm,
> - int level, struct amdgpu_bo_param *bp)
> + int level, bool no_shadow,
> + struct amdgpu_bo_param *bp)
> {
> memset(bp, 0, sizeof(*bp));
>
> @@ -595,9 +598,8 @@ static void amdgpu_vm_bo_param(struct amdgpu_device *adev, struct amdgpu_vm *vm,
> AMDGPU_GEM_CREATE_CPU_GTT_USWC;
> if (vm->use_cpu_for_update)
> bp->flags |= AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED;
> - else
> - bp->flags |= AMDGPU_GEM_CREATE_SHADOW |
> - AMDGPU_GEM_CREATE_NO_CPU_ACCESS;
> + else if (!no_shadow)
> + bp->flags |= AMDGPU_GEM_CREATE_SHADOW;
> bp->type = ttm_bo_type_kernel;
> if (vm->root.base.bo)
> bp->resv = vm->root.base.bo->tbo.resv;
> @@ -626,6 +628,7 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev,
> unsigned level, bool ats)
> {
> unsigned shift = amdgpu_vm_level_shift(adev, level);
> + bool no_shadow = !vm->root.base.bo->shadow;
> struct amdgpu_bo_param bp;
> unsigned pt_idx, from, to;
> int r;
> @@ -650,7 +653,7 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev,
> saddr = saddr & ((1 << shift) - 1);
> eaddr = eaddr & ((1 << shift) - 1);
>
> - amdgpu_vm_bo_param(adev, vm, level, &bp);
> + amdgpu_vm_bo_param(adev, vm, level, no_shadow, &bp);
>
> /* walk over the address space and allocate the page tables */
> for (pt_idx = from; pt_idx <= to; ++pt_idx) {
> @@ -2709,6 +2712,7 @@ void amdgpu_vm_adjust_size(struct amdgpu_device *adev, uint32_t min_vm_size,
> int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
> int vm_context, unsigned int pasid)
> {
> + bool no_shadow = (vm_context == AMDGPU_VM_CONTEXT_COMPUTE);
> struct amdgpu_bo_param bp;
> struct amdgpu_bo *root;
> int r, i;
> @@ -2748,7 +2752,8 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
> "CPU update of VM recommended only for large BAR system\n");
> vm->last_update = NULL;
>
> - amdgpu_vm_bo_param(adev, vm, adev->vm_manager.root_level, &bp);
> + amdgpu_vm_bo_param(adev, vm, adev->vm_manager.root_level, no_shadow,
> + &bp);
> r = amdgpu_bo_create(adev, &bp, &root);
> if (r)
> goto error_free_sched_entity;
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2018-09-06 1:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-06 0:28 [PATCH 1/1] drm/amdgpu: Fix compute VM BO params after rebase Felix Kuehling
[not found] ` <1536193713-4016-1-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
2018-09-06 1:48 ` Zhang, Jerry (Junwei) [this message]
2018-09-06 2:08 ` zhoucm1
2018-09-06 7:35 ` Christian König
[not found] ` <924d44b9-379e-42dd-b280-c3d52794d7ef-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-09-06 11:46 ` Russell, Kent
[not found] ` <BN6PR12MB1618872F1E93ED8AF37E7E8785010-/b2+HYfkarRqaFUXYJa4HgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-09-06 11:54 ` Christian König
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=5B908782.8030301@amd.com \
--to=jerry.zhang-5c7gfcevmho@public.gmane.org \
--cc=Felix.Kuehling-5C7GfCeVMHo@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=kent.russell-5C7GfCeVMHo@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.