drm/amdgpu: allow flushing VMID0 before IB execution as well
authorChristian König <christian.koenig@amd.com>
Wed, 28 Jun 2017 13:41:17 +0000 (15:41 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jul 2017 15:05:57 +0000 (11:05 -0400)
This allows us to queue IBs which needs an up to date system domain as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c

index f774b3f497d28735829d9b6407cd1832e9174945..1b30d2ab9c51c2a2b34a7ff0cbdb735212700a3f 100644 (file)
@@ -172,7 +172,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
        if (ring->funcs->insert_start)
                ring->funcs->insert_start(ring);
 
-       if (vm) {
+       if (job) {
                r = amdgpu_vm_flush(ring, job);
                if (r) {
                        amdgpu_ring_undo(ring);
index 3d641e10e6b65c728ddda00be6027d7fe42cc461..4510627ae83e9b57e19dccfe19f260da00f918f2 100644 (file)
@@ -81,6 +81,8 @@ 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;
 }