diff options
author | Ken Wang <Ken.Wang@amd.com> | 2017-08-15 05:16:08 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-08-18 12:02:11 -0400 |
commit | d5de797ff1c91157ddefd7102aaf5f87ff222746 (patch) | |
tree | 11ab80bc244bab62ba3819c58b5e82cd036ef0e4 | |
parent | 33476319c0e8b3543c27d883e7a478ceb8648f80 (diff) |
drm/amdgpu: fix vega10 graphic hang issue in S3 test
mmVGT_INDEX_TYPE has no default value, need to make sure
it's initialized when gfx is initialized.
Signed-off-by: Ken Wang <Ken.Wang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/soc15d.h | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index b39f81dda847..69182eeca264 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | |||
@@ -2157,7 +2157,7 @@ static int gfx_v9_0_cp_gfx_start(struct amdgpu_device *adev) | |||
2157 | struct amdgpu_ring *ring = &adev->gfx.gfx_ring[0]; | 2157 | struct amdgpu_ring *ring = &adev->gfx.gfx_ring[0]; |
2158 | const struct cs_section_def *sect = NULL; | 2158 | const struct cs_section_def *sect = NULL; |
2159 | const struct cs_extent_def *ext = NULL; | 2159 | const struct cs_extent_def *ext = NULL; |
2160 | int r, i; | 2160 | int r, i, tmp; |
2161 | 2161 | ||
2162 | /* init the CP */ | 2162 | /* init the CP */ |
2163 | WREG32_SOC15(GC, 0, mmCP_MAX_CONTEXT, adev->gfx.config.max_hw_contexts - 1); | 2163 | WREG32_SOC15(GC, 0, mmCP_MAX_CONTEXT, adev->gfx.config.max_hw_contexts - 1); |
@@ -2165,7 +2165,7 @@ static int gfx_v9_0_cp_gfx_start(struct amdgpu_device *adev) | |||
2165 | 2165 | ||
2166 | gfx_v9_0_cp_gfx_enable(adev, true); | 2166 | gfx_v9_0_cp_gfx_enable(adev, true); |
2167 | 2167 | ||
2168 | r = amdgpu_ring_alloc(ring, gfx_v9_0_get_csb_size(adev) + 4); | 2168 | r = amdgpu_ring_alloc(ring, gfx_v9_0_get_csb_size(adev) + 4 + 3); |
2169 | if (r) { | 2169 | if (r) { |
2170 | DRM_ERROR("amdgpu: cp failed to lock ring (%d).\n", r); | 2170 | DRM_ERROR("amdgpu: cp failed to lock ring (%d).\n", r); |
2171 | return r; | 2171 | return r; |
@@ -2203,6 +2203,12 @@ static int gfx_v9_0_cp_gfx_start(struct amdgpu_device *adev) | |||
2203 | amdgpu_ring_write(ring, 0x8000); | 2203 | amdgpu_ring_write(ring, 0x8000); |
2204 | amdgpu_ring_write(ring, 0x8000); | 2204 | amdgpu_ring_write(ring, 0x8000); |
2205 | 2205 | ||
2206 | amdgpu_ring_write(ring, PACKET3(PACKET3_SET_UCONFIG_REG,1)); | ||
2207 | tmp = (PACKET3_SET_UCONFIG_REG_INDEX_TYPE | | ||
2208 | (SOC15_REG_OFFSET(GC, 0, mmVGT_INDEX_TYPE) - PACKET3_SET_UCONFIG_REG_START)); | ||
2209 | amdgpu_ring_write(ring, tmp); | ||
2210 | amdgpu_ring_write(ring, 0); | ||
2211 | |||
2206 | amdgpu_ring_commit(ring); | 2212 | amdgpu_ring_commit(ring); |
2207 | 2213 | ||
2208 | return 0; | 2214 | return 0; |
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15d.h b/drivers/gpu/drm/amd/amdgpu/soc15d.h index e79befd80eed..7f408f85fdb6 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc15d.h +++ b/drivers/gpu/drm/amd/amdgpu/soc15d.h | |||
@@ -250,6 +250,7 @@ | |||
250 | #define PACKET3_SET_UCONFIG_REG 0x79 | 250 | #define PACKET3_SET_UCONFIG_REG 0x79 |
251 | #define PACKET3_SET_UCONFIG_REG_START 0x0000c000 | 251 | #define PACKET3_SET_UCONFIG_REG_START 0x0000c000 |
252 | #define PACKET3_SET_UCONFIG_REG_END 0x0000c400 | 252 | #define PACKET3_SET_UCONFIG_REG_END 0x0000c400 |
253 | #define PACKET3_SET_UCONFIG_REG_INDEX_TYPE (2 << 28) | ||
253 | #define PACKET3_SCRATCH_RAM_WRITE 0x7D | 254 | #define PACKET3_SCRATCH_RAM_WRITE 0x7D |
254 | #define PACKET3_SCRATCH_RAM_READ 0x7E | 255 | #define PACKET3_SCRATCH_RAM_READ 0x7E |
255 | #define PACKET3_LOAD_CONST_RAM 0x80 | 256 | #define PACKET3_LOAD_CONST_RAM 0x80 |