diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-05-25 01:22:33 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-06-06 19:22:03 -0400 |
commit | 18b54c4d5893f32641d4961563c0f196cc04dc83 (patch) | |
tree | a8362038630b7852cd5369a4e44d3d5ebbec81c6 /drivers/gpu/drm/nouveau/nouveau_state.c | |
parent | cdf81a235f11c8a55023c6b181d21d519a8a5967 (diff) |
drm/nouveau: don't create accel engine objects when noaccel=1
Fixes various potential oopses.
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 | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index 0c698eb3ee3b..80218887e0a0 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c | |||
@@ -564,68 +564,68 @@ nouveau_card_init(struct drm_device *dev) | |||
564 | if (ret) | 564 | if (ret) |
565 | goto out_timer; | 565 | goto out_timer; |
566 | 566 | ||
567 | switch (dev_priv->card_type) { | 567 | if (!nouveau_noaccel) { |
568 | case NV_04: | 568 | switch (dev_priv->card_type) { |
569 | nv04_graph_create(dev); | 569 | case NV_04: |
570 | break; | 570 | nv04_graph_create(dev); |
571 | case NV_10: | 571 | break; |
572 | nv10_graph_create(dev); | 572 | case NV_10: |
573 | break; | 573 | nv10_graph_create(dev); |
574 | case NV_20: | 574 | break; |
575 | case NV_30: | 575 | case NV_20: |
576 | nv20_graph_create(dev); | 576 | case NV_30: |
577 | break; | 577 | nv20_graph_create(dev); |
578 | case NV_40: | 578 | break; |
579 | nv40_graph_create(dev); | 579 | case NV_40: |
580 | break; | 580 | nv40_graph_create(dev); |
581 | case NV_50: | 581 | break; |
582 | nv50_graph_create(dev); | 582 | case NV_50: |
583 | break; | 583 | nv50_graph_create(dev); |
584 | case NV_C0: | 584 | break; |
585 | nvc0_graph_create(dev); | 585 | case NV_C0: |
586 | break; | 586 | nvc0_graph_create(dev); |
587 | default: | 587 | break; |
588 | break; | 588 | default: |
589 | } | 589 | break; |
590 | 590 | } | |
591 | switch (dev_priv->chipset) { | ||
592 | case 0x84: | ||
593 | case 0x86: | ||
594 | case 0x92: | ||
595 | case 0x94: | ||
596 | case 0x96: | ||
597 | case 0xa0: | ||
598 | nv84_crypt_create(dev); | ||
599 | break; | ||
600 | } | ||
601 | 591 | ||
602 | switch (dev_priv->card_type) { | ||
603 | case NV_50: | ||
604 | switch (dev_priv->chipset) { | 592 | switch (dev_priv->chipset) { |
605 | case 0xa3: | 593 | case 0x84: |
606 | case 0xa5: | 594 | case 0x86: |
607 | case 0xa8: | 595 | case 0x92: |
608 | case 0xaf: | 596 | case 0x94: |
609 | nva3_copy_create(dev); | 597 | case 0x96: |
598 | case 0xa0: | ||
599 | nv84_crypt_create(dev); | ||
610 | break; | 600 | break; |
611 | } | 601 | } |
612 | break; | ||
613 | case NV_C0: | ||
614 | nvc0_copy_create(dev, 0); | ||
615 | nvc0_copy_create(dev, 1); | ||
616 | break; | ||
617 | default: | ||
618 | break; | ||
619 | } | ||
620 | 602 | ||
621 | if (dev_priv->card_type == NV_40) | 603 | switch (dev_priv->card_type) { |
622 | nv40_mpeg_create(dev); | 604 | case NV_50: |
623 | else | 605 | switch (dev_priv->chipset) { |
624 | if (dev_priv->card_type == NV_50 && | 606 | case 0xa3: |
625 | (dev_priv->chipset < 0x98 || dev_priv->chipset == 0xa0)) | 607 | case 0xa5: |
626 | nv50_mpeg_create(dev); | 608 | case 0xa8: |
609 | case 0xaf: | ||
610 | nva3_copy_create(dev); | ||
611 | break; | ||
612 | } | ||
613 | break; | ||
614 | case NV_C0: | ||
615 | nvc0_copy_create(dev, 0); | ||
616 | nvc0_copy_create(dev, 1); | ||
617 | break; | ||
618 | default: | ||
619 | break; | ||
620 | } | ||
621 | |||
622 | if (dev_priv->card_type == NV_40) | ||
623 | nv40_mpeg_create(dev); | ||
624 | else | ||
625 | if (dev_priv->card_type == NV_50 && | ||
626 | (dev_priv->chipset < 0x98 || dev_priv->chipset == 0xa0)) | ||
627 | nv50_mpeg_create(dev); | ||
627 | 628 | ||
628 | if (!nouveau_noaccel) { | ||
629 | for (e = 0; e < NVOBJ_ENGINE_NR; e++) { | 629 | for (e = 0; e < NVOBJ_ENGINE_NR; e++) { |
630 | if (dev_priv->eng[e]) { | 630 | if (dev_priv->eng[e]) { |
631 | ret = dev_priv->eng[e]->init(dev, e); | 631 | ret = dev_priv->eng[e]->init(dev, e); |