drm/amdgpu: move setting the GART addr into TTM
authorChristian König <christian.koenig@amd.com>
Tue, 21 Aug 2018 14:47:01 +0000 (16:47 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 27 Aug 2018 16:11:18 +0000 (11:11 -0500)
Move setting the GART addr for window based copies into the TTM code who
uses it.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

index 265ff90f4e01a19dd2aa6a915c778255038ea7db..facc0f08d804437adb284f74cc5cb22d6a97c979 100644 (file)
@@ -83,8 +83,6 @@ int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev, unsigned size,
        r = amdgpu_ib_get(adev, NULL, size, &(*job)->ibs[0]);
        if (r)
                kfree(*job);
-       else
-               (*job)->vm_pd_addr = adev->gart.table_addr;
 
        return r;
 }
index c6611cff64c8a9d2a26b8310092d25ce8c890a09..b4333f60ed8be0f3bc09ac05285e66bcbb61c690 100644 (file)
@@ -2048,7 +2048,10 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset,
        if (r)
                return r;
 
-       job->vm_needs_flush = vm_needs_flush;
+       if (vm_needs_flush) {
+               job->vm_pd_addr = adev->gart.table_addr;
+               job->vm_needs_flush = true;
+       }
        if (resv) {
                r = amdgpu_sync_resv(adev, &job->sync, resv,
                                     AMDGPU_FENCE_OWNER_UNDEFINED,