summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-07-05 14:48:17 +0200
committerAlex Deucher <alexander.deucher@amd.com>2016-07-14 16:46:05 -0400
commit22a77cf6d87e0cfadf91bf7d09bae71359bc85f6 (patch)
tree99f3d92e688847a8d17c47996709ed43d11e4b00 /drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
parent0808663517dd7e1583c1a8e48f0acfb2c0a127cd (diff)
downloadop-kernel-dev-22a77cf6d87e0cfadf91bf7d09bae71359bc85f6.zip
op-kernel-dev-22a77cf6d87e0cfadf91bf7d09bae71359bc85f6.tar.gz
drm/amdgpu: cleanup hw reference handling in the IB tests
Reference should be taken when we make the assignment, not anywhere else. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@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.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index aaee0c8..6674d40 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -172,15 +172,13 @@ static struct fence *amdgpu_job_run(struct amd_sched_job *sched_job)
trace_amdgpu_sched_run_job(job);
r = amdgpu_ib_schedule(job->ring, job->num_ibs, job->ibs,
job->sync.last_vm_update, job, &fence);
- if (r) {
+ if (r)
DRM_ERROR("Error scheduling IBs (%d)\n", r);
- goto err;
- }
-err:
/* if gpu reset, hw fence will be replaced here */
fence_put(job->fence);
- job->fence = fence;
+ job->fence = fence_get(fence);
+ amdgpu_job_free_resources(job);
return fence;
}
OpenPOWER on IntegriCloud