diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-05-25 00:48:50 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-06-23 01:57:28 -0400 |
commit | aba99a8400e0b1ca9e6306e3a71013cc7a25bc29 (patch) | |
tree | 4c32e2ebe724e8317dbb72d5f7cf6db3712f75af | |
parent | d4409cc7e26b5f20b38a791e4c29b6c221e95acf (diff) |
drm/nouveau: default to noaccel on 0xc1/0xc8/0xce for now
Until we know these should work properly, would much rather default to
noaccel than risk giving people corruption/hangs out of the box..
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_state.c | 26 |
3 files changed, 24 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c index 02c6f37d8bd7..bdee1a6956e7 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.c +++ b/drivers/gpu/drm/nouveau/nouveau_drv.c | |||
@@ -73,7 +73,7 @@ int nouveau_ignorelid = 0; | |||
73 | module_param_named(ignorelid, nouveau_ignorelid, int, 0400); | 73 | module_param_named(ignorelid, nouveau_ignorelid, int, 0400); |
74 | 74 | ||
75 | MODULE_PARM_DESC(noaccel, "Disable all acceleration"); | 75 | MODULE_PARM_DESC(noaccel, "Disable all acceleration"); |
76 | int nouveau_noaccel = 0; | 76 | int nouveau_noaccel = -1; |
77 | module_param_named(noaccel, nouveau_noaccel, int, 0400); | 77 | module_param_named(noaccel, nouveau_noaccel, int, 0400); |
78 | 78 | ||
79 | MODULE_PARM_DESC(nofbaccel, "Disable fbcon acceleration"); | 79 | MODULE_PARM_DESC(nofbaccel, "Disable fbcon acceleration"); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 9c56331941e2..276fac7b7569 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
@@ -608,6 +608,7 @@ enum nouveau_card_type { | |||
608 | 608 | ||
609 | struct drm_nouveau_private { | 609 | struct drm_nouveau_private { |
610 | struct drm_device *dev; | 610 | struct drm_device *dev; |
611 | bool noaccel; | ||
611 | 612 | ||
612 | /* the card type, takes NV_* as values */ | 613 | /* the card type, takes NV_* as values */ |
613 | enum nouveau_card_type card_type; | 614 | enum nouveau_card_type card_type; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index dd6f30574a76..f65811c3eb4d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c | |||
@@ -565,7 +565,7 @@ nouveau_card_init(struct drm_device *dev) | |||
565 | if (ret) | 565 | if (ret) |
566 | goto out_timer; | 566 | goto out_timer; |
567 | 567 | ||
568 | if (!nouveau_noaccel) { | 568 | if (!dev_priv->noaccel) { |
569 | switch (dev_priv->card_type) { | 569 | switch (dev_priv->card_type) { |
570 | case NV_04: | 570 | case NV_04: |
571 | nv04_graph_create(dev); | 571 | nv04_graph_create(dev); |
@@ -677,10 +677,10 @@ out_vblank: | |||
677 | drm_vblank_cleanup(dev); | 677 | drm_vblank_cleanup(dev); |
678 | engine->display.destroy(dev); | 678 | engine->display.destroy(dev); |
679 | out_fifo: | 679 | out_fifo: |
680 | if (!nouveau_noaccel) | 680 | if (!dev_priv->noaccel) |
681 | engine->fifo.takedown(dev); | 681 | engine->fifo.takedown(dev); |
682 | out_engine: | 682 | out_engine: |
683 | if (!nouveau_noaccel) { | 683 | if (!dev_priv->noaccel) { |
684 | for (e = e - 1; e >= 0; e--) { | 684 | for (e = e - 1; e >= 0; e--) { |
685 | if (!dev_priv->eng[e]) | 685 | if (!dev_priv->eng[e]) |
686 | continue; | 686 | continue; |
@@ -725,7 +725,7 @@ static void nouveau_card_takedown(struct drm_device *dev) | |||
725 | nouveau_channel_put_unlocked(&dev_priv->channel); | 725 | nouveau_channel_put_unlocked(&dev_priv->channel); |
726 | } | 726 | } |
727 | 727 | ||
728 | if (!nouveau_noaccel) { | 728 | if (!dev_priv->noaccel) { |
729 | engine->fifo.takedown(dev); | 729 | engine->fifo.takedown(dev); |
730 | for (e = NVOBJ_ENGINE_NR - 1; e >= 0; e--) { | 730 | for (e = NVOBJ_ENGINE_NR - 1; e >= 0; e--) { |
731 | if (dev_priv->eng[e]) { | 731 | if (dev_priv->eng[e]) { |
@@ -936,6 +936,24 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) | |||
936 | NV_INFO(dev, "Detected an NV%2x generation card (0x%08x)\n", | 936 | NV_INFO(dev, "Detected an NV%2x generation card (0x%08x)\n", |
937 | dev_priv->card_type, reg0); | 937 | dev_priv->card_type, reg0); |
938 | 938 | ||
939 | /* Determine whether we'll attempt acceleration or not, some | ||
940 | * cards are disabled by default here due to them being known | ||
941 | * non-functional, or never been tested due to lack of hw. | ||
942 | */ | ||
943 | dev_priv->noaccel = !!nouveau_noaccel; | ||
944 | if (nouveau_noaccel == -1) { | ||
945 | switch (dev_priv->chipset) { | ||
946 | case 0xc1: /* known broken */ | ||
947 | case 0xc8: /* never tested */ | ||
948 | case 0xce: /* never tested */ | ||
949 | dev_priv->noaccel = true; | ||
950 | break; | ||
951 | default: | ||
952 | dev_priv->noaccel = false; | ||
953 | break; | ||
954 | } | ||
955 | } | ||
956 | |||
939 | ret = nouveau_remove_conflicting_drivers(dev); | 957 | ret = nouveau_remove_conflicting_drivers(dev); |
940 | if (ret) | 958 | if (ret) |
941 | goto err_mmio; | 959 | goto err_mmio; |