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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: use TTM_NUM_MOVE_FENCES when reserving fences

Use TTM_NUM_MOVE_FENCES as an upperbound of how many fences
ttm might need to deal with moves/evictions.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Felix Kuehling <felix.kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Pierre-Eric Pelloux-Prayer and committed by
Alex Deucher
6ab4054f e2b0c863

+9 -17
+2 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
··· 908 908 goto out_free_user_pages; 909 909 910 910 amdgpu_bo_list_for_each_entry(e, p->bo_list) { 911 - /* One fence for TTM and one for each CS job */ 912 911 r = drm_exec_prepare_obj(&p->exec, &e->bo->tbo.base, 913 - 1 + p->gang_size); 912 + TTM_NUM_MOVE_FENCES + p->gang_size); 914 913 drm_exec_retry_on_contention(&p->exec); 915 914 if (unlikely(r)) 916 915 goto out_free_user_pages; ··· 919 920 920 921 if (p->uf_bo) { 921 922 r = drm_exec_prepare_obj(&p->exec, &p->uf_bo->tbo.base, 922 - 1 + p->gang_size); 923 + TTM_NUM_MOVE_FENCES + p->gang_size); 923 924 drm_exec_retry_on_contention(&p->exec); 924 925 if (unlikely(r)) 925 926 goto out_free_user_pages;
+2 -4
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
··· 328 328 return r; 329 329 } 330 330 331 - r = dma_resv_reserve_fences(rbo->tbo.base.resv, 1); 332 - if (r) { 333 - dev_err(adev->dev, "allocating fence slot failed (%d)\n", r); 331 + r = dma_resv_reserve_fences(rbo->tbo.base.resv, TTM_NUM_MOVE_FENCES); 332 + if (r) 334 333 goto error_unlock; 335 - } 336 334 337 335 if (plane->type != DRM_PLANE_TYPE_CURSOR) 338 336 domain = amdgpu_display_supported_domains(adev, rbo->flags);
+1 -2
drivers/gpu/drm/amd/amdkfd/kfd_svm.c
··· 628 628 } 629 629 } 630 630 631 - r = dma_resv_reserve_fences(bo->tbo.base.resv, 1); 631 + r = dma_resv_reserve_fences(bo->tbo.base.resv, TTM_NUM_MOVE_FENCES); 632 632 if (r) { 633 - pr_debug("failed %d to reserve bo\n", r); 634 633 amdgpu_bo_unreserve(bo); 635 634 goto reserve_bo_failed; 636 635 }
+2 -4
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
··· 954 954 return r; 955 955 } 956 956 957 - r = dma_resv_reserve_fences(rbo->tbo.base.resv, 1); 958 - if (r) { 959 - drm_err(adev_to_drm(adev), "reserving fence slot failed (%d)\n", r); 957 + r = dma_resv_reserve_fences(rbo->tbo.base.resv, TTM_NUM_MOVE_FENCES); 958 + if (r) 960 959 goto error_unlock; 961 - } 962 960 963 961 if (plane->type != DRM_PLANE_TYPE_CURSOR) 964 962 domain = amdgpu_display_supported_domains(adev, rbo->flags);
+2 -4
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_wb.c
··· 106 106 return r; 107 107 } 108 108 109 - r = dma_resv_reserve_fences(rbo->tbo.base.resv, 1); 110 - if (r) { 111 - drm_err(adev_to_drm(adev), "reserving fence slot failed (%d)\n", r); 109 + r = dma_resv_reserve_fences(rbo->tbo.base.resv, TTM_NUM_MOVE_FENCES); 110 + if (r) 112 111 goto error_unlock; 113 - } 114 112 115 113 domain = amdgpu_display_supported_domains(adev, rbo->flags); 116 114