mmc: msm: fix compile error on MSM7x30
[safe/jmp/linux-2.6] / drivers / gpu / drm / nouveau / nouveau_state.c
index c667a11..147e59c 100644 (file)
@@ -376,12 +376,15 @@ out_err:
 static void nouveau_switcheroo_set_state(struct pci_dev *pdev,
                                         enum vga_switcheroo_state state)
 {
+       struct drm_device *dev = pci_get_drvdata(pdev);
        pm_message_t pmm = { .event = PM_EVENT_SUSPEND };
        if (state == VGA_SWITCHEROO_ON) {
                printk(KERN_ERR "VGA switcheroo: switched nouveau on\n");
                nouveau_pci_resume(pdev);
+               drm_kms_helper_poll_enable(dev);
        } else {
                printk(KERN_ERR "VGA switcheroo: switched nouveau off\n");
+               drm_kms_helper_poll_disable(dev);
                nouveau_pci_suspend(pdev, pmm);
        }
 }
@@ -516,8 +519,10 @@ nouveau_card_init(struct drm_device *dev)
 
        dev_priv->init_state = NOUVEAU_CARD_INIT_DONE;
 
-       if (drm_core_check_feature(dev, DRIVER_MODESET))
+       if (drm_core_check_feature(dev, DRIVER_MODESET)) {
                nouveau_fbcon_init(dev);
+               drm_kms_helper_poll_init(dev);
+       }
 
        return 0;
 
@@ -844,6 +849,7 @@ int nouveau_unload(struct drm_device *dev)
        struct drm_nouveau_private *dev_priv = dev->dev_private;
 
        if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+               drm_kms_helper_poll_fini(dev);
                nouveau_fbcon_fini(dev);
                if (dev_priv->card_type >= NV_50)
                        nv50_display_destroy(dev);
@@ -910,6 +916,9 @@ int nouveau_ioctl_getparam(struct drm_device *dev, void *data,
        case NOUVEAU_GETPARAM_VM_VRAM_BASE:
                getparam->value = dev_priv->vm_vram_base;
                break;
+       case NOUVEAU_GETPARAM_PTIMER_TIME:
+               getparam->value = dev_priv->engine.timer.read(dev);
+               break;
        case NOUVEAU_GETPARAM_GRAPH_UNITS:
                /* NV40 and NV50 versions are quite different, but register
                 * address is the same. User is supposed to know the card