Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: remove sorting of CS BOs

Not needed any more.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Christian König and committed by
Alex Deucher
b76af4a4 29b3259a

-23
-23
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
··· 24 24 * Authors: 25 25 * Jerome Glisse <glisse@freedesktop.org> 26 26 */ 27 - #include <linux/list_sort.h> 28 27 #include <linux/pagemap.h> 29 28 #include <drm/drmP.h> 30 29 #include <drm/amdgpu_drm.h> ··· 526 527 return 0; 527 528 } 528 529 529 - static int cmp_size_smaller_first(void *priv, struct list_head *a, 530 - struct list_head *b) 531 - { 532 - struct amdgpu_bo_list_entry *la = list_entry(a, struct amdgpu_bo_list_entry, tv.head); 533 - struct amdgpu_bo_list_entry *lb = list_entry(b, struct amdgpu_bo_list_entry, tv.head); 534 - 535 - /* Sort A before B if A is smaller. */ 536 - return (int)la->robj->tbo.num_pages - (int)lb->robj->tbo.num_pages; 537 - } 538 - 539 530 /** 540 531 * cs_parser_fini() - clean parser states 541 532 * @parser: parser structure holding parsing context. ··· 541 552 542 553 if (!error) { 543 554 amdgpu_vm_move_pt_bos_in_lru(parser->adev, &fpriv->vm); 544 - 545 - /* Sort the buffer list from the smallest to largest buffer, 546 - * which affects the order of buffers in the LRU list. 547 - * This assures that the smallest buffers are added first 548 - * to the LRU list, so they are likely to be later evicted 549 - * first, instead of large buffers whose eviction is more 550 - * expensive. 551 - * 552 - * This slightly lowers the number of bytes moved by TTM 553 - * per frame under memory pressure. 554 - */ 555 - list_sort(NULL, &parser->validated, cmp_size_smaller_first); 556 555 557 556 ttm_eu_fence_buffer_objects(&parser->ticket, 558 557 &parser->validated,