aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index ce0254d4dcd7..1fffc338f69d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -428,8 +428,10 @@ static int amdgpu_cs_parser_relocs(struct amdgpu_cs_parser *p)
428 r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &duplicates); 428 r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &duplicates);
429 429
430error_validate: 430error_validate:
431 if (r) 431 if (r) {
432 amdgpu_vm_move_pt_bos_in_lru(p->adev, &fpriv->vm);
432 ttm_eu_backoff_reservation(&p->ticket, &p->validated); 433 ttm_eu_backoff_reservation(&p->ticket, &p->validated);
434 }
433 435
434error_reserve: 436error_reserve:
435 if (need_mmap_lock) 437 if (need_mmap_lock)
@@ -473,8 +475,11 @@ static int cmp_size_smaller_first(void *priv, struct list_head *a,
473 **/ 475 **/
474static void amdgpu_cs_parser_fini(struct amdgpu_cs_parser *parser, int error, bool backoff) 476static void amdgpu_cs_parser_fini(struct amdgpu_cs_parser *parser, int error, bool backoff)
475{ 477{
478 struct amdgpu_fpriv *fpriv = parser->filp->driver_priv;
476 unsigned i; 479 unsigned i;
477 480
481 amdgpu_vm_move_pt_bos_in_lru(parser->adev, &fpriv->vm);
482
478 if (!error) { 483 if (!error) {
479 /* Sort the buffer list from the smallest to largest buffer, 484 /* Sort the buffer list from the smallest to largest buffer,
480 * which affects the order of buffers in the LRU list. 485 * which affects the order of buffers in the LRU list.