From patchwork Fri Apr 9 15:22:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 49846 X-Patchwork-Delegate: apw@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 1373BB7CF6 for ; Sat, 10 Apr 2010 01:22:22 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1O0G2B-0006Mz-Ra; Fri, 09 Apr 2010 16:22:15 +0100 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1O0G29-0006LP-DG for kernel-team@lists.ubuntu.com; Fri, 09 Apr 2010 16:22:13 +0100 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1O0G28-00056R-Gy for ; Fri, 09 Apr 2010 16:22:12 +0100 Received: from 79-66-242-230.dynamic.dsl.as9105.com ([79.66.242.230] helo=localhost.localdomain) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1O0G28-0004Ud-BM for kernel-team@lists.ubuntu.com; Fri, 09 Apr 2010 16:22:12 +0100 From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/3] UBUNTU: SAUCE: Nouveau: Add quirk framework to disable acceleration Date: Fri, 9 Apr 2010 16:22:08 +0100 Message-Id: <1270826530-23810-1-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.7.0 In-Reply-To: <20100409150504.GU31178@shadowen.org> References: <20100409150504.GU31178@shadowen.org> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: Christopher James Halse Rogers 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 Signed-off-by: Andy Whitcroft --- drivers/gpu/drm/nouveau/nouveau_drv.c | 2 +- drivers/gpu/drm/nouveau/nouveau_state.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletions(-) 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);