Re: [PATCH 4/5] nouveau: add dynamic gpu power off support.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux