aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-02-26 10:18:26 -0500
committerAlex Deucher <alexander.deucher@amd.com>2016-02-29 11:33:46 -0500
commit4ff37a83f19dab4e67299325ee22e98346eee857 (patch)
treea8778a8fb2140caebf7cf8f2fd080e9828606c90 /drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
parentce22c4bfdf70c03e9308751df5c2bf78b79a893f (diff)
drm/amdgpu: fix VM faults caused by vm_grab_id() v4
The owner must be per ring as long as we don't support sharing VMIDs per process. Also move the assigned VMID and page directory address into the IB structure. v3: assign the VMID to all IBs, not just the first one. v4: use correct pointer for owner Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_job.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_job.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index f29bbb96a881..90e52f7e17a0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -105,16 +105,23 @@ static struct fence *amdgpu_job_dependency(struct amd_sched_job *sched_job)
105 105
106 struct fence *fence = amdgpu_sync_get_fence(&job->sync); 106 struct fence *fence = amdgpu_sync_get_fence(&job->sync);
107 107
108 if (fence == NULL && vm && !job->ibs->grabbed_vmid) { 108 if (fence == NULL && vm && !job->ibs->vm_id) {
109 struct amdgpu_ring *ring = job->ring; 109 struct amdgpu_ring *ring = job->ring;
110 unsigned i, vm_id;
111 uint64_t vm_pd_addr;
110 int r; 112 int r;
111 113
112 r = amdgpu_vm_grab_id(vm, ring, &job->sync, 114 r = amdgpu_vm_grab_id(vm, ring, &job->sync,
113 &job->base.s_fence->base); 115 &job->base.s_fence->base,
116 &vm_id, &vm_pd_addr);
114 if (r) 117 if (r)
115 DRM_ERROR("Error getting VM ID (%d)\n", r); 118 DRM_ERROR("Error getting VM ID (%d)\n", r);
116 else 119 else {
117 job->ibs->grabbed_vmid = true; 120 for (i = 0; i < job->num_ibs; ++i) {
121 job->ibs[i].vm_id = vm_id;
122 job->ibs[i].vm_pd_addr = vm_pd_addr;
123 }
124 }
118 125
119 fence = amdgpu_sync_get_fence(&job->sync); 126 fence = amdgpu_sync_get_fence(&job->sync);
120 } 127 }