diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-02-01 15:17:07 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-03-13 17:14:57 +1000 |
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 a36386c00d9..9d6c3ff22e8 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) if (ret) goto out_ttmvram; - nouveau_pm_init(dev); - if (!dev_priv->noaccel) { switch (dev_priv->card_type) { case NV_04: @@ -738,11 +736,12 @@ nouveau_card_init(struct drm_device *dev) goto out_irq; nouveau_backlight_init(dev); + nouveau_pm_init(dev); if (dev_priv->eng[NVOBJ_ENGINE_GR]) { ret = nouveau_fence_init(dev); if (ret) - goto out_disp; + goto out_pm; ret = nouveau_channel_alloc(dev, &dev_priv->channel, NULL, NvDmaFB, NvDmaTT); @@ -766,7 +765,8 @@ out_chan: nouveau_channel_put_unlocked(&dev_priv->channel); out_fence: nouveau_fence_fini(dev); -out_disp: +out_pm: + nouveau_pm_fini(dev); nouveau_backlight_exit(dev); nouveau_display_destroy(dev); out_irq: @@ -783,7 +783,6 @@ out_engine: dev_priv->eng[e]->destroy(dev,e ); } } - nouveau_pm_fini(dev); nouveau_mem_gart_fini(dev); out_ttmvram: nouveau_mem_vram_fini(dev); @@ -826,6 +825,7 @@ static void nouveau_card_takedown(struct drm_device *dev) nouveau_fence_fini(dev); } + nouveau_pm_fini(dev); nouveau_backlight_exit(dev); nouveau_display_destroy(dev); @@ -854,8 +854,6 @@ static void nouveau_card_takedown(struct drm_device *dev) engine->instmem.takedown(dev); nouveau_gpuobj_takedown(dev); - nouveau_pm_fini(dev); - nouveau_gpio_destroy(dev); engine->vram.takedown(dev); engine->fb.takedown(dev); |