Fix amdgpu failure to compile (#387)
* fix amdgpu failure to compile * fix indentation * fix indentation --------- Co-authored-by: Jianfeng Liu <liujianfeng1994@gmail.com>
This commit is contained in:
parent
2590770a3d
commit
f07e92459e
3 changed files with 26 additions and 16 deletions
|
|
@ -289,8 +289,11 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,
|
|||
if (ret)
|
||||
goto free_all_kdata;
|
||||
|
||||
ret = drm_sched_job_init(&p->jobs[i]->base, p->entities[i],
|
||||
&fpriv->vm);
|
||||
ret = drm_sched_job_init(&p->jobs[i]->base,
|
||||
p->entities[i],
|
||||
1, /* credits */
|
||||
&fpriv->vm, /* owner */
|
||||
p->filp->client_id);
|
||||
if (ret)
|
||||
goto free_all_kdata;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2355,12 +2355,22 @@ static int amdgpu_device_init_schedulers(struct amdgpu_device *adev)
|
|||
break;
|
||||
}
|
||||
|
||||
r = drm_sched_init(&ring->sched, &amdgpu_sched_ops, NULL,
|
||||
DRM_SCHED_PRIORITY_COUNT,
|
||||
ring->num_hw_submission, amdgpu_job_hang_limit,
|
||||
timeout, adev->reset_domain->wq,
|
||||
ring->sched_score, ring->name,
|
||||
adev->dev);
|
||||
{
|
||||
const struct drm_sched_init_args sched_args = {
|
||||
.ops = &amdgpu_sched_ops,
|
||||
.submit_wq = NULL,
|
||||
.timeout_wq = adev->reset_domain->wq,
|
||||
.num_rqs = DRM_SCHED_PRIORITY_COUNT,
|
||||
.credit_limit = ring->num_hw_submission,
|
||||
.hang_limit = amdgpu_job_hang_limit,
|
||||
.timeout = timeout,
|
||||
.score = ring->sched_score,
|
||||
.name = ring->name,
|
||||
.dev = adev->dev,
|
||||
};
|
||||
|
||||
r = drm_sched_init(&ring->sched, &sched_args);
|
||||
}
|
||||
if (r) {
|
||||
DRM_ERROR("Failed to create scheduler on ring %s.\n",
|
||||
ring->name);
|
||||
|
|
|
|||
|
|
@ -111,8 +111,6 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs,
|
|||
(*job)->vm_pd_addr = AMDGPU_BO_INVALID_OFFSET;
|
||||
|
||||
return 0;
|
||||
|
||||
return drm_sched_job_init(&(*job)->base, entity, 1, owner);
|
||||
}
|
||||
|
||||
int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev, unsigned size,
|
||||
|
|
@ -222,7 +220,11 @@ int amdgpu_job_submit(struct amdgpu_job *job, struct drm_sched_entity *entity,
|
|||
if (!f)
|
||||
return -EINVAL;
|
||||
|
||||
r = drm_sched_job_init(&job->base, entity, owner);
|
||||
/* If the client id isn't known, default to 0. It will appear in traces. */
|
||||
r = drm_sched_job_init(&job->base, entity,
|
||||
1, /* credits */
|
||||
owner,
|
||||
0);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
|
|
@ -261,11 +263,6 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job,
|
|||
int r;
|
||||
|
||||
fence = amdgpu_sync_get_fence(&job->sync);
|
||||
if (fence && drm_sched_dependency_optimized(fence, s_entity)) {
|
||||
r = amdgpu_sync_fence(&job->sched_sync, fence);
|
||||
if (r)
|
||||
DRM_ERROR("Error adding fence (%d)\n", r);
|
||||
}
|
||||
|
||||
if (!fence && job->gang_submit)
|
||||
fence = amdgpu_device_switch_gang(ring->adev, job->gang_submit);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue