diff options
author | Christian König <christian.koenig@amd.com> | 2016-01-11 09:35:21 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-01-13 12:22:17 -0500 |
commit | eceb8a1562db6fc3e1c21cd54a4be0189aa1d0e3 (patch) | |
tree | 0e0e73dfc9bf8c20c6c81d5b765d92d94e57c76b /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |
parent | ab74961810ba7935b5f9643da10daaa36690f48e (diff) |
drm/amdgpu: move VM page tables to the LRU end on CS v2
This makes it less likely to run into an ENOMEM because
VM page tables are evicted last.
v2: move the BOs in the LRU tail after validation
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 7 |
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 | ||
430 | error_validate: | 430 | error_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 | ||
434 | error_reserve: | 436 | error_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 | **/ |
474 | static void amdgpu_cs_parser_fini(struct amdgpu_cs_parser *parser, int error, bool backoff) | 476 | static 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. |