Hi Dave, > +int nouveau_dynamic_power_set_state(struct drm_device *dev, int state) > +{ > + struct nouveau_drm *drm = nouveau_drm(dev); > + pm_message_t pmm = { .event = PM_EVENT_SUSPEND }; > + > + if (state == DRM_SWITCH_POWER_DYNAMIC_OFF) { > + dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF; In existing set_state code, this switch_power_state is first set to DRM_SWITCH_POWER_CHANGING. Is it sensible to do the same thing here? > + drm_kms_helper_poll_disable(drm->dev); > + vga_switcheroo_set_dynamic_switch(dev->pdev, VGA_SWITCHEROO_OFF, false); > + nouveau_switcheroo_optimus_dsm(); > + nouveau_drm_suspend(drm->dev->pdev, pmm); > + vga_switcheroo_set_dynamic_switch(dev->pdev, VGA_SWITCHEROO_OFF, true); > + } else if (state == DRM_SWITCH_POWER_ON) { > + vga_switcheroo_set_dynamic_switch(dev->pdev, VGA_SWITCHEROO_ON, true); > + nouveau_drm_resume(dev->pdev); > + vga_switcheroo_set_dynamic_switch(dev->pdev, VGA_SWITCHEROO_ON, false); > + drm_kms_helper_poll_enable(dev); > + dev->switch_power_state = DRM_SWITCH_POWER_ON; Same here. > + } > + > + return 0; > +} Regards, Peter _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel