AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] fix GFX8 dmaframe scheme (v2)
@ 2016-08-29  8:55 Monk Liu
       [not found] ` <1472460939-31571-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Monk Liu @ 2016-08-29  8:55 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Monk Liu

rebase patches on latest staging04.6

Monk Liu (4):
  drm/amdgpu:add switch buffer to end of CS (v2)
  drm/amdgpu:new method to sync ce&de
  drm/amdgpu:change job->ctx field name
  drm/amdgpu:implement CONTEXT_CONTROL

 drivers/gpu/drm/amd/amdgpu/amdgpu.h     | 13 ++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c  | 14 +++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c  | 28 ++++++++-------
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c |  2 +-
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c   | 63 +++++++++++++++++++++++----------
 5 files changed, 87 insertions(+), 33 deletions(-)

-- 
1.9.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [PATCH 0/4] fix GFX8 dma frame scheme
@ 2016-08-29  3:13 Monk Liu
       [not found] ` <1472440438-9429-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Monk Liu @ 2016-08-29  3:13 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Monk Liu

Sync gfx8.0 DMAframe to windows scheme:
1)only one SWITCH_BUFFER to the end of CS
2)insert 128 nop before&after VM flushy to prevent CE vm fault
3)use CONTEXT_CONTROL to dynamically control preamble IB skipping

Monk Liu (4):
  drm/amdgpu:add switch buffer to end of CS
  drm/amdgpu:new method to sync ce&de
  drm/amdgpu:change job->ctx field name
  drm/amdgpu:implement CONTEXT_CONTROL

 drivers/gpu/drm/amd/amdgpu/amdgpu.h     | 13 ++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c  | 14 +++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c  | 28 ++++++++-------
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c |  2 +-
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c   | 63 +++++++++++++++++++++++----------
 5 files changed, 87 insertions(+), 33 deletions(-)

