aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Rui <ray.huang@amd.com>2018-07-04 06:08:54 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-07-18 17:18:44 -0400
commit7eb80427746175530f03a00ad5281c4222f17238 (patch)
tree3103b5d965ef9705066d0835c097115cad1c7cef
parentf3cdadb6fee9287d81d2dacd830bd5b439cb7331 (diff)
drm/amdgpu: simplify the bo reference on amdgpu_bo_update
BO ptr already be initialized at definition, we needn't use the complicated reference. v2: fix typo at subject line Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c7
1 files 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 5d3d783f2d72..098dd1ba751a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1646,18 +1646,17 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
1646 uint64_t flags; 1646 uint64_t flags;
1647 int r; 1647 int r;
1648 1648
1649 if (clear || !bo_va->base.bo) { 1649 if (clear || !bo) {
1650 mem = NULL; 1650 mem = NULL;
1651 nodes = NULL; 1651 nodes = NULL;
1652 exclusive = NULL; 1652 exclusive = NULL;
1653 } else { 1653 } else {
1654 struct ttm_dma_tt *ttm; 1654 struct ttm_dma_tt *ttm;
1655 1655
1656 mem = &bo_va->base.bo->tbo.mem; 1656 mem = &bo->tbo.mem;
1657 nodes = mem->mm_node; 1657 nodes = mem->mm_node;
1658 if (mem->mem_type == TTM_PL_TT) { 1658 if (mem->mem_type == TTM_PL_TT) {
1659 ttm = container_of(bo_va->base.bo->tbo.ttm, 1659 ttm = container_of(bo->tbo.ttm, struct ttm_dma_tt, ttm);
1660 struct ttm_dma_tt, ttm);
1661 pages_addr = ttm->dma_address; 1660 pages_addr = ttm->dma_address;
1662 } 1661 }
1663 exclusive = reservation_object_get_excl(bo->tbo.resv); 1662 exclusive = reservation_object_get_excl(bo->tbo.resv);