diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 15 | 
1 files changed, 14 insertions, 1 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c index 06fddba54445..1a745cf93f47 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c @@ -2105,6 +2105,18 @@ static void gfx_v7_0_ring_emit_hdp_flush(struct amdgpu_ring *ring)  	amdgpu_ring_write(ring, 0x20); /* poll interval */  } +static void gfx_v7_0_ring_emit_vgt_flush(struct amdgpu_ring *ring) +{ +	amdgpu_ring_write(ring, PACKET3(PACKET3_EVENT_WRITE, 0)); +	amdgpu_ring_write(ring, EVENT_TYPE(VS_PARTIAL_FLUSH) | +		EVENT_INDEX(4)); + +	amdgpu_ring_write(ring, PACKET3(PACKET3_EVENT_WRITE, 0)); +	amdgpu_ring_write(ring, EVENT_TYPE(VGT_FLUSH) | +		EVENT_INDEX(0)); +} + +  /**   * gfx_v7_0_ring_emit_hdp_invalidate - emit an hdp invalidate on the cp   * @@ -2260,6 +2272,7 @@ static void gfx_v7_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags)  	dw2 |= 0x80000000; /* set load_enable otherwise this package is just NOPs */  	if (flags & AMDGPU_HAVE_CTX_SWITCH) { +		gfx_v7_0_ring_emit_vgt_flush(ring);  		/* set load_global_config & load_global_uconfig */  		dw2 |= 0x8001;  		/* set load_cs_sh_regs */ @@ -5153,7 +5166,7 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_gfx = {  		12 + 12 + 12 + /* gfx_v7_0_ring_emit_fence_gfx x3 for user fence, vm fence */  		7 + 4 + /* gfx_v7_0_ring_emit_pipeline_sync */  		17 + 6 + /* gfx_v7_0_ring_emit_vm_flush */ -		3, /* gfx_v7_ring_emit_cntxcntl */ +		3 + 4, /* gfx_v7_ring_emit_cntxcntl including vgt flush*/  	.emit_ib_size = 4, /* gfx_v7_0_ring_emit_ib_gfx */  	.emit_ib = gfx_v7_0_ring_emit_ib_gfx,  	.emit_fence = gfx_v7_0_ring_emit_fence_gfx, | 
