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>
This commit is contained in:
parent
63ad8d5882
commit
27f6642d06
|
@ -310,7 +310,7 @@ struct fence *amdgpu_ctx_get_fence(struct amdgpu_ctx *ctx,
|
||||||
|
|
||||||
spin_lock(&ctx->ring_lock);
|
spin_lock(&ctx->ring_lock);
|
||||||
if (amdgpu_enable_scheduler)
|
if (amdgpu_enable_scheduler)
|
||||||
queued_seq = atomic64_read(&cring->c_entity.last_queued_v_seq) + 1;
|
queued_seq = amd_sched_next_queued_seq(&cring->c_entity);
|
||||||
else
|
else
|
||||||
queued_seq = cring->sequence;
|
queued_seq = cring->sequence;
|
||||||
|
|
||||||
|
|
|
@ -507,3 +507,15 @@ void amd_sched_emit(struct amd_context_entity *c_entity, uint64_t seq)
|
||||||
atomic64_set(&c_entity->last_emitted_v_seq, seq);
|
atomic64_set(&c_entity->last_emitted_v_seq, seq);
|
||||||
wake_up_all(&c_entity->wait_emit);
|
wake_up_all(&c_entity->wait_emit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get next queued sequence number
|
||||||
|
*
|
||||||
|
* @entity The context entity
|
||||||
|
*
|
||||||
|
* return the next queued sequence number
|
||||||
|
*/
|
||||||
|
uint64_t amd_sched_next_queued_seq(struct amd_context_entity *c_entity)
|
||||||
|
{
|
||||||
|
return atomic64_read(&c_entity->last_queued_v_seq) + 1;
|
||||||
|
}
|
||||||
|
|
|
@ -153,4 +153,6 @@ int amd_context_entity_init(struct amd_gpu_scheduler *sched,
|
||||||
|
|
||||||
void amd_sched_emit(struct amd_context_entity *c_entity, uint64_t seq);
|
void amd_sched_emit(struct amd_context_entity *c_entity, uint64_t seq);
|
||||||
|
|
||||||
|
uint64_t amd_sched_next_queued_seq(struct amd_context_entity *c_entity);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue