Skip to content

Commit 9ed2c99

Browse files
Marek Olšákalexdeucher
authored andcommitted
drm/amdgpu: fix transform feedback GDS hang on gfx10 (v2)
v2: update emit_ib_size (though it's still wrong because it was wrong before) Signed-off-by: Marek Olšák <[email protected]> Acked-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 535cfa7 commit 9ed2c99

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_gds.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ struct amdgpu_gds {
3131
uint32_t gds_size;
3232
uint32_t gws_size;
3333
uint32_t oa_size;
34-
uint32_t gds_compute_max_wave_id;
34+
uint32_t gds_compute_max_wave_id;
35+
uint32_t vgt_gs_max_wave_id;
3536
};
3637

3738
struct amdgpu_gds_reg_offset {

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4197,6 +4197,15 @@ static void gfx_v10_0_ring_emit_ib_gfx(struct amdgpu_ring *ring,
41974197
unsigned vmid = AMDGPU_JOB_GET_VMID(job);
41984198
u32 header, control = 0;
41994199

4200+
/* Prevent a hw deadlock due to a wave ID mismatch between ME and GDS.
4201+
* This resets the wave ID counters. (needed by transform feedback)
4202+
* TODO: This might only be needed on a VMID switch when we change
4203+
* the GDS OA mapping, not sure.
4204+
*/
4205+
amdgpu_ring_write(ring, PACKET3(PACKET3_SET_CONFIG_REG, 1));
4206+
amdgpu_ring_write(ring, mmVGT_GS_MAX_WAVE_ID);
4207+
amdgpu_ring_write(ring, ring->adev->gds.vgt_gs_max_wave_id);
4208+
42004209
if (ib->flags & AMDGPU_IB_FLAG_CE)
42014210
header = PACKET3(PACKET3_INDIRECT_BUFFER_CNST, 2);
42024211
else
@@ -4930,7 +4939,7 @@ static const struct amdgpu_ring_funcs gfx_v10_0_ring_funcs_gfx = {
49304939
5 + /* HDP_INVL */
49314940
8 + 8 + /* FENCE x2 */
49324941
2, /* SWITCH_BUFFER */
4933-
.emit_ib_size = 4, /* gfx_v10_0_ring_emit_ib_gfx */
4942+
.emit_ib_size = 7, /* gfx_v10_0_ring_emit_ib_gfx */
49344943
.emit_ib = gfx_v10_0_ring_emit_ib_gfx,
49354944
.emit_fence = gfx_v10_0_ring_emit_fence,
49364945
.emit_pipeline_sync = gfx_v10_0_ring_emit_pipeline_sync,
@@ -5078,10 +5087,9 @@ static void gfx_v10_0_set_gds_init(struct amdgpu_device *adev)
50785087
/* init asic gds info */
50795088
switch (adev->asic_type) {
50805089
case CHIP_NAVI10:
5081-
adev->gds.gds_size = 0x10000;
5082-
break;
50835090
default:
50845091
adev->gds.gds_size = 0x10000;
5092+
adev->gds.vgt_gs_max_wave_id = 0x3ff;
50855093
break;
50865094
}
50875095

0 commit comments

Comments
 (0)