struct amdgpu_ctx *amdgpu_ctx_get(struct amdgpu_fpriv *fpriv, uint32_t id);
int amdgpu_ctx_put(struct amdgpu_ctx *ctx);
-struct amdgpu_ctx *amdgpu_ctx_get_ref(struct amdgpu_ctx *ctx);
uint64_t amdgpu_ctx_add_fence(struct amdgpu_ctx *ctx, struct amdgpu_ring *ring,
struct fence *fence);
struct amdgpu_job {
struct amd_sched_job base;
struct amdgpu_device *adev;
- struct amdgpu_ctx *ctx;
struct drm_file *owner;
struct amdgpu_ib *ibs;
uint32_t num_ibs;
static int amdgpu_cs_free_job(struct amdgpu_job *sched_job)
{
int i;
- amdgpu_ctx_put(sched_job->ctx);
if (sched_job->ibs)
for (i = 0; i < sched_job->num_ibs; i++)
amdgpu_ib_free(sched_job->adev, &sched_job->ibs[i]);
job->ibs = parser->ibs;
job->num_ibs = parser->num_ibs;
job->owner = parser->filp;
- job->ctx = amdgpu_ctx_get_ref(parser->ctx);
mutex_init(&job->job_lock);
if (job->ibs[job->num_ibs - 1].user) {
memcpy(&job->uf, &parser->uf,
goto out;
}
cs->out.handle =
- amdgpu_ctx_add_fence(job->ctx, ring,
+ amdgpu_ctx_add_fence(parser->ctx, ring,
&job->base.s_fence->base);
parser->ibs[parser->num_ibs - 1].sequence = cs->out.handle;