-- 
1.9.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [PATCH 1/4] drm/amdgpu:add switch buffer to end of CS
@ 2016-08-29  2:55 Monk Liu
       [not found] ` <1472439337-8002-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Monk Liu @ 2016-08-29  2:55 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Monk Liu

sync switch buffer scheme with windows kmd for gfx v8,
Now always and only insert one switch buffer to the
end of CS.

Change-Id: Ief8539b2ad91ccb38b9adbfb54e27d8282f3a3bd
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h    |  2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c |  2 ++
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c  | 13 +++++++------
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index cb0098a..a935831 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -338,6 +338,7 @@ struct amdgpu_ring_funcs {
 	void (*end_use)(struct amdgpu_ring *ring);
 	void (*emit_wreg) (struct amdgpu_ring *ring, uint32_t offset, uint32_t val);
 	void (*emit_rreg) (struct amdgpu_ring *ring, uint32_t offset);
+	void (*emit_switch_buffer) (struct amdgpu_ring *ring);
 };
 
 /*
@@ -2372,6 +2373,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
 #define amdgpu_ring_emit_hdp_invalidate(r) (r)->funcs->emit_hdp_invalidate((r))
 #define amdgpu_ring_emit_wreg(r, i, v) (r)->funcs->emit_wreg((r), (i), (v))
 #define amdgpu_ring_emit_rreg(r, i) (r)->funcs->emit_rreg((r), (i))
+#define amdgpu_ring_emit_switch_buffer(r) (r)->funcs->emit_switch_buffer((r))
 #define amdgpu_ring_pad_ib(r, ib) ((r)->funcs->pad_ib((r), (ib)))
 #define amdgpu_ring_init_cond_exec(r) (r)->funcs->init_cond_exec((r))
 #define amdgpu_ring_patch_cond_exec(r,o) (r)->funcs->patch_cond_exec((r),(o))
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
index a31d7ef..029ee79 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
@@ -210,6 +210,8 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
 		amdgpu_ring_patch_cond_exec(ring, patch_offset);
 
 	ring->current_ctx = ctx;
+	if (ring->funcs->emit_switch_buffer)
+		amdgpu_ring_emit_switch_buffer(ring);
 	amdgpu_ring_commit(ring);
 	return 0;
 }
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index dfa2288..26fced0 100755
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -5936,12 +5936,6 @@ static void gfx_v8_0_ring_emit_ib_gfx(struct amdgpu_ring *ring,
 {
 	u32 header, control = 0;
 
-	/* insert SWITCH_BUFFER packet before first IB in the ring frame */
-	if (ctx_switch) {
-		amdgpu_ring_write(ring, PACKET3(PACKET3_SWITCH_BUFFER, 0));
-		amdgpu_ring_write(ring, 0);
-	}
-
 	if (ib->flags & AMDGPU_IB_FLAG_CE)
 		header = PACKET3(PACKET3_INDIRECT_BUFFER_CONST, 2);
 	else
@@ -6170,6 +6164,12 @@ static void gfx_v8_0_ring_emit_wreg_kiq(struct amdgpu_ring *ring, u32 idx, u32 v
 	amdgpu_ring_write(ring, val);
 }
 
+static void gfx_v8_ring_emit_sb(struct amdgpu_ring *ring)
+{
+	amdgpu_ring_write(ring, PACKET3(PACKET3_SWITCH_BUFFER, 0));
+	amdgpu_ring_write(ring, 0);
+}
+
 static void gfx_v8_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,
 						 enum amdgpu_interrupt_state state)
 {
@@ -6477,6 +6477,7 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = {
 	.test_ib = gfx_v8_0_ring_test_ib,
 	.insert_nop = amdgpu_ring_insert_nop,
 	.pad_ib = amdgpu_ring_generic_pad_ib,
+	.emit_switch_buffer = gfx_v8_ring_emit_sb,
 };
 
 static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = {
-- 
1.9.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-09-06  2:58 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-29  8:55 [PATCH 0/4] fix GFX8 dmaframe scheme (v2) Monk Liu
     [not found] ` <1472460939-31571-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2016-08-29  8:55   ` [PATCH 1/4] drm/amdgpu:add switch buffer to end of CS (v2) Monk Liu
2016-08-29  8:55   ` [PATCH 2/4] drm/amdgpu:new method to sync ce&de Monk Liu
2016-08-29  8:55   ` [PATCH 3/4] drm/amdgpu:change job->ctx field name Monk Liu
2016-08-29  8:55   ` [PATCH 4/4] drm/amdgpu:implement CONTEXT_CONTROL Monk Liu
2016-08-29  9:15   ` [PATCH 0/4] fix GFX8 dmaframe scheme (v2) Christian König
  -- strict thread matches above, loose matches on Subject: below --
2016-08-29  3:13 [PATCH 0/4] fix GFX8 dma frame scheme Monk Liu
     [not found] ` <1472440438-9429-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2016-08-29  3:13   ` [PATCH 2/4] drm/amdgpu:new method to sync ce&de Monk Liu
2016-08-29  2:55 [PATCH 1/4] drm/amdgpu:add switch buffer to end of CS Monk Liu
     [not found] ` <1472439337-8002-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2016-08-29  2:55   ` [PATCH 2/4] drm/amdgpu:new method to sync ce&de Monk Liu
     [not found]     ` <1472439337-8002-2-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2016-08-29  8:05       ` Christian König
     [not found]         ` <283cbf94-05bf-4d30-c03f-731dd34ac653-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-08-29  8:14           ` Liu, Monk
     [not found]             ` <MWHPR12MB1182364E8ADFBB9B2AAFD47A84E10-Gy0DoCVfaSVhjnLHdLm0OQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-08-29  8:25               ` Christian König
     [not found]                 ` <1c8cab37-70cb-3e17-b651-b3b6b2b5b8e0-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-08-29  8:28                   ` Liu, Monk
     [not found]                     ` <MWHPR12MB118285051FDBA2381204FE0384E10-Gy0DoCVfaSVhjnLHdLm0OQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-08-29  8:54                       ` Christian König
2016-08-29 13:37                   ` Deucher, Alexander
     [not found]                     ` <MWHPR12MB16948C33AC82C6566DBA5C5EF7E10-Gy0DoCVfaSW4WA4dJ5YXGAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-09-05 19:13                       ` Marek Olšák
     [not found]                         ` <CAAxE2A6s0ephQBxb=b8XU01wNbQ3aCX51thv4DrLCs6VckLxzw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-06  2:58                           ` Liu, Monk
2016-08-29 13:21       ` Deucher, Alexander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox