Commit 3b4c0abb authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/kms: move drm_crtc_force_disable_all() earlier

nouveau_display_fini() is responsible for quiescing the hardware, so
this is where such actions belong.

More than that, nouveau_display_fini() switches off the receiving of
sink irqs, which MST will require while shutting down an active head.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent d000edd3
......@@ -382,13 +382,16 @@ nouveau_display_init(struct drm_device *dev)
}
void
nouveau_display_fini(struct drm_device *dev)
nouveau_display_fini(struct drm_device *dev, bool suspend)
{
struct nouveau_display *disp = nouveau_display(dev);
struct nouveau_drm *drm = nouveau_drm(dev);
struct drm_connector *connector;
int head;
if (!suspend)
drm_crtc_force_disable_all(dev);
/* Make sure that drm and hw vblank irqs get properly disabled. */
for (head = 0; head < dev->mode_config.num_crtc; head++)
drm_vblank_off(dev, head);
......@@ -553,7 +556,6 @@ nouveau_display_destroy(struct drm_device *dev)
nouveau_display_vblank_fini(dev);
drm_kms_helper_poll_fini(dev);
drm_crtc_force_disable_all(dev);
drm_mode_config_cleanup(dev);
if (disp->dtor)
......@@ -570,7 +572,7 @@ nouveau_display_suspend(struct drm_device *dev, bool runtime)
{
struct drm_crtc *crtc;
nouveau_display_fini(dev);
nouveau_display_fini(dev, true);
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
struct nouveau_framebuffer *nouveau_fb;
......
......@@ -64,7 +64,7 @@ nouveau_display(struct drm_device *dev)
int nouveau_display_create(struct drm_device *dev);
void nouveau_display_destroy(struct drm_device *dev);
int nouveau_display_init(struct drm_device *dev);
void nouveau_display_fini(struct drm_device *dev);
void nouveau_display_fini(struct drm_device *dev, bool suspend);
int nouveau_display_suspend(struct drm_device *dev, bool runtime);
void nouveau_display_resume(struct drm_device *dev, bool runtime);
int nouveau_display_vblank_enable(struct drm_device *, unsigned int);
......
......@@ -519,7 +519,7 @@ nouveau_drm_unload(struct drm_device *dev)
nouveau_debugfs_fini(drm);
if (dev->mode_config.num_crtc)
nouveau_display_fini(dev);
nouveau_display_fini(dev, false);
nouveau_display_destroy(dev);
nouveau_bios_takedown(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment