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>
dev_info(rdev->dev, "GPU softreset: 0x%08X\n", reset_mask);
+ r600_set_bios_scratch_engine_hung(rdev, true);
+
evergreen_mc_stop(rdev, &save);
if (evergreen_mc_wait_for_idle(rdev)) {
dev_warn(rdev->dev, "Wait for MC idle timedout !\n");
udelay(50);
evergreen_mc_resume(rdev, &save);
+
+ r600_set_bios_scratch_engine_hung(rdev, false);
+
return 0;
}
if (reset_mask == 0)
return 0;
+ r600_set_bios_scratch_engine_hung(rdev, true);
+
dev_info(rdev->dev, "GPU softreset: 0x%08X\n", reset_mask);
dev_info(rdev->dev, " VM_CONTEXT0_PROTECTION_FAULT_ADDR 0x%08X\n",
udelay(50);
evergreen_mc_resume(rdev, &save);
+
+ r600_set_bios_scratch_engine_hung(rdev, false);
+
return 0;
}
radeon_bo_unref(&rdev->vram_scratch.robj);
}
+void r600_set_bios_scratch_engine_hung(struct radeon_device *rdev, bool hung)
+{
+ u32 tmp = RREG32(R600_BIOS_3_SCRATCH);
+
+ if (hung)
+ tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG;
+ else
+ tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG;
+
+ WREG32(R600_BIOS_3_SCRATCH, tmp);
+}
+
/* We doesn't check that the GPU really needs a reset we simply do the
* reset, it's up to the caller to determine if the GPU needs one. We
* might add an helper function to check that.
dev_info(rdev->dev, "GPU softreset: 0x%08X\n", reset_mask);
+ r600_set_bios_scratch_engine_hung(rdev, true);
+
rv515_mc_stop(rdev, &save);
if (r600_mc_wait_for_idle(rdev)) {
dev_warn(rdev->dev, "Wait for MC idle timedout !\n");
mdelay(1);
rv515_mc_resume(rdev, &save);
+
+ r600_set_bios_scratch_engine_hung(rdev, false);
+
return 0;
}
/* Common functions */
/* AGP */
extern int radeon_gpu_reset(struct radeon_device *rdev);
+extern void r600_set_bios_scratch_engine_hung(struct radeon_device *rdev, bool hung);
extern void radeon_agp_disable(struct radeon_device *rdev);
extern int radeon_modeset_init(struct radeon_device *rdev);
extern void radeon_modeset_fini(struct radeon_device *rdev);
dev_info(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS));
+ r600_set_bios_scratch_engine_hung(rdev, true);
+
evergreen_mc_stop(rdev, &save);
if (radeon_mc_wait_for_idle(rdev)) {
dev_warn(rdev->dev, "Wait for MC idle timedout !\n");
udelay(50);
evergreen_mc_resume(rdev, &save);
+
+ r600_set_bios_scratch_engine_hung(rdev, false);
+
return 0;
}