Commit 3aecd24c authored by Monk Liu's avatar Monk Liu Committed by Alex Deucher

drm/amdgpu: change job->ctx field name

job->ctx actually is a fence_context of the entity
it belongs to, naming it as ctx is too vague, and
we'll need add amdgpu_ctx into the job structure
later.
Signed-off-by: default avatarMonk Liu <Monk.Liu@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d4946ccf
...@@ -1241,7 +1241,7 @@ struct amdgpu_job { ...@@ -1241,7 +1241,7 @@ struct amdgpu_job {
struct fence *fence; /* the hw fence */ struct fence *fence; /* the hw fence */
uint32_t num_ibs; uint32_t num_ibs;
void *owner; void *owner;
uint64_t ctx; uint64_t fence_ctx; /* the fence_context this job uses */
bool vm_needs_flush; bool vm_needs_flush;
unsigned vm_id; unsigned vm_id;
uint64_t vm_pd_addr; uint64_t vm_pd_addr;
......
...@@ -989,7 +989,7 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, ...@@ -989,7 +989,7 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
} }
job->owner = p->filp; job->owner = p->filp;
job->ctx = entity->fence_context; job->fence_ctx = entity->fence_context;
p->fence = fence_get(&job->base.s_fence->finished); p->fence = fence_get(&job->base.s_fence->finished);
cs->out.handle = amdgpu_ctx_add_fence(p->ctx, ring, p->fence); cs->out.handle = amdgpu_ctx_add_fence(p->ctx, ring, p->fence);
job->uf_sequence = cs->out.handle; job->uf_sequence = cs->out.handle;
......
...@@ -124,7 +124,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, ...@@ -124,7 +124,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
bool skip_preamble, need_ctx_switch; bool skip_preamble, need_ctx_switch;
unsigned patch_offset = ~0; unsigned patch_offset = ~0;
struct amdgpu_vm *vm; struct amdgpu_vm *vm;
uint64_t ctx; uint64_t fence_ctx;
unsigned i; unsigned i;
int r = 0; int r = 0;
...@@ -135,10 +135,10 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, ...@@ -135,10 +135,10 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
/* ring tests don't use a job */ /* ring tests don't use a job */
if (job) { if (job) {
vm = job->vm; vm = job->vm;
ctx = job->ctx; fence_ctx = job->fence_ctx;
} else { } else {
vm = NULL; vm = NULL;
ctx = 0; fence_ctx = 0;
} }
if (!ring->ready) { if (!ring->ready) {
...@@ -174,8 +174,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, ...@@ -174,8 +174,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
/* always set cond_exec_polling to CONTINUE */ /* always set cond_exec_polling to CONTINUE */
*ring->cond_exe_cpu_addr = 1; *ring->cond_exe_cpu_addr = 1;
skip_preamble = ring->current_ctx == ctx; skip_preamble = ring->current_ctx == fence_ctx;
need_ctx_switch = ring->current_ctx != ctx; need_ctx_switch = ring->current_ctx != fence_ctx;
for (i = 0; i < num_ibs; ++i) { for (i = 0; i < num_ibs; ++i) {
ib = &ibs[i]; ib = &ibs[i];
...@@ -209,7 +209,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, ...@@ -209,7 +209,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
if (patch_offset != ~0 && ring->funcs->patch_cond_exec) if (patch_offset != ~0 && ring->funcs->patch_cond_exec)
amdgpu_ring_patch_cond_exec(ring, patch_offset); amdgpu_ring_patch_cond_exec(ring, patch_offset);
ring->current_ctx = ctx; ring->current_ctx = fence_ctx;
if (ring->funcs->emit_switch_buffer) if (ring->funcs->emit_switch_buffer)
amdgpu_ring_emit_switch_buffer(ring); amdgpu_ring_emit_switch_buffer(ring);
amdgpu_ring_commit(ring); amdgpu_ring_commit(ring);
......
...@@ -124,7 +124,7 @@ int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring, ...@@ -124,7 +124,7 @@ int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring,
return r; return r;
job->owner = owner; job->owner = owner;
job->ctx = entity->fence_context; job->fence_ctx = entity->fence_context;
*f = fence_get(&job->base.s_fence->finished); *f = fence_get(&job->base.s_fence->finished);
amdgpu_job_free_resources(job); amdgpu_job_free_resources(job);
amd_sched_entity_push_job(&job->base); amd_sched_entity_push_job(&job->base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment