diff options
author | Jammy Zhou <Jammy.Zhou@amd.com> | 2015-08-02 22:27:57 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-08-17 16:50:58 -0400 |
commit | 27f6642d066ecea7b535dd9b24e2f41e54f3dd85 (patch) | |
tree | 57d060da0894b11938ed30f2b368feaa30385e06 /drivers/gpu/drm/amd | |
parent | 63ad8d5882fcd466861fdbe51fc3a119b894d9a3 (diff) |
drm/amdgpu: add amd_sched_next_queued_seq function
This function is used to get the next queued sequence number
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/scheduler/gpu_scheduler.h | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index e0eaa55bf636..6766ead31c4d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | |||
@@ -310,7 +310,7 @@ struct fence *amdgpu_ctx_get_fence(struct amdgpu_ctx *ctx, | |||
310 | 310 | ||
311 | spin_lock(&ctx->ring_lock); | 311 | spin_lock(&ctx->ring_lock); |
312 | if (amdgpu_enable_scheduler) | 312 | if (amdgpu_enable_scheduler) |
313 | queued_seq = atomic64_read(&cring->c_entity.last_queued_v_seq) + 1; | 313 | queued_seq = amd_sched_next_queued_seq(&cring->c_entity); |
314 | else | 314 | else |
315 | queued_seq = cring->sequence; | 315 | queued_seq = cring->sequence; |
316 | 316 | ||
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c index 55ebbf0f8cd0..4ad1825e713e 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | |||
@@ -507,3 +507,15 @@ void amd_sched_emit(struct amd_context_entity *c_entity, uint64_t seq) | |||
507 | atomic64_set(&c_entity->last_emitted_v_seq, seq); | 507 | atomic64_set(&c_entity->last_emitted_v_seq, seq); |
508 | wake_up_all(&c_entity->wait_emit); | 508 | wake_up_all(&c_entity->wait_emit); |
509 | } | 509 | } |
510 | |||
511 | /** | ||
512 | * Get next queued sequence number | ||
513 | * | ||
514 | * @entity The context entity | ||
515 | * | ||
516 | * return the next queued sequence number | ||
517 | */ | ||
518 | uint64_t amd_sched_next_queued_seq(struct amd_context_entity *c_entity) | ||
519 | { | ||
520 | return atomic64_read(&c_entity->last_queued_v_seq) + 1; | ||
521 | } | ||
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h index 44f71cdf7c33..fd6d699d42e1 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h | |||
@@ -153,4 +153,6 @@ int amd_context_entity_init(struct amd_gpu_scheduler *sched, | |||
153 | 153 | ||
154 | void amd_sched_emit(struct amd_context_entity *c_entity, uint64_t seq); | 154 | void amd_sched_emit(struct amd_context_entity *c_entity, uint64_t seq); |
155 | 155 | ||
156 | uint64_t amd_sched_next_queued_seq(struct amd_context_entity *c_entity); | ||
157 | |||
156 | #endif | 158 | #endif |