提交 cdac5504 编写于 作者: C Christian König 提交者: Dave Airlie

drm/radeon: move ring syncing after bo validation

The function radeon_bo_list_validate can cause a
bo to move, resulting in a different sync_obj
and a dependency to wait for this move to finish.
Signed-off-by: NChristian König <deathsimple@vodafone.de>
Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: NJerome Glisse <jglisse@redhat.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 a02fa397
...@@ -836,7 +836,6 @@ struct radeon_cs_parser { ...@@ -836,7 +836,6 @@ struct radeon_cs_parser {
struct radeon_cs_reloc *relocs; struct radeon_cs_reloc *relocs;
struct radeon_cs_reloc **relocs_ptr; struct radeon_cs_reloc **relocs_ptr;
struct list_head validated; struct list_head validated;
bool sync_to_ring[RADEON_NUM_RINGS];
/* indices of various chunks */ /* indices of various chunks */
int chunk_ib_idx; int chunk_ib_idx;
int chunk_relocs_idx; int chunk_relocs_idx;
......
...@@ -85,12 +85,6 @@ int radeon_cs_parser_relocs(struct radeon_cs_parser *p) ...@@ -85,12 +85,6 @@ int radeon_cs_parser_relocs(struct radeon_cs_parser *p)
radeon_bo_list_add_object(&p->relocs[i].lobj, radeon_bo_list_add_object(&p->relocs[i].lobj,
&p->validated); &p->validated);
if (p->relocs[i].robj->tbo.sync_obj && !(r->flags & RADEON_RELOC_DONT_SYNC)) {
struct radeon_fence *fence = p->relocs[i].robj->tbo.sync_obj;
if (!radeon_fence_signaled(fence)) {
p->sync_to_ring[fence->ring] = true;
}
}
} else } else
p->relocs[i].handle = 0; p->relocs[i].handle = 0;
} }
...@@ -118,11 +112,24 @@ static int radeon_cs_get_ring(struct radeon_cs_parser *p, u32 ring, s32 priority ...@@ -118,11 +112,24 @@ static int radeon_cs_get_ring(struct radeon_cs_parser *p, u32 ring, s32 priority
static int radeon_cs_sync_rings(struct radeon_cs_parser *p) static int radeon_cs_sync_rings(struct radeon_cs_parser *p)
{ {
bool sync_to_ring[RADEON_NUM_RINGS] = { };
int i, r; int i, r;
for (i = 0; i < p->nrelocs; i++) {
if (!p->relocs[i].robj || !p->relocs[i].robj->tbo.sync_obj)
continue;
if (!(p->relocs[i].flags & RADEON_RELOC_DONT_SYNC)) {
struct radeon_fence *fence = p->relocs[i].robj->tbo.sync_obj;
if (!radeon_fence_signaled(fence)) {
sync_to_ring[fence->ring] = true;
}
}
}
for (i = 0; i < RADEON_NUM_RINGS; ++i) { for (i = 0; i < RADEON_NUM_RINGS; ++i) {
/* no need to sync to our own or unused rings */ /* no need to sync to our own or unused rings */
if (i == p->ring || !p->sync_to_ring[i] || !p->rdev->ring[i].ready) if (i == p->ring || !sync_to_ring[i] || !p->rdev->ring[i].ready)
continue; continue;
if (!p->ib->fence->semaphore) { if (!p->ib->fence->semaphore) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册