Patchwork [1/3] UBUNTU: SAUCE: Nouveau: Add quirk framework to disable acceleration

login
register
mail settings
Submitter Andy Whitcroft
Date April 9, 2010, 3:22 p.m.
Message ID <1270826530-23810-1-git-send-email-apw@canonical.com>
Download mbox | patch
Permalink /patch/49846/
State Accepted
Delegated to: Andy Whitcroft
Headers show

Comments

Andy Whitcroft - April 9, 2010, 3:22 p.m.
From: Christopher James Halse Rogers <raof@ubuntu.com>

Add support for Nouveau acceleration quirks.

BugLink: http://bugs.launchpad.net/bugs/546393
BugLink: http://bugs.launchpad.net/bugs/544088

Signed-off-by: Christopher James Halse Rogers <raof@ubuntu.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 drivers/gpu/drm/nouveau/nouveau_drv.c   |    2 +-
 drivers/gpu/drm/nouveau/nouveau_state.c |   12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletions(-)

Patch

diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c
index da3b93b..d0caed5 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.c
@@ -76,7 +76,7 @@  int nouveau_ignorelid = 0;
 module_param_named(ignorelid, nouveau_ignorelid, int, 0400);
 
 MODULE_PARM_DESC(noagp, "Disable all acceleration");
-int nouveau_noaccel = 0;
+int nouveau_noaccel = -1;
 module_param_named(noaccel, nouveau_noaccel, int, 0400);
 
 MODULE_PARM_DESC(noagp, "Disable fbcon acceleration");
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
index a4851af..5a391fb 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -599,6 +599,15 @@  static void nouveau_OF_copy_vbios_to_ramin(struct drm_device *dev)
 #endif
 }
 
+static void nouveau_apply_noaccel_quirks (struct drm_device *dev)
+{
+	struct drm_nouveau_private *dev_priv = dev->dev_private;
+	if (nouveau_noaccel == -1) {
+		/* If not specified, noaccel should default off */
+		nouveau_noaccel = 0;
+	}
+}
+
 int nouveau_load(struct drm_device *dev, unsigned long flags)
 {
 	struct drm_nouveau_private *dev_priv;
@@ -728,6 +737,9 @@  int nouveau_load(struct drm_device *dev, unsigned long flags)
 	else if (dev->pci_device == 0x01f0)
 		dev_priv->flags |= NV_NFORCE2;
 
+	/* Apply noaccel quirks */
+	nouveau_apply_noaccel_quirks(dev);
+
 	/* For kernel modesetting, init card now and bring up fbcon */
 	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
 		int ret = nouveau_card_init(dev);