mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
drm/amdgpu: fix number of fence calculations
[ Upstream commit570b295248] Since adding gang submit we need to take the gang size into account while reserving fences. Signed-off-by: Christian König <christian.koenig@amd.com> Fixes:4624459c84("drm/amdgpu: add gang submit frontend v6") Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d3dcdb43c8
commit
0d4e60e23c
@@ -129,9 +129,6 @@ static int amdgpu_cs_p1_user_fence(struct amdgpu_cs_parser *p,
|
|||||||
bo = amdgpu_bo_ref(gem_to_amdgpu_bo(gobj));
|
bo = amdgpu_bo_ref(gem_to_amdgpu_bo(gobj));
|
||||||
p->uf_entry.priority = 0;
|
p->uf_entry.priority = 0;
|
||||||
p->uf_entry.tv.bo = &bo->tbo;
|
p->uf_entry.tv.bo = &bo->tbo;
|
||||||
/* One for TTM and two for the CS job */
|
|
||||||
p->uf_entry.tv.num_shared = 3;
|
|
||||||
|
|
||||||
drm_gem_object_put(gobj);
|
drm_gem_object_put(gobj);
|
||||||
|
|
||||||
size = amdgpu_bo_size(bo);
|
size = amdgpu_bo_size(bo);
|
||||||
@@ -883,15 +880,19 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
|
|||||||
|
|
||||||
mutex_lock(&p->bo_list->bo_list_mutex);
|
mutex_lock(&p->bo_list->bo_list_mutex);
|
||||||
|
|
||||||
/* One for TTM and one for the CS job */
|
/* One for TTM and one for each CS job */
|
||||||
amdgpu_bo_list_for_each_entry(e, p->bo_list)
|
amdgpu_bo_list_for_each_entry(e, p->bo_list)
|
||||||
e->tv.num_shared = 2;
|
e->tv.num_shared = 1 + p->gang_size;
|
||||||
|
p->uf_entry.tv.num_shared = 1 + p->gang_size;
|
||||||
|
|
||||||
amdgpu_bo_list_get_list(p->bo_list, &p->validated);
|
amdgpu_bo_list_get_list(p->bo_list, &p->validated);
|
||||||
|
|
||||||
INIT_LIST_HEAD(&duplicates);
|
INIT_LIST_HEAD(&duplicates);
|
||||||
amdgpu_vm_get_pd_bo(&fpriv->vm, &p->validated, &p->vm_pd);
|
amdgpu_vm_get_pd_bo(&fpriv->vm, &p->validated, &p->vm_pd);
|
||||||
|
|
||||||
|
/* Two for VM updates, one for TTM and one for each CS job */
|
||||||
|
p->vm_pd.tv.num_shared = 3 + p->gang_size;
|
||||||
|
|
||||||
if (p->uf_entry.tv.bo && !ttm_to_amdgpu_bo(p->uf_entry.tv.bo)->parent)
|
if (p->uf_entry.tv.bo && !ttm_to_amdgpu_bo(p->uf_entry.tv.bo)->parent)
|
||||||
list_add(&p->uf_entry.tv.head, &p->validated);
|
list_add(&p->uf_entry.tv.head, &p->validated);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user