]> git.karo-electronics.de Git - karo-tx-linux.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:50:42 +0000 (09:50 +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 b5232582d1e86b16a7ffb6e52a2006e251bdd575..05091c22a037fba440c1828c15928593759d0aaa 100644 (file)
@@ -472,9 +472,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 c2a8511e855a344d515afe9a3daba8c74736f2b5..b096cf28213a575264a7a60313e15e3093e03277 100644 (file)
@@ -47,6 +47,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:
@@ -526,7 +527,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;