diff options
| author | Christian König <[email protected]> | 2016-03-01 14:09:25 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2016-03-08 16:01:49 +0000 |
| commit | 971fe9a9414b2ccabc11ff6a5ff6be0d6f2dabda (patch) | |
| tree | 8d9bbb4983b34c39ead2deb849ce8a48cd9102cf /drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | |
| parent | drm/amdgpu: move the GDS switch into vm flush as well (diff) | |
| download | kernel-971fe9a9414b2ccabc11ff6a5ff6be0d6f2dabda.tar.gz kernel-971fe9a9414b2ccabc11ff6a5ff6be0d6f2dabda.zip | |
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 <[email protected]>
Reviewed-by: Alex Deucher <[email protected]> (v1)
Reviewed-by: Chunming Zhou <[email protected]> (v1)
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 4 |
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, if (ib->ctx != ctx || ib->vm != vm) { ring->current_ctx = old_ctx; + if (ib->vm_id) + amdgpu_vm_reset_id(adev, ib->vm_id); amdgpu_ring_undo(ring); return -EINVAL; } @@ -181,6 +183,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, if (r) { dev_err(adev->dev, "failed to emit fence (%d)\n", r); ring->current_ctx = old_ctx; + if (ib->vm_id) + amdgpu_vm_reset_id(adev, ib->vm_id); amdgpu_ring_undo(ring); return r; } |
