Commit f82cbddd authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/radeon: add sync helper function

Signed-off-by: default avatarChristian König <deathsimple@vodafone.de>
Reviewed-by: default avatarJerome Glisse <jglisse@redhat.com>
parent d66a7626
...@@ -115,19 +115,27 @@ static int radeon_cs_get_ring(struct radeon_cs_parser *p, u32 ring, s32 priority ...@@ -115,19 +115,27 @@ static int radeon_cs_get_ring(struct radeon_cs_parser *p, u32 ring, s32 priority
return 0; return 0;
} }
static void radeon_cs_sync_to(struct radeon_cs_parser *p,
struct radeon_fence *fence)
{
struct radeon_fence *other;
if (!fence)
return;
other = p->ib.sync_to[fence->ring];
p->ib.sync_to[fence->ring] = radeon_fence_later(fence, other);
}
static void radeon_cs_sync_rings(struct radeon_cs_parser *p) static void radeon_cs_sync_rings(struct radeon_cs_parser *p)
{ {
int i; int i;
for (i = 0; i < p->nrelocs; i++) { for (i = 0; i < p->nrelocs; i++) {
struct radeon_fence *a, *b; if (!p->relocs[i].robj)
if (!p->relocs[i].robj || !p->relocs[i].robj->tbo.sync_obj)
continue; continue;
a = p->relocs[i].robj->tbo.sync_obj; radeon_cs_sync_to(p, p->relocs[i].robj->tbo.sync_obj);
b = p->ib.sync_to[a->ring];
p->ib.sync_to[a->ring] = radeon_fence_later(a, b);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment