瀏覽代碼

drm/amdgpu: shorten amdgpu_job_free_resources

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>
Christian König 9 年之前
父節點
當前提交
a79a5bdcef
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      drivers/gpu/drm/amd/amdgpu/amdgpu_job.c

+ 5 - 3
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c

@@ -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);
 }