Patch: SAUCE: Disable acceleration on MacBook Pro and GeForce 3
Andy Whitcroft
apw at canonical.com
Fri Apr 9 15:05:04 UTC 2010
On Thu, Apr 08, 2010 at 07:10:48PM +1000, Christopher James Halse Rogers wrote:
> Currently in Lucid we have reports of nouveau hanging during boot on
> many of the recent MacBook Pro revisions, and also on GeForce 3 cards.
> See:
> https://bugs.launchpad.net/bugs/546393 and
> https://bugs.launchpad.net/bugs/544088
>
> Disabling acceleration on these cards prevents the hang, and the systems
> boot and run successfully. The attached patch disables acceleration on
> MacBook Pros, and GeForce 3 cards.
> From 93f6ecde964414035e15fd3a773f46aa8e8366fa Mon Sep 17 00:00:00 2001
> From: Christopher James Halse Rogers <raof at ubuntu.com>
> Date: Thu, 8 Apr 2010 18:08:32 +1000
> Subject: [PATCH] UBUNTU: SAUCE: Nouveau: Disable acceleration on MacBook Pros and GeForce3 cards
>
> Upstream obviously wants to fix acceleration rather than disable it. For Lucid
> however we need these cards to boot more than we need them to be fast.
>
> With acceleration enabled these cards hang during boot.
Concur with that position.
>
> BugLink: http://bugs.launchpad.net/bugs/546393
> BugLink: http://bugs.launchpad.net/bugs/544088
>
> Signed-off-by: Christopher James Halse Rogers <raof at ubuntu.com>
> ---
> drivers/gpu/drm/nouveau/nouveau_drv.c | 2 +-
> drivers/gpu/drm/nouveau/nouveau_state.c | 28 ++++++++++++++++++++++++++++
> 2 files changed, 29 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..77f8f60 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_state.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_state.c
> @@ -599,6 +599,31 @@ 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;
> +
> + /* MacBook Pro laptops with 9600GT cards hang with acceleration */
> + /* See https://bugs.launchpad.net/bugs/546393 */
> + if ((dev->pdev->device == 0x0647) &&
> + (dev->pdev->subsystem_vendor == 0x106b)) {
> + nouveau_noaccel = 1;
> + NV_INFO(dev, "Detected MacBook Pro 9600GT chip. "
> + "Disabling acceleration\n");
> + }
> + /* At least two of the three nv20 cards hang with acceleration */
> + /* See https://bugs.launchpad.net/bugs/544088 */
> + if (dev_priv->chipset == 0x20) {
> + nouveau_noaccel = 1;
> + NV_INFO(dev, "Detected NV20 (GeForce 3) chip. "
> + "Disabling acceleration\n");
> + }
> + }
> +}
> +
> int nouveau_load(struct drm_device *dev, unsigned long flags)
> {
> struct drm_nouveau_private *dev_priv;
> @@ -728,6 +753,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);
The overall concept looks fine. I think that to make it more
maintainable going forward I will split it into three patches, then we
can revert individual bits of support more easily going forward.
Otherwise I think it does what I would expect, honouring the users
selection first and then switching only if they do not do so.
Acked-by: Andy Whitcroft <apw at canonical.com>
-apw
More information about the kernel-team
mailing list