]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/nouveau: headless mode by default if pci class != vga display
authorBen Skeggs <bskeggs@redhat.com>
Thu, 1 Nov 2012 06:16:32 +0000 (16:16 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Nov 2012 08:56:52 +0000 (09:56 +0100)
This is to prevent nouveau from taking over the console on headless boards
such as Tesla.

Backport of upstream commit: e412e95a268fa8544858ebfe066826b290430d51

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/nouveau/nouveau_drv.c
drivers/gpu/drm/nouveau/nouveau_state.c

index 1fcc69a77f64276afc1570010e6dd2a8879afb06..a06eb3d58a5d4f00b166b073b6ec946715a87a26 100644 (file)
@@ -488,9 +488,7 @@ static int __init nouveau_init(void)
 #ifdef CONFIG_VGA_CONSOLE
                if (vgacon_text_force())
                        nouveau_modeset = 0;
-               else
 #endif
-                       nouveau_modeset = 1;
        }
 
        if (!nouveau_modeset)
index c61014442aa931cfe5822069c7ecf6c0d565f4dc..f5e95846b4c8ef206e45fb6c38b7f32e6ea495cb 100644 (file)
@@ -50,6 +50,7 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
 {
        struct drm_nouveau_private *dev_priv = dev->dev_private;
        struct nouveau_engine *engine = &dev_priv->engine;
+       u32 pclass = dev->pdev->class >> 8;
 
        switch (dev_priv->chipset & 0xf0) {
        case 0x00:
@@ -428,7 +429,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
        }
 
        /* headless mode */
-       if (nouveau_modeset == 2) {
+       if (nouveau_modeset == 2 ||
+           (nouveau_modeset < 0 && pclass != PCI_CLASS_DISPLAY_VGA)) {
                engine->display.early_init = nouveau_stub_init;
                engine->display.late_takedown = nouveau_stub_takedown;
                engine->display.create = nouveau_stub_init;