aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_device.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 39b033b441d2..b012cbbc3ed5 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -144,6 +144,11 @@ void radeon_program_register_sequence(struct radeon_device *rdev,
144 } 144 }
145} 145}
146 146
147void radeon_pci_config_reset(struct radeon_device *rdev)
148{
149 pci_write_config_dword(rdev->pdev, 0x7c, RADEON_ASIC_RESET_DATA);
150}
151
147/** 152/**
148 * radeon_surface_init - Clear GPU surface registers. 153 * radeon_surface_init - Clear GPU surface registers.
149 * 154 *
@@ -249,7 +254,7 @@ void radeon_scratch_free(struct radeon_device *rdev, uint32_t reg)
249 * Init doorbell driver information (CIK) 254 * Init doorbell driver information (CIK)
250 * Returns 0 on success, error on failure. 255 * Returns 0 on success, error on failure.
251 */ 256 */
252int radeon_doorbell_init(struct radeon_device *rdev) 257static int radeon_doorbell_init(struct radeon_device *rdev)
253{ 258{
254 /* doorbell bar mapping */ 259 /* doorbell bar mapping */
255 rdev->doorbell.base = pci_resource_start(rdev->pdev, 2); 260 rdev->doorbell.base = pci_resource_start(rdev->pdev, 2);
@@ -278,7 +283,7 @@ int radeon_doorbell_init(struct radeon_device *rdev)
278 * 283 *
279 * Tear down doorbell driver information (CIK) 284 * Tear down doorbell driver information (CIK)
280 */ 285 */
281void radeon_doorbell_fini(struct radeon_device *rdev) 286static void radeon_doorbell_fini(struct radeon_device *rdev)
282{ 287{
283 iounmap(rdev->doorbell.ptr); 288 iounmap(rdev->doorbell.ptr);
284 rdev->doorbell.ptr = NULL; 289 rdev->doorbell.ptr = NULL;
@@ -1330,6 +1335,7 @@ int radeon_device_init(struct radeon_device *rdev,
1330 if (r) 1335 if (r)
1331 return r; 1336 return r;
1332 } 1337 }
1338
1333 if ((radeon_testing & 1)) { 1339 if ((radeon_testing & 1)) {
1334 if (rdev->accel_working) 1340 if (rdev->accel_working)
1335 radeon_test_moves(rdev); 1341 radeon_test_moves(rdev);
@@ -1455,7 +1461,6 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend, bool fbcon)
1455 1461
1456 radeon_save_bios_scratch_regs(rdev); 1462 radeon_save_bios_scratch_regs(rdev);
1457 1463
1458 radeon_pm_suspend(rdev);
1459 radeon_suspend(rdev); 1464 radeon_suspend(rdev);
1460 radeon_hpd_fini(rdev); 1465 radeon_hpd_fini(rdev);
1461 /* evict remaining vram memory */ 1466 /* evict remaining vram memory */
@@ -1516,14 +1521,22 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon)
1516 if (r) 1521 if (r)
1517 DRM_ERROR("ib ring test failed (%d).\n", r); 1522 DRM_ERROR("ib ring test failed (%d).\n", r);
1518 1523
1519 radeon_pm_resume(rdev); 1524 if (rdev->pm.dpm_enabled) {
1525 /* do dpm late init */
1526 r = radeon_pm_late_init(rdev);
1527 if (r) {
1528 rdev->pm.dpm_enabled = false;
1529 DRM_ERROR("radeon_pm_late_init failed, disabling dpm\n");
1530 }
1531 }
1532
1520 radeon_restore_bios_scratch_regs(rdev); 1533 radeon_restore_bios_scratch_regs(rdev);
1521 1534
1522 if (fbcon) { 1535 if (fbcon) {
1523 radeon_fbdev_set_suspend(rdev, 0); 1536 radeon_fbdev_set_suspend(rdev, 0);
1524 console_unlock(); 1537 console_unlock();
1525 } 1538 }
1526 1539
1527 /* init dig PHYs, disp eng pll */ 1540 /* init dig PHYs, disp eng pll */
1528 if (rdev->is_atom_bios) { 1541 if (rdev->is_atom_bios) {
1529 radeon_atom_encoder_init(rdev); 1542 radeon_atom_encoder_init(rdev);