summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorChunming Zhou <David1.Zhou@amd.com>2017-05-09 10:34:07 +0300
committerAlex Deucher <alexander.deucher@amd.com>2017-05-10 20:16:50 +0300
commitcb3696fdeca24d3a347a5225d934ce50c6edccba (patch)
tree98a7693eedbf5c5719c4d4e06f2249dfbfdd6e8f /drivers/gpu/drm
parent09062ae1bb1c4a84e382560ff5059803d263a6c8 (diff)
downloadlinux-cb3696fdeca24d3a347a5225d934ce50c6edccba.tar.xz
drm/amd: fix init order of sched job
Need to increment after the fence check. Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/amd/scheduler/gpu_scheduler.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
index 5fd12db0fc58..28b92c8d9985 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
@@ -462,9 +462,9 @@ int amd_sched_job_init(struct amd_sched_job *job,
job->sched = sched;
job->s_entity = entity;
job->s_fence = amd_sched_fence_create(entity, owner);
- job->id = atomic64_inc_return(&sched->job_id_count);
if (!job->s_fence)
return -ENOMEM;
+ job->id = atomic64_inc_return(&sched->job_id_count);
INIT_WORK(&job->finish_work, amd_sched_job_finish);
INIT_LIST_HEAD(&job->node);