aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
diff options
context:
space:
mode:
authorChunming Zhou <david1.zhou@amd.com>2015-07-30 05:59:43 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-08-17 16:50:43 -0400
commitd1ff9086c1b8e67390161599006a34056b437a72 (patch)
treeaaaf8b04c136fb05fd9d863f501450974ac5cfcf /drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
parent51b9db27d07869cf565ba135e97e2ed5f858612e (diff)
drm/amdgpu: fix seq in ctx_add_fence
if enabling scheduler, then the queued seq is assigned when pushing job before emitting job. Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Christian K?nig <christian.koenig@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index 95807b678b6a..e0eaa55bf636 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -258,7 +258,7 @@ int amdgpu_ctx_put(struct amdgpu_ctx *ctx)
258} 258}
259 259
260uint64_t amdgpu_ctx_add_fence(struct amdgpu_ctx *ctx, struct amdgpu_ring *ring, 260uint64_t amdgpu_ctx_add_fence(struct amdgpu_ctx *ctx, struct amdgpu_ring *ring,
261 struct fence *fence) 261 struct fence *fence, uint64_t queued_seq)
262{ 262{
263 struct amdgpu_ctx_ring *cring = & ctx->rings[ring->idx]; 263 struct amdgpu_ctx_ring *cring = & ctx->rings[ring->idx];
264 uint64_t seq = 0; 264 uint64_t seq = 0;
@@ -266,7 +266,7 @@ uint64_t amdgpu_ctx_add_fence(struct amdgpu_ctx *ctx, struct amdgpu_ring *ring,
266 struct fence *other = NULL; 266 struct fence *other = NULL;
267 267
268 if (amdgpu_enable_scheduler) 268 if (amdgpu_enable_scheduler)
269 seq = atomic64_read(&cring->c_entity.last_queued_v_seq); 269 seq = queued_seq;
270 else 270 else
271 seq = cring->sequence; 271 seq = cring->sequence;
272 idx = seq % AMDGPU_CTX_MAX_CS_PENDING; 272 idx = seq % AMDGPU_CTX_MAX_CS_PENDING;