drm/vmwgfx: Implement fbdev on kms v2
[linux-2.6-block.git] / drivers / gpu / drm / vmwgfx / vmwgfx_drv.c
index bcf1962ecf06463cc0592a868296c3ebab6622f5..18921444672f4339edbc88f9f60f8605cab29bbc 100644 (file)
@@ -1120,23 +1120,6 @@ static long vmw_compat_ioctl(struct file *filp, unsigned int cmd,
 
 static void vmw_lastclose(struct drm_device *dev)
 {
-       struct drm_crtc *crtc;
-       struct drm_mode_set set;
-       int ret;
-
-       set.x = 0;
-       set.y = 0;
-       set.fb = NULL;
-       set.mode = NULL;
-       set.connectors = NULL;
-       set.num_connectors = 0;
-
-       list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
-               set.crtc = crtc;
-               ret = drm_mode_set_config_internal(&set);
-               WARN_ON(ret != 0);
-       }
-
 }
 
 static void vmw_master_init(struct vmw_master *vmaster)
@@ -1321,6 +1304,8 @@ static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val,
 
        switch (val) {
        case PM_HIBERNATION_PREPARE:
+               if (dev_priv->enable_fb)
+                       vmw_fb_off(dev_priv);
                ttm_suspend_lock(&dev_priv->reservation_sem);
 
                /*
@@ -1337,7 +1322,8 @@ static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val,
        case PM_POST_RESTORE:
                vmw_fence_fifo_up(dev_priv->fman);
                ttm_suspend_unlock(&dev_priv->reservation_sem);
-
+               if (dev_priv->enable_fb)
+                       vmw_fb_on(dev_priv);
                break;
        case PM_RESTORE_PREPARE:
                break;