summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2015-08-31 17:28:28 +0200
committerAlex Deucher <alexander.deucher@amd.com>2015-09-23 23:23:33 +0200
commit1886d1a9caed20f457dd69a926c7f8b54c2d5f48 (patch)
treed1d4ab3b168258de4d0d8b7c515361a6736f074a /drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
parentdrm/amdgpu: move scheduler fence callback into fence v2 (diff)
downloadlinux-1886d1a9caed20f457dd69a926c7f8b54c2d5f48.tar.xz
linux-1886d1a9caed20f457dd69a926c7f8b54c2d5f48.zip
drm/amdgpu: remove process_job callback from the scheduler
Just free the resources immediately after submitting the job. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
index de98fbd2971e..5724a81fbf5e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
@@ -35,8 +35,8 @@ static struct fence *amdgpu_sched_dependency(struct amd_sched_job *job)
static struct fence *amdgpu_sched_run_job(struct amd_sched_job *job)
{
+ struct amdgpu_fence *fence = NULL;
struct amdgpu_job *sched_job;
- struct amdgpu_fence *fence;
int r;
if (!job) {
@@ -49,41 +49,26 @@ static struct fence *amdgpu_sched_run_job(struct amd_sched_job *job)
sched_job->num_ibs,
sched_job->ibs,
sched_job->base.owner);
- if (r)
+ if (r) {
+ DRM_ERROR("Error scheduling IBs (%d)\n", r);
goto err;
+ }
+
fence = amdgpu_fence_ref(sched_job->ibs[sched_job->num_ibs - 1].fence);
+err:
if (sched_job->free_job)
sched_job->free_job(sched_job);
mutex_unlock(&sched_job->job_lock);
- return &fence->base;
-
-err:
- DRM_ERROR("Run job error\n");
- mutex_unlock(&sched_job->job_lock);
- job->sched->ops->process_job(job);
- return NULL;
-}
-
-static void amdgpu_sched_process_job(struct amd_sched_job *job)
-{
- struct amdgpu_job *sched_job;
-
- if (!job) {
- DRM_ERROR("job is null\n");
- return;
- }
- sched_job = (struct amdgpu_job *)job;
- /* after processing job, free memory */
fence_put(&sched_job->base.s_fence->base);
kfree(sched_job);
+ return fence ? &fence->base : NULL;
}
struct amd_sched_backend_ops amdgpu_sched_ops = {
.dependency = amdgpu_sched_dependency,
.run_job = amdgpu_sched_run_job,
- .process_job = amdgpu_sched_process_job
};
int amdgpu_sched_ib_submit_kernel_helper(struct amdgpu_device *adev,