diff options
author | Chunming Zhou <david1.zhou@amd.com> | 2015-07-21 03:53:04 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-08-17 16:50:35 -0400 |
commit | 4b559c90bc1870313f02cceef680884519af6b2b (patch) | |
tree | 7445ec7982f1fac5e517097bedd72cc752c41889 /drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | |
parent | b43a9a7e87d2bbb8d0c6ae4ff06dcc604f00e31a (diff) |
drm/amdgpu: make sure the fence is emitted before ring to get it.
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Christian K?nig <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index b9be250cb206..41bc7fc0ebf6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | |||
@@ -261,6 +261,16 @@ struct fence *amdgpu_ctx_get_fence(struct amdgpu_ctx *ctx, | |||
261 | struct amdgpu_ctx_ring *cring = & ctx->rings[ring->idx]; | 261 | struct amdgpu_ctx_ring *cring = & ctx->rings[ring->idx]; |
262 | struct fence *fence; | 262 | struct fence *fence; |
263 | uint64_t queued_seq; | 263 | uint64_t queued_seq; |
264 | int r; | ||
265 | |||
266 | if (amdgpu_enable_scheduler) { | ||
267 | r = amd_sched_wait_emit(&cring->c_entity, | ||
268 | seq, | ||
269 | true, | ||
270 | AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS); | ||
271 | if (r) | ||
272 | return NULL; | ||
273 | } | ||
264 | 274 | ||
265 | spin_lock(&ctx->ring_lock); | 275 | spin_lock(&ctx->ring_lock); |
266 | if (amdgpu_enable_scheduler) | 276 | if (amdgpu_enable_scheduler) |