aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-03-01 09:09:25 -0500
committerAlex Deucher <alexander.deucher@amd.com>2016-03-08 11:01:49 -0500
commit971fe9a9414b2ccabc11ff6a5ff6be0d6f2dabda (patch)
tree8d9bbb4983b34c39ead2deb849ce8a48cd9102cf /drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
parentcffadc83c7016ba68721affe5da537ead279e2d2 (diff)
drm/amdgpu: switch the GDS only on demand v2
Switching the GDS space to often seems to be problematic. This patch together with the following can avoid VM faults on context switch. v2: extend commit message a bit Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1) Reviewed-by: Chunming Zhou <david1.zhou@amd.com> (v1)
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
index e63e57e51db7..798d46626820 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
@@ -165,6 +165,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
165 165
166 if (ib->ctx != ctx || ib->vm != vm) { 166 if (ib->ctx != ctx || ib->vm != vm) {
167 ring->current_ctx = old_ctx; 167 ring->current_ctx = old_ctx;
168 if (ib->vm_id)
169 amdgpu_vm_reset_id(adev, ib->vm_id);
168 amdgpu_ring_undo(ring); 170 amdgpu_ring_undo(ring);
169 return -EINVAL; 171 return -EINVAL;
170 } 172 }
@@ -181,6 +183,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
181 if (r) { 183 if (r) {
182 dev_err(adev->dev, "failed to emit fence (%d)\n", r); 184 dev_err(adev->dev, "failed to emit fence (%d)\n", r);
183 ring->current_ctx = old_ctx; 185 ring->current_ctx = old_ctx;
186 if (ib->vm_id)
187 amdgpu_vm_reset_id(adev, ib->vm_id);
184 amdgpu_ring_undo(ring); 188 amdgpu_ring_undo(ring);
185 return r; 189 return r;
186 } 190 }