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.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by Alex Deucher and committed by Dave Airlie a93f344d 86f5c9ed

+6 -6
+2 -1
drivers/gpu/drm/radeon/atombios_crtc.c
··· 253 253 case DRM_MODE_DPMS_SUSPEND: 254 254 case DRM_MODE_DPMS_OFF: 255 255 drm_vblank_pre_modeset(dev, radeon_crtc->crtc_id); 256 - atombios_blank_crtc(crtc, ATOM_ENABLE); 256 + if (radeon_crtc->enabled) 257 + atombios_blank_crtc(crtc, ATOM_ENABLE); 257 258 if (ASIC_IS_DCE3(rdev)) 258 259 atombios_enable_crtc_memreq(crtc, ATOM_DISABLE); 259 260 atombios_enable_crtc(crtc, ATOM_DISABLE);
+4 -5
drivers/gpu/drm/radeon/radeon_device.c
··· 910 910 radeon_pm_resume(rdev); 911 911 radeon_restore_bios_scratch_regs(rdev); 912 912 913 - /* turn on display hw */ 914 - list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 915 - drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); 916 - } 917 - 918 913 radeon_fbdev_set_suspend(rdev, 0); 919 914 release_console_sem(); 920 915 ··· 917 922 radeon_hpd_init(rdev); 918 923 /* blat the mode back in */ 919 924 drm_helper_resume_force_mode(dev); 925 + /* turn on display hw */ 926 + list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 927 + drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); 928 + } 920 929 return 0; 921 930 } 922 931