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

login
register
mail settings
Submitter Andy Whitcroft
Date Sept. 17, 2010, 4:17 p.m.
Message ID <1284740276-5551-2-git-send-email-apw@canonical.com>
Download mbox | patch
Permalink /patch/65087/
State Accepted
Delegated to: Leann Ogasawara
Headers show

Comments

Andy Whitcroft - Sept. 17, 2010, 4:17 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>
Acked-by: Andy Whitcroft <apw@canonical.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 2737704..700c375 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(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_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
index b02a231..00a4e88 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -686,6 +686,15 @@  static int nouveau_remove_conflicting_drivers(struct drm_device *dev)
 	return 0;
 }
 
+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;
@@ -811,6 +820,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);