mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 11:19:37 +00:00
drm/amdgpu: move prepare work out of scheduler to cs_ioctl
Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Christian K?nig <christian.koenig@amd.com>
This commit is contained in:
parent
1c8f805af9
commit
c3b95d4f9e
1 changed files with 8 additions and 13 deletions
|
@ -533,12 +533,6 @@ static void amdgpu_cs_parser_fini(struct amdgpu_cs_parser *parser, int error, bo
|
||||||
amdgpu_cs_parser_fini_late(parser);
|
amdgpu_cs_parser_fini_late(parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int amdgpu_cs_parser_run_job(struct amdgpu_cs_parser *sched_job)
|
|
||||||
{
|
|
||||||
amdgpu_cs_parser_fini_early(sched_job, 0, true);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int amdgpu_cs_parser_free_job(struct amdgpu_cs_parser *sched_job)
|
static int amdgpu_cs_parser_free_job(struct amdgpu_cs_parser *sched_job)
|
||||||
{
|
{
|
||||||
amdgpu_cs_parser_fini_late(sched_job);
|
amdgpu_cs_parser_fini_late(sched_job);
|
||||||
|
@ -904,14 +898,10 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
|
||||||
if (amdgpu_enable_scheduler && parser->num_ibs) {
|
if (amdgpu_enable_scheduler && parser->num_ibs) {
|
||||||
struct amdgpu_ring * ring =
|
struct amdgpu_ring * ring =
|
||||||
amdgpu_cs_parser_get_ring(adev, parser);
|
amdgpu_cs_parser_get_ring(adev, parser);
|
||||||
if (ring->is_pte_ring || (parser->bo_list && parser->bo_list->has_userptr)) {
|
r = amdgpu_cs_parser_prepare_job(parser);
|
||||||
r = amdgpu_cs_parser_prepare_job(parser);
|
if (r)
|
||||||
if (r)
|
goto out;
|
||||||
goto out;
|
|
||||||
} else
|
|
||||||
parser->prepare_job = amdgpu_cs_parser_prepare_job;
|
|
||||||
parser->ring = ring;
|
parser->ring = ring;
|
||||||
parser->run_job = amdgpu_cs_parser_run_job;
|
|
||||||
parser->free_job = amdgpu_cs_parser_free_job;
|
parser->free_job = amdgpu_cs_parser_free_job;
|
||||||
mutex_lock(&parser->job_lock);
|
mutex_lock(&parser->job_lock);
|
||||||
r = amd_sched_push_job(ring->scheduler,
|
r = amd_sched_push_job(ring->scheduler,
|
||||||
|
@ -927,6 +917,11 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
|
||||||
&parser->s_fence->base,
|
&parser->s_fence->base,
|
||||||
parser->s_fence->v_seq);
|
parser->s_fence->v_seq);
|
||||||
cs->out.handle = parser->s_fence->v_seq;
|
cs->out.handle = parser->s_fence->v_seq;
|
||||||
|
list_sort(NULL, &parser->validated, cmp_size_smaller_first);
|
||||||
|
ttm_eu_fence_buffer_objects(&parser->ticket,
|
||||||
|
&parser->validated,
|
||||||
|
&parser->s_fence->base);
|
||||||
|
|
||||||
mutex_unlock(&parser->job_lock);
|
mutex_unlock(&parser->job_lock);
|
||||||
up_read(&adev->exclusive_lock);
|
up_read(&adev->exclusive_lock);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue