aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
diff options
context:
space:
mode:
authorChunming Zhou <david1.zhou@amd.com>2015-07-21 15:53:04 +0800
committerAlex Deucher <alexander.deucher@amd.com>2015-08-17 16:50:35 -0400
commit4b559c90bc1870313f02cceef680884519af6b2b (patch)
tree7445ec7982f1fac5e517097bedd72cc752c41889 /drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
parentdrm/amdgpu: use scheduler user seq instead of previous user seq (diff)
downloadlinux-dev-4b559c90bc1870313f02cceef680884519af6b2b.tar.xz
linux-dev-4b559c90bc1870313f02cceef680884519af6b2b.zip
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.c10
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,
struct amdgpu_ctx_ring *cring = & ctx->rings[ring->idx];
struct fence *fence;
uint64_t queued_seq;
+ int r;
+
+ if (amdgpu_enable_scheduler) {
+ r = amd_sched_wait_emit(&cring->c_entity,
+ seq,
+ true,
+ AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS);
+ if (r)
+ return NULL;
+ }
spin_lock(&ctx->ring_lock);
if (amdgpu_enable_scheduler)