diff options
author | Tom St Denis <tom.stdenis@amd.com> | 2016-11-07 14:07:59 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-11-11 10:21:09 -0500 |
commit | 3ee73ed8540a937e1c6b79ee8bee1277bf8e4a6b (patch) | |
tree | 2bf11aa56c27c5d62a098a5d71ca76472baa43b3 /drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | |
parent | 25069e0696f8410dc391c909cc31693f440566e6 (diff) |
drm/amd/amdgpu: add wave reader to gfx v6
Add support for the debugfs wave reader.
Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c index dc038f07a56d..77b5918f606f 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | |||
@@ -2807,9 +2807,45 @@ static void gfx_v6_ring_emit_cntxcntl(struct amdgpu_ring *ring, uint32_t flags) | |||
2807 | amdgpu_ring_write(ring, 0); | 2807 | amdgpu_ring_write(ring, 0); |
2808 | } | 2808 | } |
2809 | 2809 | ||
2810 | |||
2811 | static uint32_t wave_read_ind(struct amdgpu_device *adev, uint32_t simd, uint32_t wave, uint32_t address) | ||
2812 | { | ||
2813 | WREG32(mmSQ_IND_INDEX, | ||
2814 | (wave << SQ_IND_INDEX__WAVE_ID__SHIFT) | | ||
2815 | (simd << SQ_IND_INDEX__SIMD_ID__SHIFT) | | ||
2816 | (address << SQ_IND_INDEX__INDEX__SHIFT) | | ||
2817 | (SQ_IND_INDEX__FORCE_READ_MASK)); | ||
2818 | return RREG32(mmSQ_IND_DATA); | ||
2819 | } | ||
2820 | |||
2821 | static void gfx_v6_0_read_wave_data(struct amdgpu_device *adev, uint32_t simd, uint32_t wave, uint32_t *dst, int *no_fields) | ||
2822 | { | ||
2823 | /* type 0 wave data */ | ||
2824 | dst[(*no_fields)++] = 0; | ||
2825 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_STATUS); | ||
2826 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_PC_LO); | ||
2827 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_PC_HI); | ||
2828 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_EXEC_LO); | ||
2829 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_EXEC_HI); | ||
2830 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_HW_ID); | ||
2831 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_INST_DW0); | ||
2832 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_INST_DW1); | ||
2833 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_GPR_ALLOC); | ||
2834 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_LDS_ALLOC); | ||
2835 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_TRAPSTS); | ||
2836 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_IB_STS); | ||
2837 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_TBA_LO); | ||
2838 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_TBA_HI); | ||
2839 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_TMA_LO); | ||
2840 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_TMA_HI); | ||
2841 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_IB_DBG0); | ||
2842 | dst[(*no_fields)++] = wave_read_ind(adev, simd, wave, ixSQ_WAVE_M0); | ||
2843 | } | ||
2844 | |||
2810 | static const struct amdgpu_gfx_funcs gfx_v6_0_gfx_funcs = { | 2845 | static const struct amdgpu_gfx_funcs gfx_v6_0_gfx_funcs = { |
2811 | .get_gpu_clock_counter = &gfx_v6_0_get_gpu_clock_counter, | 2846 | .get_gpu_clock_counter = &gfx_v6_0_get_gpu_clock_counter, |
2812 | .select_se_sh = &gfx_v6_0_select_se_sh, | 2847 | .select_se_sh = &gfx_v6_0_select_se_sh, |
2848 | .read_wave_data = &gfx_v6_0_read_wave_data, | ||
2813 | }; | 2849 | }; |
2814 | 2850 | ||
2815 | static int gfx_v6_0_early_init(void *handle) | 2851 | static int gfx_v6_0_early_init(void *handle) |