Commit 595a9cd6 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: remove fence parameter from amd_sched_job_init

We return the fence as part of the job structur anyway,
no need to do this twice.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarChunming Zhou <david1.zhou@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a5fb4ec2
...@@ -836,15 +836,13 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, ...@@ -836,15 +836,13 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
{ {
struct amdgpu_ring *ring = p->job->ring; struct amdgpu_ring *ring = p->job->ring;
struct amd_sched_entity *entity = &p->ctx->rings[ring->idx].entity; struct amd_sched_entity *entity = &p->ctx->rings[ring->idx].entity;
struct fence *fence;
struct amdgpu_job *job; struct amdgpu_job *job;
int r; int r;
job = p->job; job = p->job;
p->job = NULL; p->job = NULL;
r = amd_sched_job_init(&job->base, &ring->sched, r = amd_sched_job_init(&job->base, &ring->sched, entity, p->filp);
entity, p->filp, &fence);
if (r) { if (r) {
amdgpu_job_free(job); amdgpu_job_free(job);
return r; return r;
...@@ -852,8 +850,8 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, ...@@ -852,8 +850,8 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
job->owner = p->filp; job->owner = p->filp;
job->ctx = entity->fence_context; job->ctx = entity->fence_context;
p->fence = fence_get(fence); p->fence = fence_get(&job->base.s_fence->finished);
cs->out.handle = amdgpu_ctx_add_fence(p->ctx, ring, fence); cs->out.handle = amdgpu_ctx_add_fence(p->ctx, ring, p->fence);
job->uf_sequence = cs->out.handle; job->uf_sequence = cs->out.handle;
amdgpu_job_free_resources(job); amdgpu_job_free_resources(job);
......
...@@ -113,20 +113,19 @@ int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring, ...@@ -113,20 +113,19 @@ int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring,
struct amd_sched_entity *entity, void *owner, struct amd_sched_entity *entity, void *owner,
struct fence **f) struct fence **f)
{ {
struct fence *fence;
int r; int r;
job->ring = ring; job->ring = ring;
if (!f) if (!f)
return -EINVAL; return -EINVAL;
r = amd_sched_job_init(&job->base, &ring->sched, entity, owner, &fence); r = amd_sched_job_init(&job->base, &ring->sched, entity, owner);
if (r) if (r)
return r; return r;
job->owner = owner; job->owner = owner;
job->ctx = entity->fence_context; job->ctx = entity->fence_context;
*f = fence_get(fence); *f = fence_get(&job->base.s_fence->finished);
amdgpu_job_free_resources(job); amdgpu_job_free_resources(job);
amd_sched_entity_push_job(&job->base); amd_sched_entity_push_job(&job->base);
......
...@@ -403,7 +403,7 @@ void amd_sched_entity_push_job(struct amd_sched_job *sched_job) ...@@ -403,7 +403,7 @@ void amd_sched_entity_push_job(struct amd_sched_job *sched_job)
int amd_sched_job_init(struct amd_sched_job *job, int amd_sched_job_init(struct amd_sched_job *job,
struct amd_gpu_scheduler *sched, struct amd_gpu_scheduler *sched,
struct amd_sched_entity *entity, struct amd_sched_entity *entity,
void *owner, struct fence **fence) void *owner)
{ {
job->sched = sched; job->sched = sched;
job->s_entity = entity; job->s_entity = entity;
...@@ -415,8 +415,6 @@ int amd_sched_job_init(struct amd_sched_job *job, ...@@ -415,8 +415,6 @@ int amd_sched_job_init(struct amd_sched_job *job,
INIT_LIST_HEAD(&job->node); INIT_LIST_HEAD(&job->node);
INIT_DELAYED_WORK(&job->work_tdr, amd_sched_job_timedout); INIT_DELAYED_WORK(&job->work_tdr, amd_sched_job_timedout);
if (fence)
*fence = &job->s_fence->finished;
return 0; return 0;
} }
......
...@@ -151,5 +151,5 @@ void amd_sched_fence_finished(struct amd_sched_fence *fence); ...@@ -151,5 +151,5 @@ void amd_sched_fence_finished(struct amd_sched_fence *fence);
int amd_sched_job_init(struct amd_sched_job *job, int amd_sched_job_init(struct amd_sched_job *job,
struct amd_gpu_scheduler *sched, struct amd_gpu_scheduler *sched,
struct amd_sched_entity *entity, struct amd_sched_entity *entity,
void *owner, struct fence **fence); void *owner);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment