Patch: SAUCE: Disable acceleration on MacBook Pro and GeForce 3

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Patch: SAUCE: Disable acceleration on MacBook Pro and GeForce 3

Christopher James Halse Rogers-5
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.

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

0001-UBUNTU-SAUCE-Nouveau-Disable-acceleration-on-MacBook.patch (4K) Download Attachment
signature.asc (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Patch: SAUCE: Disable acceleration on MacBook Pro and GeForce 3

Chase Douglas-5
On Thu, Apr 8, 2010 at 5:10 AM, Christopher James Halse Rogers
<[hidden email]> 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.

It would be nice if we could fix this instead of brute force
disabling, but we're so close to release and this looks to affect so
many people (assumption based on number of mbp users alone) that I
think this approach is best for now. The logic seems right, but I
haven't seen any reports of tests to ensure this patch works as
intended. Christopher, have you or anyone else tested this?

What do we lose when we disable accel? I assume it's more than just
the non-existent 3D acceleration. I still think it's more important
that things work at all, but a discussion of what this causes would be
useful.

Once this can be confirmed as tested I will Ack it.

-- Chase

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: Patch: SAUCE: Disable acceleration on MacBook Pro and GeForce 3

Andy Whitcroft-3
In reply to this post by Christopher James Halse Rogers-5
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 <[hidden email]>
> 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 <[hidden email]>
> ---
>  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 <[hidden email]>

-apw

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

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

Andy Whitcroft-3
From: Christopher James Halse Rogers <[hidden email]>

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 <[hidden email]>
Signed-off-by: Andy Whitcroft <[hidden email]>
---
 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);
--
1.7.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 2/3] UBUNTU: SAUCE: Nouveau: Disable acceleration on MacBook Pros

Andy Whitcroft-3
In reply to this post by Andy Whitcroft-3
From: Christopher James Halse Rogers <[hidden email]>

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.

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

Signed-off-by: Christopher James Halse Rogers <[hidden email]>
Signed-off-by: Andy Whitcroft <[hidden email]>
---
 drivers/gpu/drm/nouveau/nouveau_state.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
index 5a391fb..462432c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -605,6 +605,15 @@ static void nouveau_apply_noaccel_quirks (struct drm_device *dev)
  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");
+ }
  }
 }
 
--
1.7.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 3/3] UBUNTU: SAUCE: Nouveau: Disable acceleration on GeForce3 cards

Andy Whitcroft-3
In reply to this post by Andy Whitcroft-3
From: Christopher James Halse Rogers <[hidden email]>

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.

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

Signed-off-by: Christopher James Halse Rogers <[hidden email]>
Signed-off-by: Andy Whitcroft <[hidden email]>
---
 drivers/gpu/drm/nouveau/nouveau_state.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
index 462432c..63014f4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -614,6 +614,13 @@ static void nouveau_apply_noaccel_quirks (struct drm_device *dev)
  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");
+ }
  }
 }
 
--
1.7.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: Patch: SAUCE: Disable acceleration on GeForce 6100

Christopher James Halse Rogers-5
In reply to this post by Andy Whitcroft-3
This extra quirk applies on the top of the previous 3 patches.

Subject: [PATCH] UBUNTU: SAUCE: Nouveau: Disable acceleration on 6100
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.

BugLink: http://bugs.launchpad.net/bugs/542950

Signed-off-by: Christopher James Halse Rogers
<[hidden email]>



--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

0001-UBUNTU-SAUCE-Nouveau-Disable-acceleration-on-6100-ca.patch (1K) Download Attachment
signature.asc (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Patch: SAUCE: Disable acceleration on GeForce 6100

Andy Whitcroft-3
On Tue, Apr 13, 2010 at 09:31:54PM +1000, Christopher James Halse Rogers wrote:

> This extra quirk applies on the top of the previous 3 patches.
>
> Subject: [PATCH] UBUNTU: SAUCE: Nouveau: Disable acceleration on 6100
> 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.
>
> BugLink: http://bugs.launchpad.net/bugs/542950
>
> Signed-off-by: Christopher James Halse Rogers
> <[hidden email]>
>
>

> From 9532aca5caedaf43086b68c1352422c727373f46 Mon Sep 17 00:00:00 2001
> From: Christopher James Halse Rogers <[hidden email]>
> Date: Tue, 13 Apr 2010 19:36:39 +1000
> Subject: [PATCH] UBUNTU: SAUCE: Nouveau: Disable acceleration on 6100 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.
>
> BugLink: http://bugs.launchpad.net/bugs/542950
>
> Signed-off-by: Christopher James Halse Rogers <[hidden email]>
> ---
>  drivers/gpu/drm/nouveau/nouveau_state.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
> index 63014f4..a112998 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_state.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_state.c
> @@ -621,6 +621,13 @@ static void nouveau_apply_noaccel_quirks (struct drm_device *dev)
>   NV_INFO(dev, "Detected NV20 (GeForce 3) chip. "
>   "Disabling acceleration\n");
>   }
> + /* GeForce 6100 cards also hang with acceleration */
> + /* See https://bugs.launchpad.net/bugs/542950 */
> + if (dev->pdev->device == 0x0242) {
> + nouveau_noaccel = 1;
> + NV_INFO(dev, "Detected GeForce 6100 chip. "
> + "Disabling acceleration\n");
> + }
>   }
>  }

This list is getting comprehensive enough that we should look at making
this into some kind of list if we are going to get any more of these.

-apw

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: Patch: SAUCE: Disable acceleration on GeForce 6100

Christopher James Halse Rogers-5
On Tue, 2010-04-13 at 13:16 +0100, Andy Whitcroft wrote:

> On Tue, Apr 13, 2010 at 09:31:54PM +1000, Christopher James Halse Rogers wrote:
> > This extra quirk applies on the top of the previous 3 patches.
> >
> > Subject: [PATCH] UBUNTU: SAUCE: Nouveau: Disable acceleration on 6100
> > 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.
> >
> > BugLink: http://bugs.launchpad.net/bugs/542950
> >
> > Signed-off-by: Christopher James Halse Rogers
> > <[hidden email]>
> >
> >
>
> > From 9532aca5caedaf43086b68c1352422c727373f46 Mon Sep 17 00:00:00 2001
> > From: Christopher James Halse Rogers <[hidden email]>
> > Date: Tue, 13 Apr 2010 19:36:39 +1000
> > Subject: [PATCH] UBUNTU: SAUCE: Nouveau: Disable acceleration on 6100 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.
> >
> > BugLink: http://bugs.launchpad.net/bugs/542950
> >
> > Signed-off-by: Christopher James Halse Rogers <[hidden email]>
> > ---
> >  drivers/gpu/drm/nouveau/nouveau_state.c |    7 +++++++
> >  1 files changed, 7 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
> > index 63014f4..a112998 100644
> > --- a/drivers/gpu/drm/nouveau/nouveau_state.c
> > +++ b/drivers/gpu/drm/nouveau/nouveau_state.c
> > @@ -621,6 +621,13 @@ static void nouveau_apply_noaccel_quirks (struct drm_device *dev)
> >   NV_INFO(dev, "Detected NV20 (GeForce 3) chip. "
> >   "Disabling acceleration\n");
> >   }
> > + /* GeForce 6100 cards also hang with acceleration */
> > + /* See https://bugs.launchpad.net/bugs/542950 */
> > + if (dev->pdev->device == 0x0242) {
> > + nouveau_noaccel = 1;
> > + NV_INFO(dev, "Detected GeForce 6100 chip. "
> > + "Disabling acceleration\n");
> > + }
> >   }
> >  }
>
> This list is getting comprehensive enough that we should look at making
> this into some kind of list if we are going to get any more of these.
I was thinking of that when I wrote the initial patch, but decided
against it because the first two quirks relied on different data (macs
are quirked against pciid, geforce 3 is a broader quirk against chipset
family).

If this list grows any longer I think it'll become obvious what data
needs to be stored for the quirk list.

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[APPLIED] Patch: SAUCE: Disable acceleration on MacBook Pro and GeForce 3

Andy Whitcroft-3
In reply to this post by Christopher James Halse Rogers-5
Ok, the patches are pretty simple and look straight forward.  All of the
combinations have tested good with the kernel command line nouveau.accel=0,
not booting at all or to corrupted displays without.  The patches have
been tested on a number of nvidia based systems to which the quirks do
_not_ apply and have neither triggered nor caused issues.

In light of this and in discussions with the X-team we have decided that
the risk is low for these patches, and the up-side for the affected
systems sufficient to warrent their inclusion in the release.

Therefore:

Acked-by: Andy Whitcroft <[hidden email]>

and:

Applied to Lucid.

-apw

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team