Ben Skeggs wrote:

> From: Ben Skeggs <[email protected]>
>
> Backport of fixes from upstream commit:
> 9430738d80223a1cd791a2baa74fa170d3df1262
>
> Signed-off-by: Ben Skeggs <[email protected]>

Headless mode was added in commit 03bc9675d358 (allow modeset module
option to select 'headless mode', 2011-07-04) which hit mainline in
the 3.2 merge window.  Older kernels presumably don't need this.

[...]
> --- a/drivers/gpu/drm/nouveau/nouveau_drv.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drv.c
> @@ -188,11 +188,13 @@ nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t 
> pm_state)
>       if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
>               return 0;
>  
> -     NV_INFO(dev, "Disabling display...\n");
> -     nouveau_display_fini(dev);
> -

That's from f62b27db6b54 (drm/nouveau: shutdown display on
suspend/hibernate, 2011-11-09) which hit mainline in 3.3.

> -     NV_INFO(dev, "Disabling fbcon...\n");
> -     nouveau_fbcon_set_suspend(dev, 1);

This order of operations comes from cf41d53bf5b9 (drm/nouveau: re-jig
fbcon suspend/resume process a little, 2011-11-09), also from 3.3.

> +     if (dev->mode_config.num_crtc) {
> +             NV_INFO(dev, "Disabling display...\n");
> +             nouveau_display_fini(dev);
> +
> +             NV_INFO(dev, "Disabling fbcon...\n");
> +             nouveau_fbcon_set_suspend(dev, 1);
> +     }

I imagine it would make sense to skip the same operations in
headless mode in the order they arrive in 3.2.

[...]
> @@ -359,10 +361,12 @@ nouveau_pci_resume(struct pci_dev *pdev)
>                       NV_ERROR(dev, "Could not pin/map cursor.\n");
>       }
>  
> -     nouveau_fbcon_set_suspend(dev, 0);
> -     nouveau_fbcon_zfill_all(dev);

Similarly, these calls moved here in cf41d53bf5b9 (re-jig fbcon
suspend/resume...).

> -
> -     nouveau_display_init(dev);

And this call was added in f62b27db6b54 (shutdown display on ...).

> +     if (dev->mode_config.num_crtc) {
> +             nouveau_fbcon_set_suspend(dev, 0);
> +             nouveau_fbcon_zfill_all(dev);
> +
> +             nouveau_display_init(dev);
> +     }

Conclusions:

 * the backport makes sense for kernels >= 3.4 (though it's not
   tested)

 * with a tiny bit of work the patch should work on 3.2, too

Thanks,
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to