drm/radeon/kms: handle vblanks properly with dpms on
authorAlex Deucher <alexdeucher@gmail.com>
Wed, 2 Dec 2009 16:46:52 +0000 (11:46 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 22:04:36 +0000 (14:04 -0800)
commit 500b758725314ab1b5316eb0caa5b0fa26740e6b upstream.

avivo chips

Copied from pre-avivo code.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/gpu/drm/radeon/atombios_crtc.c

index c15287a590ffca7395784f78ff763883b1e739ce..c6777cbee4741fff781e1f2950b67ac0d8e9186d 100644 (file)
@@ -241,6 +241,7 @@ void atombios_crtc_dpms(struct drm_crtc *crtc, int mode)
 {
        struct drm_device *dev = crtc->dev;
        struct radeon_device *rdev = dev->dev_private;
+       struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
 
        switch (mode) {
        case DRM_MODE_DPMS_ON:
@@ -248,20 +249,19 @@ void atombios_crtc_dpms(struct drm_crtc *crtc, int mode)
                if (ASIC_IS_DCE3(rdev))
                        atombios_enable_crtc_memreq(crtc, 1);
                atombios_blank_crtc(crtc, 0);
+               drm_vblank_post_modeset(dev, radeon_crtc->crtc_id);
+               radeon_crtc_load_lut(crtc);
                break;
        case DRM_MODE_DPMS_STANDBY:
        case DRM_MODE_DPMS_SUSPEND:
        case DRM_MODE_DPMS_OFF:
+               drm_vblank_pre_modeset(dev, radeon_crtc->crtc_id);
                atombios_blank_crtc(crtc, 1);
                if (ASIC_IS_DCE3(rdev))
                        atombios_enable_crtc_memreq(crtc, 0);
                atombios_enable_crtc(crtc, 0);
                break;
        }
-
-       if (mode != DRM_MODE_DPMS_OFF) {
-               radeon_crtc_load_lut(crtc);
-       }
 }
 
 static void