提交 f95b7e3e 编写于 作者: J Jammy Zhou 提交者: Alex Deucher

drm/amdgpu: add amd_sched_commit

This function is to update last_emitted_v_seq and wake up the waiters.

It should be called by driver in the run_job backend function
Signed-off-by: NJammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: NChristian König <christian.koenig@amd.com>
Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
上级 ea199cc9
...@@ -62,9 +62,8 @@ static void amdgpu_sched_run_job(struct amd_gpu_scheduler *sched, ...@@ -62,9 +62,8 @@ static void amdgpu_sched_run_job(struct amd_gpu_scheduler *sched,
if (r) if (r)
goto err; goto err;
} }
atomic64_set(&c_entity->last_emitted_v_seq,
sched_job->ibs[sched_job->num_ibs - 1].sequence); amd_sched_emit(c_entity, sched_job->ibs[sched_job->num_ibs - 1].sequence);
wake_up_all(&c_entity->wait_emit);
mutex_unlock(&sched_job->job_lock); mutex_unlock(&sched_job->job_lock);
return; return;
......
...@@ -495,3 +495,15 @@ int amd_sched_destroy(struct amd_gpu_scheduler *sched) ...@@ -495,3 +495,15 @@ int amd_sched_destroy(struct amd_gpu_scheduler *sched)
return 0; return 0;
} }
/**
* Update emitted sequence and wake up the waiters, called by run_job
* in driver side
*
* @entity The context entity
* @seq The sequence number for the latest emitted job
*/
void amd_sched_emit(struct amd_context_entity *c_entity, uint64_t seq)
{
atomic64_set(&c_entity->last_emitted_v_seq, seq);
wake_up_all(&c_entity->wait_emit);
}
...@@ -151,4 +151,6 @@ int amd_context_entity_init(struct amd_gpu_scheduler *sched, ...@@ -151,4 +151,6 @@ int amd_context_entity_init(struct amd_gpu_scheduler *sched,
uint32_t context_id, uint32_t context_id,
uint32_t jobs); uint32_t jobs);
void amd_sched_emit(struct amd_context_entity *c_entity, uint64_t seq);
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册