aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c19
1 files changed, 18 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 7984292f9282..a59e0fdf5a97 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
@@ -2264,6 +2264,22 @@ static void gfx_v7_0_ring_emit_ib_compute(struct amdgpu_ring *ring,
2264 unsigned vmid = AMDGPU_JOB_GET_VMID(job); 2264 unsigned vmid = AMDGPU_JOB_GET_VMID(job);
2265 u32 control = INDIRECT_BUFFER_VALID | ib->length_dw | (vmid << 24); 2265 u32 control = INDIRECT_BUFFER_VALID | ib->length_dw | (vmid << 24);
2266 2266
2267 /* Currently, there is a high possibility to get wave ID mismatch
2268 * between ME and GDS, leading to a hw deadlock, because ME generates
2269 * different wave IDs than the GDS expects. This situation happens
2270 * randomly when at least 5 compute pipes use GDS ordered append.
2271 * The wave IDs generated by ME are also wrong after suspend/resume.
2272 * Those are probably bugs somewhere else in the kernel driver.
2273 *
2274 * Writing GDS_COMPUTE_MAX_WAVE_ID resets wave ID counters in ME and
2275 * GDS to 0 for this ring (me/pipe).
2276 */
2277 if (ib->flags & AMDGPU_IB_FLAG_RESET_GDS_MAX_WAVE_ID) {
2278 amdgpu_ring_write(ring, PACKET3(PACKET3_SET_CONFIG_REG, 1));
2279 amdgpu_ring_write(ring, mmGDS_COMPUTE_MAX_WAVE_ID - PACKET3_SET_CONFIG_REG_START);
2280 amdgpu_ring_write(ring, ring->adev->gds.gds_compute_max_wave_id);
2281 }
2282
2267 amdgpu_ring_write(ring, PACKET3(PACKET3_INDIRECT_BUFFER, 2)); 2283 amdgpu_ring_write(ring, PACKET3(PACKET3_INDIRECT_BUFFER, 2));
2268 amdgpu_ring_write(ring, 2284 amdgpu_ring_write(ring,
2269#ifdef __BIG_ENDIAN 2285#ifdef __BIG_ENDIAN
@@ -5000,7 +5016,7 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = {
5000 7 + /* gfx_v7_0_ring_emit_pipeline_sync */ 5016 7 + /* gfx_v7_0_ring_emit_pipeline_sync */
5001 CIK_FLUSH_GPU_TLB_NUM_WREG * 5 + 7 + /* gfx_v7_0_ring_emit_vm_flush */ 5017 CIK_FLUSH_GPU_TLB_NUM_WREG * 5 + 7 + /* gfx_v7_0_ring_emit_vm_flush */
5002 7 + 7 + 7, /* gfx_v7_0_ring_emit_fence_compute x3 for user fence, vm fence */ 5018 7 + 7 + 7, /* gfx_v7_0_ring_emit_fence_compute x3 for user fence, vm fence */
5003 .emit_ib_size = 4, /* gfx_v7_0_ring_emit_ib_compute */ 5019 .emit_ib_size = 7, /* gfx_v7_0_ring_emit_ib_compute */
5004 .emit_ib = gfx_v7_0_ring_emit_ib_compute, 5020 .emit_ib = gfx_v7_0_ring_emit_ib_compute,
5005 .emit_fence = gfx_v7_0_ring_emit_fence_compute, 5021 .emit_fence = gfx_v7_0_ring_emit_fence_compute,
5006 .emit_pipeline_sync = gfx_v7_0_ring_emit_pipeline_sync, 5022 .emit_pipeline_sync = gfx_v7_0_ring_emit_pipeline_sync,
@@ -5057,6 +5073,7 @@ static void gfx_v7_0_set_gds_init(struct amdgpu_device *adev)
5057 adev->gds.mem.total_size = RREG32(mmGDS_VMID0_SIZE); 5073 adev->gds.mem.total_size = RREG32(mmGDS_VMID0_SIZE);
5058 adev->gds.gws.total_size = 64; 5074 adev->gds.gws.total_size = 64;
5059 adev->gds.oa.total_size = 16; 5075 adev->gds.oa.total_size = 16;
5076 adev->gds.gds_compute_max_wave_id = RREG32(mmGDS_COMPUTE_MAX_WAVE_ID);
5060 5077
5061 if (adev->gds.mem.total_size == 64 * 1024) { 5078 if (adev->gds.mem.total_size == 64 * 1024) {
5062 adev->gds.mem.gfx_partition_size = 4096; 5079 adev->gds.mem.gfx_partition_size = 4096;