aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu.h
diff options
context:
space:
mode:
authorMonk Liu <Monk.Liu@amd.com>2016-08-26 01:28:28 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-09-14 15:10:29 -0400
commit753ad49c9fdfc732972b0d03f2889f473ed35e59 (patch)
tree5b56188b3eb258fdcb167503979d657a0e9699be /drivers/gpu/drm/amd/amdgpu/amdgpu.h
parent1db422de72c31fcf81f31311468a747aad389fa5 (diff)
drm/amdgpu:implement CONTEXT_CONTROL (v5)
v1: for gfx8, use CONTEXT_CONTROL package to dynamically skip preamble CEIB and other load_xxx command in sequence. v2: support GFX7 as well. remove cntxcntl in compute ring funcs because CPC doesn't support this packet. v3: fix reduntant judgement in cntxcntl. v4: some cleanups, don't change cs_submit() v5: keep old MESA supported & bump up KMS version. Signed-off-by: Monk Liu <Monk.Liu@amd.com> Ack-by: Chunming Zhou <David1.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 10ec29c50077..717c3b4e1d54 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -320,6 +320,7 @@ struct amdgpu_ring_funcs {
320 void (*begin_use)(struct amdgpu_ring *ring); 320 void (*begin_use)(struct amdgpu_ring *ring);
321 void (*end_use)(struct amdgpu_ring *ring); 321 void (*end_use)(struct amdgpu_ring *ring);
322 void (*emit_switch_buffer) (struct amdgpu_ring *ring); 322 void (*emit_switch_buffer) (struct amdgpu_ring *ring);
323 void (*emit_cntxcntl) (struct amdgpu_ring *ring, uint32_t flags);
323}; 324};
324 325
325/* 326/*
@@ -966,6 +967,7 @@ struct amdgpu_ctx {
966 spinlock_t ring_lock; 967 spinlock_t ring_lock;
967 struct fence **fences; 968 struct fence **fences;
968 struct amdgpu_ctx_ring rings[AMDGPU_MAX_RINGS]; 969 struct amdgpu_ctx_ring rings[AMDGPU_MAX_RINGS];
970 bool preamble_presented;
969}; 971};
970 972
971struct amdgpu_ctx_mgr { 973struct amdgpu_ctx_mgr {
@@ -1231,6 +1233,10 @@ struct amdgpu_cs_parser {
1231 struct amdgpu_bo_list_entry uf_entry; 1233 struct amdgpu_bo_list_entry uf_entry;
1232}; 1234};
1233 1235
1236#define AMDGPU_PREAMBLE_IB_PRESENT (1 << 0) /* bit set means command submit involves a preamble IB */
1237#define AMDGPU_PREAMBLE_IB_PRESENT_FIRST (1 << 1) /* bit set means preamble IB is first presented in belonging context */
1238#define AMDGPU_HAVE_CTX_SWITCH (1 << 2) /* bit set means context switch occured */
1239
1234struct amdgpu_job { 1240struct amdgpu_job {
1235 struct amd_sched_job base; 1241 struct amd_sched_job base;
1236 struct amdgpu_device *adev; 1242 struct amdgpu_device *adev;
@@ -1239,6 +1245,7 @@ struct amdgpu_job {
1239 struct amdgpu_sync sync; 1245 struct amdgpu_sync sync;
1240 struct amdgpu_ib *ibs; 1246 struct amdgpu_ib *ibs;
1241 struct fence *fence; /* the hw fence */ 1247 struct fence *fence; /* the hw fence */
1248 uint32_t preamble_status;
1242 uint32_t num_ibs; 1249 uint32_t num_ibs;
1243 void *owner; 1250 void *owner;
1244 uint64_t fence_ctx; /* the fence_context this job uses */ 1251 uint64_t fence_ctx; /* the fence_context this job uses */
@@ -2276,6 +2283,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
2276#define amdgpu_ring_emit_hdp_flush(r) (r)->funcs->emit_hdp_flush((r)) 2283#define amdgpu_ring_emit_hdp_flush(r) (r)->funcs->emit_hdp_flush((r))
2277#define amdgpu_ring_emit_hdp_invalidate(r) (r)->funcs->emit_hdp_invalidate((r)) 2284#define amdgpu_ring_emit_hdp_invalidate(r) (r)->funcs->emit_hdp_invalidate((r))
2278#define amdgpu_ring_emit_switch_buffer(r) (r)->funcs->emit_switch_buffer((r)) 2285#define amdgpu_ring_emit_switch_buffer(r) (r)->funcs->emit_switch_buffer((r))
2286#define amdgpu_ring_emit_cntxcntl(r, d) (r)->funcs->emit_cntxcntl((r), (d))
2279#define amdgpu_ring_pad_ib(r, ib) ((r)->funcs->pad_ib((r), (ib))) 2287#define amdgpu_ring_pad_ib(r, ib) ((r)->funcs->pad_ib((r), (ib)))
2280#define amdgpu_ring_init_cond_exec(r) (r)->funcs->init_cond_exec((r)) 2288#define amdgpu_ring_init_cond_exec(r) (r)->funcs->init_cond_exec((r))
2281#define amdgpu_ring_patch_cond_exec(r,o) (r)->funcs->patch_cond_exec((r),(o)) 2289#define amdgpu_ring_patch_cond_exec(r,o) (r)->funcs->patch_cond_exec((r),(o))