From 1332235ebc103217e5b1b71c2e7a52faf39b1a95 Mon Sep 17 00:00:00 2001 From: Christopher James Halse Rogers Date: Fri, 17 Sep 2010 17:17:55 +0100 Subject: UBUNTU: SAUCE: Nouveau: Add quirk framework to disable acceleration 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 Acked-by: Andy Whitcroft Signed-off-by: Andy Whitcroft Signed-off-by: Leann Ogasawara --- drivers/gpu/drm/nouveau/nouveau_drv.c | 2 +- drivers/gpu/drm/nouveau/nouveau_state.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c index 90875494a65a..7b967b47e24b 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; 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 049f755567e5..f2ece907c8b8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c @@ -824,6 +824,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; @@ -958,6 +967,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 */ ret = nouveau_card_init(dev); if (ret) -- cgit v1.2.3