[PATCH] drm/amdgpu: simplify the bo reference on amdgpu_vo_update

Christian König ckoenig.leichtzumerken at gmail.com
Wed Jul 4 10:43:12 UTC 2018


Am 04.07.2018 um 12:16 schrieb Huang Rui:
> BO ptr already be initialized at definition, we needn't use the complicated
> reference.
>
> Signed-off-by: Huang Rui <ray.huang at amd.com>

There is a typo in the subject line, with that fixed the patch is 
Reviewed-by: Christian König <christian.koenig at amd.com>.

Regards,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 712af5c..b53562b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1645,18 +1645,17 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
>   	uint64_t flags;
>   	int r;
>   
> -	if (clear || !bo_va->base.bo) {
> +	if (clear || !bo) {
>   		mem = NULL;
>   		nodes = NULL;
>   		exclusive = NULL;
>   	} else {
>   		struct ttm_dma_tt *ttm;
>   
> -		mem = &bo_va->base.bo->tbo.mem;
> +		mem = &bo->tbo.mem;
>   		nodes = mem->mm_node;
>   		if (mem->mem_type == TTM_PL_TT) {
> -			ttm = container_of(bo_va->base.bo->tbo.ttm,
> -					   struct ttm_dma_tt, ttm);
> +			ttm = container_of(bo->tbo.ttm, struct ttm_dma_tt, ttm);
>   			pages_addr = ttm->dma_address;
>   		}
>   		exclusive = reservation_object_get_excl(bo->tbo.resv);



More information about the amd-gfx mailing list