nouveau: disable accel on nva3/nva5/nva8

This commit is contained in:
Ben Skeggs 2010-08-10 10:02:52 +10:00
parent 52c0e26861
commit f2d0da0d23
2 changed files with 114 additions and 1 deletions

View File

@ -0,0 +1,107 @@
From 030e105efc9a29c7d34fb59fb0e0a40e54178299 Mon Sep 17 00:00:00 2001
From: Ben Skeggs <bskeggs@redhat.com>
Date: Wed, 30 Jun 2010 13:34:05 +1000
Subject: [PATCH] drm/nouveau: disable acceleration on NVA3/NVA5/NVA8 by default
There's an GPU lockup problem for which the cause is currently unknown
on these chipsets.
Until it's resolved, it's better to leave the user with a working system
without acceleration than to have random lockups.
With this patch, acceleration will be off by default if a known problem
chipset is detected, but can be re-enabled with nouveau.noaccel=0 on
the kernel commandline.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
---
drivers/gpu/drm/nouveau/nouveau_drv.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_drv.h | 1 +
drivers/gpu/drm/nouveau/nouveau_state.c | 23 +++++++++++++++++++----
3 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c
index b4d958c..02b564c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.c
@@ -72,7 +72,7 @@ int nouveau_ignorelid = 0;
module_param_named(ignorelid, nouveau_ignorelid, int, 0400);
MODULE_PARM_DESC(noaccel, "Disable all acceleration");
-int nouveau_noaccel = 0;
+int nouveau_noaccel = -1;
module_param_named(noaccel, nouveau_noaccel, int, 0400);
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 022648e..76ec783 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -493,6 +493,7 @@ enum nouveau_card_type {
struct drm_nouveau_private {
struct drm_device *dev;
+ bool noaccel;
/* the card type, takes NV_* as values */
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 63c2d24..866f437 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -454,7 +454,7 @@ nouveau_card_init(struct drm_device *dev)
if (ret)
goto out_timer;
- if (nouveau_noaccel)
+ if (dev_priv->noaccel)
engine->graph.accel_blocked = true;
else {
/* PGRAPH */
@@ -509,10 +509,10 @@ out_display:
else
nv04_display_destroy(dev);
out_fifo:
- if (!nouveau_noaccel)
+ if (!dev_priv->noaccel)
engine->fifo.takedown(dev);
out_graph:
- if (!nouveau_noaccel)
+ if (!dev_priv->noaccel)
engine->graph.takedown(dev);
out_fb:
engine->fb.takedown(dev);
@@ -548,7 +548,7 @@ static void nouveau_card_takedown(struct drm_device *dev)
dev_priv->channel = NULL;
}
- if (!nouveau_noaccel) {
+ if (!dev_priv->noaccel) {
engine->fifo.takedown(dev);
engine->graph.takedown(dev);
}
@@ -744,6 +744,21 @@ int nouveau_load(struct drm_device *dev, unsigned long flags)
if (ret)
return ret;
+ if (nouveau_noaccel == -1) {
+ switch (dev_priv->chipset) {
+ case 0xa3:
+ case 0xa5:
+ case 0xa8:
+ dev_priv->noaccel = true;
+ break;
+ default:
+ dev_priv->noaccel = false;
+ break;
+ }
+ } else {
+ dev_priv->noaccel = (nouveau_noaccel != 0);
+ }
+
/* Map PRAMIN BAR, or on older cards, the aperture withing BAR0 */
if (dev_priv->card_type >= NV_40) {
int ramin_bar = 2;
--
1.7.2

View File

@ -48,7 +48,7 @@ Summary: The Linux kernel
# reset this by hand to 1 (or to 0 and then use rpmdev-bumpspec).
# scripts/rebase.sh should be made to do that for you, actually.
#
%global baserelease 35
%global baserelease 36
%global fedora_build %{baserelease}
# base_sublevel is the kernel version we're starting with and patching
@ -690,6 +690,7 @@ Patch1803: drm-encoder-disable.patch
# nouveau + drm fixes
Patch1815: drm-nouveau-updates.patch
Patch1816: drm-nouveau-race-fix.patch
Patch1817: drm-nouveau-nva3-noaccel.patch
Patch1819: drm-intel-big-hammer.patch
# intel drm is all merged upstream
Patch1820: drm-i915-fix-edp-panels.patch
@ -1337,6 +1338,7 @@ ApplyPatch drm-encoder-disable.patch
# Nouveau DRM + drm fixes
ApplyPatch drm-nouveau-updates.patch
ApplyPatch drm-nouveau-race-fix.patch
ApplyPatch drm-nouveau-nva3-noaccel.patch
ApplyPatch drm-intel-big-hammer.patch
ApplyOptionalPatch drm-intel-next.patch
@ -2037,6 +2039,10 @@ fi
%changelog
* Tue Aug 10 2010 Ben Skeggs <bskeggs@redhat.com> 2.6.34.3-36.rc1
- nouveau: disable accel on nva3/nva5/nva8 until it's fixed upstream
- rhbz#596330
* Sat Aug 07 2010 Chuck Ebbert <cebbert@redhat.com> 2.6.34.3-35.rc1
- Linux 2.6.34.3-rc1