AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: zhoucm1 <zhoucm1-5C7GfCeVMHo@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amdgpu: simplify bo_va list when vm bo update
Date: Thu, 19 Apr 2018 14:53:05 +0800	[thread overview]
Message-ID: <5AD83CD1.9090707@amd.com> (raw)
In-Reply-To: <5c9f7bf7-df86-4201-24f2-7adadef1f1c1-5C7GfCeVMHo@public.gmane.org>

On 04/19/2018 02:26 PM, zhoucm1 wrote:
>
>
> On 2018年04月19日 13:31, Junwei Zhang wrote:
>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 21 +++++++++------------
>>   1 file changed, 9 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> index 8c34060..93ad925 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> @@ -1561,19 +1561,16 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
>>       }
>>       spin_lock(&vm->status_lock);
>> -    if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) {
>> -        unsigned mem_type = bo->tbo.mem.mem_type;
>> +    list_del_init(&bo_va->base.vm_status);
>> -        /* If the BO is not in its preferred location add it back to
>> -         * the evicted list so that it gets validated again on the
>> -         * next command submission.
>> -         */
>> -        list_del_init(&bo_va->base.vm_status);
>> -        if (!(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type)))
>> -            list_add_tail(&bo_va->base.vm_status, &vm->evicted);
>> -    } else {
>> -        list_del_init(&bo_va->base.vm_status);
>> -    }
>> +    /* If the BO is not in its preferred location add it back to
>> +     * the evicted list so that it gets validated again on the
>> +     * next command submission.
>> +     */
>> +    unsigned mem_type = bo->tbo.mem.mem_type;
> Don't you get compiling warning for defining var between code?

Thanks to reminder that.
Fixed in v2.

Jerry

>
> Regards,
> David Zhou
>> +    if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv &&
>> +        !(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type)))
>> +        list_add_tail(&bo_va->base.vm_status, &vm->evicted);
>>       spin_unlock(&vm->status_lock);
>>       list_splice_init(&bo_va->invalids, &bo_va->valids);
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      parent reply	other threads:[~2018-04-19  6:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19  5:31 [PATCH] drm/amdgpu: simplify bo_va list when vm bo update Junwei Zhang
     [not found] ` <1524115892-22616-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
2018-04-19  6:26   ` zhoucm1
     [not found]     ` <5c9f7bf7-df86-4201-24f2-7adadef1f1c1-5C7GfCeVMHo@public.gmane.org>
2018-04-19  6:53       ` Zhang, Jerry (Junwei) [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=5AD83CD1.9090707@amd.com \
    --to=jerry.zhang-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=zhoucm1-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox