drm/amdgpu: return new seq_no for amd_sched_push_job

It is clean to update last_queued_v_seq in the scheduler module

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:
Jammy Zhou
2015-07-31 16:47:28 +08:00
committed by Alex Deucher
parent dd01d07195
commit ea199cc9f8
5 changed files with 15 additions and 38 deletions

View File

@@ -293,12 +293,9 @@ int amd_context_entity_fini(struct amd_gpu_scheduler *sched,
* @sched The pointer to the scheduler
* @c_entity The pointer to amd_context_entity
* @job The pointer to job required to submit
* return 0 if succeed. -1 if failed.
* -2 indicate queue is full for this client, client should wait untill
* scheduler consum some queued command.
* -1 other fail.
* return the virtual sequence number
*/
int amd_sched_push_job(struct amd_gpu_scheduler *sched,
uint64_t amd_sched_push_job(struct amd_gpu_scheduler *sched,
struct amd_context_entity *c_entity,
void *job)
{
@@ -312,7 +309,8 @@ int amd_sched_push_job(struct amd_gpu_scheduler *sched,
}
wake_up_interruptible(&sched->wait_queue);
return 0;
return atomic64_inc_return(&c_entity->last_queued_v_seq);
}
/**

View File

@@ -129,7 +129,7 @@ struct amd_gpu_scheduler *amd_sched_create(void *device,
int amd_sched_destroy(struct amd_gpu_scheduler *sched);
int amd_sched_push_job(struct amd_gpu_scheduler *sched,
uint64_t amd_sched_push_job(struct amd_gpu_scheduler *sched,
struct amd_context_entity *c_entity,
void *job);