summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2015-08-18 15:30:26 +0200
committerAlex Deucher <alexander.deucher@amd.com>2015-08-20 17:05:01 -0400
commitbf7ebaeed4dca7c0a7f9d9a44efbd9f74cf22c5d (patch)
treeed2bc31b1bd972c177a41f74f3eafee0e88be117 /drivers/gpu/drm
parent2b184d8dbc002d3ef26e4827dd5a80d57533dcae (diff)
drm/amdgpu: free the job immediately after dispatching it
Fixes a whole bunch of lockdep warnings. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
index 5b1ae18f5e8d..06d7bf51db9a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
@@ -49,6 +49,9 @@ static struct fence *amdgpu_sched_run_job(struct amd_gpu_scheduler *sched,
goto err;
fence = amdgpu_fence_ref(sched_job->ibs[sched_job->num_ibs - 1].fence);
+ if (sched_job->free_job)
+ sched_job->free_job(sched_job);
+
mutex_unlock(&sched_job->job_lock);
return &fence->base;
@@ -69,10 +72,6 @@ static void amdgpu_sched_process_job(struct amd_gpu_scheduler *sched,
return;
}
sched_job = (struct amdgpu_job *)job;
- mutex_lock(&sched_job->job_lock);
- if (sched_job->free_job)
- sched_job->free_job(sched_job);
- mutex_unlock(&sched_job->job_lock);
/* after processing job, free memory */
fence_put(&sched_job->base.s_fence->base);
kfree(sched_job);