aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r600.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-01-18 13:05:39 -0500
committerAlex Deucher <alexander.deucher@amd.com>2013-01-31 16:24:49 -0500
commit410a3418a88cc1273a281d347687f736fc39dd86 (patch)
tree9057195495a9f1ae1fa128c27b0fdfb09077d224 /drivers/gpu/drm/radeon/r600.c
parent9ff0744c6d7745c331a484a937160f4c2c056923 (diff)
drm/radeon: add a bios scratch asic hung helper
Used by all asic families from r600+. Flag for the vbios and later instances of the driver that the GPU is hung. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r--drivers/gpu/drm/radeon/r600.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index becb03e8b32f..a6208178a6f2 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -1254,6 +1254,18 @@ void r600_vram_scratch_fini(struct radeon_device *rdev)
1254 radeon_bo_unref(&rdev->vram_scratch.robj); 1254 radeon_bo_unref(&rdev->vram_scratch.robj);
1255} 1255}
1256 1256
1257void r600_set_bios_scratch_engine_hung(struct radeon_device *rdev, bool hung)
1258{
1259 u32 tmp = RREG32(R600_BIOS_3_SCRATCH);
1260
1261 if (hung)
1262 tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG;
1263 else
1264 tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG;
1265
1266 WREG32(R600_BIOS_3_SCRATCH, tmp);
1267}
1268
1257/* We doesn't check that the GPU really needs a reset we simply do the 1269/* We doesn't check that the GPU really needs a reset we simply do the
1258 * reset, it's up to the caller to determine if the GPU needs one. We 1270 * reset, it's up to the caller to determine if the GPU needs one. We
1259 * might add an helper function to check that. 1271 * might add an helper function to check that.
@@ -1389,6 +1401,8 @@ static int r600_gpu_soft_reset(struct radeon_device *rdev, u32 reset_mask)
1389 1401
1390 dev_info(rdev->dev, "GPU softreset: 0x%08X\n", reset_mask); 1402 dev_info(rdev->dev, "GPU softreset: 0x%08X\n", reset_mask);
1391 1403
1404 r600_set_bios_scratch_engine_hung(rdev, true);
1405
1392 rv515_mc_stop(rdev, &save); 1406 rv515_mc_stop(rdev, &save);
1393 if (r600_mc_wait_for_idle(rdev)) { 1407 if (r600_mc_wait_for_idle(rdev)) {
1394 dev_warn(rdev->dev, "Wait for MC idle timedout !\n"); 1408 dev_warn(rdev->dev, "Wait for MC idle timedout !\n");
@@ -1404,6 +1418,9 @@ static int r600_gpu_soft_reset(struct radeon_device *rdev, u32 reset_mask)
1404 mdelay(1); 1418 mdelay(1);
1405 1419
1406 rv515_mc_resume(rdev, &save); 1420 rv515_mc_resume(rdev, &save);
1421
1422 r600_set_bios_scratch_engine_hung(rdev, false);
1423
1407 return 0; 1424 return 0;
1408} 1425}
1409 1426