summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-05-18 14:12:12 +0300
committerAlex Deucher <alexander.deucher@amd.com>2016-07-07 21:50:52 +0300
commit1e24e31f22a69e0983c3dbc31dc725cd940ad258 (patch)
tree08112b7816b1fd661ba4405d1d1587b6d446261e /drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
parent1ab0d211f3b81464f82caccd58f3f8204ad72c97 (diff)
downloadlinux-1e24e31f22a69e0983c3dbc31dc725cd940ad258.tar.xz
drm/amdgpu: remove use_shed hack in job cleanup
Remembering the code path in a variable to cleanup differently is usually not a good idea at all. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Monk.Liu <monk.liu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_job.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_job.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index f0fa48511f41..be4698b0b33b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -86,7 +86,7 @@ int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev, unsigned size,
return r;
}
-void amdgpu_job_free(struct amdgpu_job *job)
+static void amdgpu_job_free_resources(struct amdgpu_job *job)
{
struct fence *f;
unsigned i;
@@ -100,9 +100,6 @@ void amdgpu_job_free(struct amdgpu_job *job)
amdgpu_bo_unref(&job->uf_bo);
amdgpu_sync_free(&job->sync);
-
- if (!job->base.use_sched)
- kfree(job);
}
void amdgpu_job_free_func(struct kref *refcount)
@@ -111,6 +108,12 @@ void amdgpu_job_free_func(struct kref *refcount)
kfree(job);
}
+void amdgpu_job_free(struct amdgpu_job *job)
+{
+ amdgpu_job_free_resources(job);
+ kfree(job);
+}
+
int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring,
struct amd_sched_entity *entity, void *owner,
struct fence **f)
@@ -187,7 +190,7 @@ static struct fence *amdgpu_job_run(struct amd_sched_job *sched_job)
err:
job->fence = fence;
- amdgpu_job_free(job);
+ amdgpu_job_free_resources(job);
return fence;
}