]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/amdgpu: shorten amdgpu_job_free_resources
authorChristian König <christian.koenig@amd.com>
Wed, 29 Jun 2016 11:29:57 +0000 (13:29 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 7 Jul 2016 19:06:10 +0000 (15:06 -0400)
The fence and the sync object are not hardware resources.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c

index 87b75d726ae8dcf45cd1fde022d0f94e25d7f785..347962ea17abd6de0be7258d2a99bf80e3ec1892 100644 (file)
@@ -89,21 +89,23 @@ static void amdgpu_job_free_resources(struct amdgpu_job *job)
 
        for (i = 0; i < job->num_ibs; ++i)
                amdgpu_ib_free(job->adev, &job->ibs[i], f);
-       fence_put(job->fence);
-
-       amdgpu_sync_free(&job->sync);
 }
 
 void amdgpu_job_free_cb(struct amd_sched_job *s_job)
 {
        struct amdgpu_job *job = container_of(s_job, struct amdgpu_job, base);
 
+       fence_put(job->fence);
+       amdgpu_sync_free(&job->sync);
        kfree(job);
 }
 
 void amdgpu_job_free(struct amdgpu_job *job)
 {
        amdgpu_job_free_resources(job);
+
+       fence_put(job->fence);
+       amdgpu_sync_free(&job->sync);
        kfree(job);
 }