aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMonk Liu <Monk.Liu@amd.com>2016-08-25 03:40:48 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-09-12 18:12:17 -0400
commit3aecd24c65b9539b6faac2a52a9aaa7bc90f4677 (patch)
tree60f9c78fd04b2865ccdfe093e96b0608ceefc7df
parentd4946ccfd0373610ffa6181cffae236bf07d3aff (diff)
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: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c12
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_job.c2
4 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 39baabe5f092..10ec29c50077 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1241,7 +1241,7 @@ struct amdgpu_job {
1241 struct fence *fence; /* the hw fence */ 1241 struct fence *fence; /* the hw fence */
1242 uint32_t num_ibs; 1242 uint32_t num_ibs;
1243 void *owner; 1243 void *owner;
1244 uint64_t ctx; 1244 uint64_t fence_ctx; /* the fence_context this job uses */
1245 bool vm_needs_flush; 1245 bool vm_needs_flush;
1246 unsigned vm_id; 1246 unsigned vm_id;
1247 uint64_t vm_pd_addr; 1247 uint64_t vm_pd_addr;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index e29e7b9ca3a6..56bde6436a1f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -989,7 +989,7 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
989 } 989 }
990 990
991 job->owner = p->filp; 991 job->owner = p->filp;
992 job->ctx = entity->fence_context; 992 job->fence_ctx = entity->fence_context;
993 p->fence = fence_get(&job->base.s_fence->finished); 993 p->fence = fence_get(&job->base.s_fence->finished);
994 cs->out.handle = amdgpu_ctx_add_fence(p->ctx, ring, p->fence); 994 cs->out.handle = amdgpu_ctx_add_fence(p->ctx, ring, p->fence);
995 job->uf_sequence = cs->out.handle; 995 job->uf_sequence = cs->out.handle;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
index 11f2fba4653d..04263f0fd1af 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
@@ -124,7 +124,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
124 bool skip_preamble, need_ctx_switch; 124 bool skip_preamble, need_ctx_switch;
125 unsigned patch_offset = ~0; 125 unsigned patch_offset = ~0;
126 struct amdgpu_vm *vm; 126 struct amdgpu_vm *vm;
127 uint64_t ctx; 127 uint64_t fence_ctx;
128 128
129 unsigned i; 129 unsigned i;
130 int r = 0; 130 int r = 0;
@@ -135,10 +135,10 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
135 /* ring tests don't use a job */ 135 /* ring tests don't use a job */
136 if (job) { 136 if (job) {
137 vm = job->vm; 137 vm = job->vm;
138 ctx = job->ctx; 138 fence_ctx = job->fence_ctx;
139 } else { 139 } else {
140 vm = NULL; 140 vm = NULL;
141 ctx = 0; 141 fence_ctx = 0;
142 } 142 }
143 143
144 if (!ring->ready) { 144 if (!ring->ready) {
@@ -174,8 +174,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
174 /* always set cond_exec_polling to CONTINUE */ 174 /* always set cond_exec_polling to CONTINUE */
175 *ring->cond_exe_cpu_addr = 1; 175 *ring->cond_exe_cpu_addr = 1;
176 176
177 skip_preamble = ring->current_ctx == ctx; 177 skip_preamble = ring->current_ctx == fence_ctx;
178 need_ctx_switch = ring->current_ctx != ctx; 178 need_ctx_switch = ring->current_ctx != fence_ctx;
179 for (i = 0; i < num_ibs; ++i) { 179 for (i = 0; i < num_ibs; ++i) {
180 ib = &ibs[i]; 180 ib = &ibs[i];
181 181
@@ -209,7 +209,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
209 if (patch_offset != ~0 && ring->funcs->patch_cond_exec) 209 if (patch_offset != ~0 && ring->funcs->patch_cond_exec)
210 amdgpu_ring_patch_cond_exec(ring, patch_offset); 210 amdgpu_ring_patch_cond_exec(ring, patch_offset);
211 211
212 ring->current_ctx = ctx; 212 ring->current_ctx = fence_ctx;
213 if (ring->funcs->emit_switch_buffer) 213 if (ring->funcs->emit_switch_buffer)
214 amdgpu_ring_emit_switch_buffer(ring); 214 amdgpu_ring_emit_switch_buffer(ring);
215 amdgpu_ring_commit(ring); 215 amdgpu_ring_commit(ring);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index 6674d40eb3ab..ac8d40168a47 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -124,7 +124,7 @@ int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring,
124 return r; 124 return r;
125 125
126 job->owner = owner; 126 job->owner = owner;
127 job->ctx = entity->fence_context; 127 job->fence_ctx = entity->fence_context;
128 *f = fence_get(&job->base.s_fence->finished); 128 *f = fence_get(&job->base.s_fence->finished);
129 amdgpu_job_free_resources(job); 129 amdgpu_job_free_resources(job);
130 amd_sched_entity_push_job(&job->base); 130 amd_sched_entity_push_job(&job->base);