diff options
author | Chunming Zhou <David1.Zhou@amd.com> | 2016-01-14 22:25:00 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-02-10 14:16:50 -0500 |
commit | cadf97b196a1e5b2db2606d53f77714e3e9cf4bb (patch) | |
tree | 1954976bc68547599f4ea9c29381a962c5c5d681 /drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | |
parent | be86c606b50a53b60f3591ba94dd687524f2ee21 (diff) |
drm/amdgpu: clean up non-scheduler code path (v2)
Non-scheduler code is longer supported.
v2: agd: rebased on upstream
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c index 438c05254695..dd9fac302e55 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | |||
@@ -76,33 +76,25 @@ int amdgpu_sched_ib_submit_kernel_helper(struct amdgpu_device *adev, | |||
76 | void *owner, | 76 | void *owner, |
77 | struct fence **f) | 77 | struct fence **f) |
78 | { | 78 | { |
79 | int r = 0; | 79 | struct amdgpu_job *job = |
80 | if (amdgpu_enable_scheduler) { | 80 | kzalloc(sizeof(struct amdgpu_job), GFP_KERNEL); |
81 | struct amdgpu_job *job = | 81 | if (!job) |
82 | kzalloc(sizeof(struct amdgpu_job), GFP_KERNEL); | 82 | return -ENOMEM; |
83 | if (!job) | 83 | job->base.sched = &ring->sched; |
84 | return -ENOMEM; | 84 | job->base.s_entity = &adev->kernel_ctx.rings[ring->idx].entity; |
85 | job->base.sched = &ring->sched; | 85 | job->base.s_fence = amd_sched_fence_create(job->base.s_entity, owner); |
86 | job->base.s_entity = &adev->kernel_ctx.rings[ring->idx].entity; | 86 | if (!job->base.s_fence) { |
87 | job->base.s_fence = amd_sched_fence_create(job->base.s_entity, owner); | 87 | kfree(job); |
88 | if (!job->base.s_fence) { | 88 | return -ENOMEM; |
89 | kfree(job); | ||
90 | return -ENOMEM; | ||
91 | } | ||
92 | *f = fence_get(&job->base.s_fence->base); | ||
93 | |||
94 | job->adev = adev; | ||
95 | job->ibs = ibs; | ||
96 | job->num_ibs = num_ibs; | ||
97 | job->owner = owner; | ||
98 | job->free_job = free_job; | ||
99 | amd_sched_entity_push_job(&job->base); | ||
100 | } else { | ||
101 | r = amdgpu_ib_schedule(adev, num_ibs, ibs, owner); | ||
102 | if (r) | ||
103 | return r; | ||
104 | *f = fence_get(&ibs[num_ibs - 1].fence->base); | ||
105 | } | 89 | } |
90 | *f = fence_get(&job->base.s_fence->base); | ||
91 | |||
92 | job->adev = adev; | ||
93 | job->ibs = ibs; | ||
94 | job->num_ibs = num_ibs; | ||
95 | job->owner = owner; | ||
96 | job->free_job = free_job; | ||
97 | amd_sched_entity_push_job(&job->base); | ||
106 | 98 | ||
107 | return 0; | 99 | return 0; |
108 | } | 100 | } |