Skip to contentSkip to conversation

drm/radeon/kms: reorder display resume to avoid problems

PATCH In review Alex Deucher 2 participants 2 messages Dec 20, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon/kms: reorder display resume to avoid problems

On resume, we were attemping to unblank the displays before the timing and plls had be reprogrammed which led to atom timeouts waiting for things that are not yet programmed. Re-program the mode first, then reset the dpms state.

This fixes the infamous atombios timeouts on resume.

---
 drivers/gpu/drm/radeon/atombios_crtc.c |    3 ++-
 drivers/gpu/drm/radeon/radeon_device.c |    9 ++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/atombios_crtc.c +2 -1
index 6a4f090..b0ab185 100644
@@ -253,7 +253,8 @@ void atombios_crtc_dpms(struct drm_crtc *crtc, int mode)
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_OFF:
 		drm_vblank_pre_modeset(dev, radeon_crtc->crtc_id);
-		atombios_blank_crtc(crtc, ATOM_ENABLE);
+		if (radeon_crtc->enabled)
+			atombios_blank_crtc(crtc, ATOM_ENABLE);
 		if (ASIC_IS_DCE3(rdev))
 			atombios_enable_crtc_memreq(crtc, ATOM_DISABLE);
 		atombios_enable_crtc(crtc, ATOM_DISABLE);
drivers/gpu/drm/radeon/radeon_device.c +4 -5
index 5da80d5..fcf0acb 100644
@@ -925,11 +925,6 @@ int radeon_resume_kms(struct drm_device *dev)
 	radeon_pm_resume(rdev);
 	radeon_restore_bios_scratch_regs(rdev);
 
-	/* turn on display hw */
-	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
-		drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
-	}
-
 	radeon_fbdev_set_suspend(rdev, 0);
 	release_console_sem();
 
@@ -937,6 +932,10 @@ int radeon_resume_kms(struct drm_device *dev)
 	radeon_hpd_init(rdev);
 	/* blat the mode back in */
 	drm_helper_resume_force_mode(dev);
+	/* turn on display hw */
+	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
+		drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
+	}
 	return 0;
 }
 
Signature · 1 line
1.7.1.1
#1 lore raw

2010/12/20 Alex Deucher <[email protected]>:

Quoted 6 lines

On resume, we were attemping to unblank the displays before the timing and plls had be reprogrammed which led to atom timeouts waiting for things that are not yet programmed.  Re-program the mode first, then reset the dpms state.

This fixes the infamous atombios timeouts on resume.

Congratulations and thanks a lot! :)

Signature · 6 lines
Rafał

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable