]> 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>
Wed, 31 Oct 2012 02:16:06 +0000 (12:16 +1000)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 16 Nov 2012 16:46:47 +0000 (16:46 +0000)
commit e412e95a268fa8544858ebfe066826b290430d51 upstream.

This is to prevent nouveau from taking over the console on headless boards
such as Tesla.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/gpu/drm/nouveau/nouveau_drv.c
drivers/gpu/drm/nouveau/nouveau_state.c

index 4ab35b588664ad1ec3a2d5924c562631794d475b..8c084c0bcfd0471b7691a01e615418bcbc9cf985 100644 (file)
@@ -474,9 +474,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 d8831ab42bb90344a28b8a146624aa4aca69d8c5..01adcfb8101b5d0b6e19ffc643ce994008f2ef03 100644 (file)
@@ -46,6 +46,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:
@@ -481,7 +482,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;