diff options
author | Monk Liu <Monk.Liu@amd.com> | 2016-03-07 12:49:55 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-05-02 15:12:59 -0400 |
commit | e686941a32d31d22ce7c8b7faf9cce17816f7c4d (patch) | |
tree | 8715c3287ddb13792ec235411b734caad34c7559 /drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | |
parent | 03ccf481980f8d3363263e73c64473d8f2779dc0 (diff) | |
download | linux-e686941a32d31d22ce7c8b7faf9cce17816f7c4d.tar.bz2 |
drm/amdgpu: use sched_job_init to initialize sched_job
Consolidate job initialization in one place rather than
duplicating it in multiple places.
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/scheduler/gpu_scheduler.c')
-rw-r--r-- | drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c index a5ff9458d359..b9d5822bece8 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c @@ -335,6 +335,23 @@ void amd_sched_entity_push_job(struct amd_sched_job *sched_job) amd_sched_entity_in(sched_job)); } +/* init a sched_job with basic field */ +int amd_sched_job_init(struct amd_sched_job *job, + struct amd_gpu_scheduler *sched, + struct amd_sched_entity *entity, + void *owner, struct fence **fence) +{ + job->sched = sched; + job->s_entity = entity; + job->s_fence = amd_sched_fence_create(entity, owner); + if (!job->s_fence) + return -ENOMEM; + + if (fence) + *fence = &job->s_fence->base; + return 0; +} + /** * Return ture if we can push more jobs to the hw. */ |