[PATCH] drm/amdgpu: simplify bo_va list when vm bo update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 at 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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux