aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2018-08-30 04:04:53 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-09-02 11:16:38 -0400
commitb995795bf09b6bb7847a2a9fc8e6b5b4ab0ce20c (patch)
treeb21c36f5b40bc110fc61e6b5403168ef8f2d841e
parent972a21f94631642d6714bb2a1983b7b15a77526d (diff)
drm/amdgpu: fix "use bulk moves for efficient VM LRU handling" v2
First step to fix the LRU corruption, we accidentially tried to move things on the LRU after dropping the lock. Signed-off-by: Christian König <christian.koenig@amd.com> Tested-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index dd734970e167..349dcc37ee64 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1237,6 +1237,8 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
1237 ring = to_amdgpu_ring(entity->rq->sched); 1237 ring = to_amdgpu_ring(entity->rq->sched);
1238 amdgpu_ring_priority_get(ring, priority); 1238 amdgpu_ring_priority_get(ring, priority);
1239 1239
1240 amdgpu_vm_move_to_lru_tail(p->adev, &fpriv->vm);
1241
1240 ttm_eu_fence_buffer_objects(&p->ticket, &p->validated, p->fence); 1242 ttm_eu_fence_buffer_objects(&p->ticket, &p->validated, p->fence);
1241 amdgpu_mn_unlock(p->mn); 1243 amdgpu_mn_unlock(p->mn);
1242 1244
@@ -1258,7 +1260,6 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
1258 union drm_amdgpu_cs *cs = data; 1260 union drm_amdgpu_cs *cs = data;
1259 struct amdgpu_cs_parser parser = {}; 1261 struct amdgpu_cs_parser parser = {};
1260 bool reserved_buffers = false; 1262 bool reserved_buffers = false;
1261 struct amdgpu_fpriv *fpriv;
1262 int i, r; 1263 int i, r;
1263 1264
1264 if (!adev->accel_working) 1265 if (!adev->accel_working)
@@ -1303,8 +1304,6 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
1303 1304
1304 r = amdgpu_cs_submit(&parser, cs); 1305 r = amdgpu_cs_submit(&parser, cs);
1305 1306
1306 fpriv = filp->driver_priv;
1307 amdgpu_vm_move_to_lru_tail(adev, &fpriv->vm);
1308out: 1307out:
1309 amdgpu_cs_parser_fini(&parser, r, reserved_buffers); 1308 amdgpu_cs_parser_fini(&parser, r, reserved_buffers);
1310 return r; 1309 return r;