Skip to contentSkip to conversation

drm/amdgpu:in cntx_ctrl we need insert meta-init for CE/DE(V2)

PATCH In review Monk Liu 2 participants 2 messages Jan 17, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Monk Liu

author
#0 lore raw

PATCH 1/1 drm/amdgpu:in cntx_ctrl we need insert meta-init for CE/DE(V2)

to support SRIOV preemption.

v2:
fix emit_frame_size

Change-Id I9f3534149b132756e5cd9292d48474e50306936b
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +9 -1
index fdc2cb5..52cb37d 100644
@@ -6703,6 +6703,10 @@ static void gfx_v8_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags)
 {
 	uint32_t dw2 = 0;
 
+	if (amdgpu_sriov_vf(ring->adev))
+		gfx_v8_0_ring_emit_ce_meta_init(ring,
+			(flags & AMDGPU_VM_DOMAIN) ? AMDGPU_CSA_VADDR : ring->adev->virt.csa_vmid0_addr);
+
 	dw2 |= 0x80000000; /* set load_enable otherwise this package is just NOPs */
 	if (flags & AMDGPU_HAVE_CTX_SWITCH) {
 		gfx_v8_0_ring_emit_vgt_flush(ring);
@@ -6727,6 +6731,10 @@ static void gfx_v8_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags)
 	amdgpu_ring_write(ring, PACKET3(PACKET3_CONTEXT_CONTROL, 1));
 	amdgpu_ring_write(ring, dw2);
 	amdgpu_ring_write(ring, 0);
+
+	if (amdgpu_sriov_vf(ring->adev))
+		gfx_v8_0_ring_emit_de_meta_init(ring,
+			(flags & AMDGPU_VM_DOMAIN) ? AMDGPU_CSA_VADDR : ring->adev->virt.csa_vmid0_addr);
 }
 
 static void gfx_v8_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,
@@ -6976,7 +6984,7 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = {
 		7 + /* gfx_v8_0_ring_emit_pipeline_sync */
 		128 + 19 + /* gfx_v8_0_ring_emit_vm_flush */
 		2 + /* gfx_v8_ring_emit_sb */
-		3 + 4, /* gfx_v8_ring_emit_cntxcntl including vgt flush */
+		3 + 4 + 29, /* gfx_v8_ring_emit_cntxcntl including vgt flush/meta-data */
 	.emit_ib_size =	4, /* gfx_v8_0_ring_emit_ib_gfx */
 	.emit_ib = gfx_v8_0_ring_emit_ib_gfx,
 	.emit_fence = gfx_v8_0_ring_emit_fence_gfx,
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1484623171-24527-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Am 17.01.2017 um 04:19 schrieb Monk Liu:

Quoted 7 lines

to support SRIOV preemption.

v2:
fix emit_frame_size

Change-Id I9f3534149b132756e5cd9292d48474e50306936b

Sorry didn't saw this patch before writing my review mail on the set.

This one is Reviewed-by: Christian König <[email protected]>.

Regards,
Christian.

Quoted 31 lines
---
  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +8 -0
index fdc2cb5..52cb37d 100644
@@ -6703,6 +6703,10 @@ static void gfx_v8_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags)
  {
  	uint32_t dw2 = 0;
 
+	if (amdgpu_sriov_vf(ring->adev))
+		gfx_v8_0_ring_emit_ce_meta_init(ring,
+			(flags & AMDGPU_VM_DOMAIN) ? AMDGPU_CSA_VADDR : ring->adev->virt.csa_vmid0_addr);
+
  	dw2 |= 0x80000000; /* set load_enable otherwise this package is just NOPs */
  	if (flags & AMDGPU_HAVE_CTX_SWITCH) {
  		gfx_v8_0_ring_emit_vgt_flush(ring);
@@ -6727,6 +6731,10 @@ static void gfx_v8_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags)
  	amdgpu_ring_write(ring, PACKET3(PACKET3_CONTEXT_CONTROL, 1));
  	amdgpu_ring_write(ring, dw2);
  	amdgpu_ring_write(ring, 0);
+
+	if (amdgpu_sriov_vf(ring->adev))
+		gfx_v8_0_ring_emit_de_meta_init(ring,
+			(flags & AMDGPU_VM_DOMAIN) ? AMDGPU_CSA_VADDR : ring->adev->virt.csa_vmid0_addr);
  }
 
  static void gfx_v8_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,

drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = { · line 6990

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +1 -1
@@ -6976,7 +6984,7 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = {
  		7 + /* gfx_v8_0_ring_emit_pipeline_sync */
  		128 + 19 + /* gfx_v8_0_ring_emit_vm_flush */
  		2 + /* gfx_v8_ring_emit_sb */
-		3 + 4, /* gfx_v8_ring_emit_cntxcntl including vgt flush */
+		3 + 4 + 29, /* gfx_v8_ring_emit_cntxcntl including vgt flush/meta-data */
  	.emit_ib_size =	4, /* gfx_v8_0_ring_emit_ib_gfx */
  	.emit_ib = gfx_v8_0_ring_emit_ib_gfx,
  	.emit_fence = gfx_v8_0_ring_emit_fence_gfx,

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx