diff options
author | Christian König <deathsimple@vodafone.de> | 2012-08-09 10:35:36 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2012-09-20 13:10:38 -0400 |
commit | f82cbddddbd368f391d45738601fa29a75cfbe3b (patch) | |
tree | 2f1c95397b617894c65304f0961267268c5e2574 /drivers/gpu/drm/radeon/radeon_cs.c | |
parent | d66a76269a57f84b785f7449818b843de1f07915 (diff) |
drm/radeon: add sync helper function
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_cs.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_cs.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 0a9d1eb719cf..85a80e467482 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c | |||
@@ -115,19 +115,27 @@ static int radeon_cs_get_ring(struct radeon_cs_parser *p, u32 ring, s32 priority | |||
115 | return 0; | 115 | return 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | static void radeon_cs_sync_to(struct radeon_cs_parser *p, | ||
119 | struct radeon_fence *fence) | ||
120 | { | ||
121 | struct radeon_fence *other; | ||
122 | |||
123 | if (!fence) | ||
124 | return; | ||
125 | |||
126 | other = p->ib.sync_to[fence->ring]; | ||
127 | p->ib.sync_to[fence->ring] = radeon_fence_later(fence, other); | ||
128 | } | ||
129 | |||
118 | static void radeon_cs_sync_rings(struct radeon_cs_parser *p) | 130 | static void radeon_cs_sync_rings(struct radeon_cs_parser *p) |
119 | { | 131 | { |
120 | int i; | 132 | int i; |
121 | 133 | ||
122 | for (i = 0; i < p->nrelocs; i++) { | 134 | for (i = 0; i < p->nrelocs; i++) { |
123 | struct radeon_fence *a, *b; | 135 | if (!p->relocs[i].robj) |
124 | |||
125 | if (!p->relocs[i].robj || !p->relocs[i].robj->tbo.sync_obj) | ||
126 | continue; | 136 | continue; |
127 | 137 | ||
128 | a = p->relocs[i].robj->tbo.sync_obj; | 138 | radeon_cs_sync_to(p, p->relocs[i].robj->tbo.sync_obj); |
129 | b = p->ib.sync_to[a->ring]; | ||
130 | p->ib.sync_to[a->ring] = radeon_fence_later(a, b); | ||
131 | } | 139 | } |
132 | } | 140 | } |
133 | 141 | ||