diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-02-01 00:17:07 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-03-13 03:14:57 -0400 |
commit | 7d3a766b6aa4e293e72bfd6add477f05ac7fdf5a (patch) | |
tree | 4ac0175b60a521dc0ca8b669cda633b607fcc05c /drivers/gpu/drm/nouveau/nouveau_state.c | |
parent | 950c44b6ddc0dfb44e59fdb031e09567a1b391c0 (diff) |
drm/nouveau/pm: init only after display subsystem has been created
This patch fixes an oops cause by pm_trigger accessing the (uninitialised)
crtc list.
Reported-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_state.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_state.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index a36386c00d9b..9d6c3ff22e81 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c | |||
@@ -632,8 +632,6 @@ nouveau_card_init(struct drm_device *dev) | |||
632 | if (ret) | 632 | if (ret) |
633 | goto out_ttmvram; | 633 | goto out_ttmvram; |
634 | 634 | ||
635 | nouveau_pm_init(dev); | ||
636 | |||
637 | if (!dev_priv->noaccel) { | 635 | if (!dev_priv->noaccel) { |
638 | switch (dev_priv->card_type) { | 636 | switch (dev_priv->card_type) { |
639 | case NV_04: | 637 | case NV_04: |
@@ -738,11 +736,12 @@ nouveau_card_init(struct drm_device *dev) | |||
738 | goto out_irq; | 736 | goto out_irq; |
739 | 737 | ||
740 | nouveau_backlight_init(dev); | 738 | nouveau_backlight_init(dev); |
739 | nouveau_pm_init(dev); | ||
741 | 740 | ||
742 | if (dev_priv->eng[NVOBJ_ENGINE_GR]) { | 741 | if (dev_priv->eng[NVOBJ_ENGINE_GR]) { |
743 | ret = nouveau_fence_init(dev); | 742 | ret = nouveau_fence_init(dev); |
744 | if (ret) | 743 | if (ret) |
745 | goto out_disp; | 744 | goto out_pm; |
746 | 745 | ||
747 | ret = nouveau_channel_alloc(dev, &dev_priv->channel, NULL, | 746 | ret = nouveau_channel_alloc(dev, &dev_priv->channel, NULL, |
748 | NvDmaFB, NvDmaTT); | 747 | NvDmaFB, NvDmaTT); |
@@ -766,7 +765,8 @@ out_chan: | |||
766 | nouveau_channel_put_unlocked(&dev_priv->channel); | 765 | nouveau_channel_put_unlocked(&dev_priv->channel); |
767 | out_fence: | 766 | out_fence: |
768 | nouveau_fence_fini(dev); | 767 | nouveau_fence_fini(dev); |
769 | out_disp: | 768 | out_pm: |
769 | nouveau_pm_fini(dev); | ||
770 | nouveau_backlight_exit(dev); | 770 | nouveau_backlight_exit(dev); |
771 | nouveau_display_destroy(dev); | 771 | nouveau_display_destroy(dev); |
772 | out_irq: | 772 | out_irq: |
@@ -783,7 +783,6 @@ out_engine: | |||
783 | dev_priv->eng[e]->destroy(dev,e ); | 783 | dev_priv->eng[e]->destroy(dev,e ); |
784 | } | 784 | } |
785 | } | 785 | } |
786 | nouveau_pm_fini(dev); | ||
787 | nouveau_mem_gart_fini(dev); | 786 | nouveau_mem_gart_fini(dev); |
788 | out_ttmvram: | 787 | out_ttmvram: |
789 | nouveau_mem_vram_fini(dev); | 788 | nouveau_mem_vram_fini(dev); |
@@ -826,6 +825,7 @@ static void nouveau_card_takedown(struct drm_device *dev) | |||
826 | nouveau_fence_fini(dev); | 825 | nouveau_fence_fini(dev); |
827 | } | 826 | } |
828 | 827 | ||
828 | nouveau_pm_fini(dev); | ||
829 | nouveau_backlight_exit(dev); | 829 | nouveau_backlight_exit(dev); |
830 | nouveau_display_destroy(dev); | 830 | nouveau_display_destroy(dev); |
831 | 831 | ||
@@ -854,8 +854,6 @@ static void nouveau_card_takedown(struct drm_device *dev) | |||
854 | engine->instmem.takedown(dev); | 854 | engine->instmem.takedown(dev); |
855 | nouveau_gpuobj_takedown(dev); | 855 | nouveau_gpuobj_takedown(dev); |
856 | 856 | ||
857 | nouveau_pm_fini(dev); | ||
858 | |||
859 | nouveau_gpio_destroy(dev); | 857 | nouveau_gpio_destroy(dev); |
860 | engine->vram.takedown(dev); | 858 | engine->vram.takedown(dev); |
861 | engine->fb.takedown(dev); | 859 | engine->fb.takedown(dev); |