drm/nouveau: allow modeset module option to select 'headless mode'
authorBen Skeggs <bskeggs@redhat.com>
Mon, 4 Jul 2011 03:14:05 +0000 (13:14 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 20 Sep 2011 06:05:16 +0000 (16:05 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_drv.c
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_state.c

index b30ddd8..c1e01f3 100644 (file)
@@ -41,7 +41,7 @@ int nouveau_agpmode = -1;
 module_param_named(agpmode, nouveau_agpmode, int, 0400);
 
 MODULE_PARM_DESC(modeset, "Enable kernel modesetting");
-static int nouveau_modeset = -1; /* kms */
+int nouveau_modeset = -1;
 module_param_named(modeset, nouveau_modeset, int, 0400);
 
 MODULE_PARM_DESC(vbios, "Override default VBIOS location");
index 0661bcc..7fdfad0 100644 (file)
@@ -798,6 +798,7 @@ nouveau_bo_ref(struct nouveau_bo *ref, struct nouveau_bo **pnvbo)
 }
 
 /* nouveau_drv.c */
+extern int nouveau_modeset;
 extern int nouveau_agpmode;
 extern int nouveau_duallink;
 extern int nouveau_uscript_lvds;
index d457022..d3b0261 100644 (file)
@@ -431,6 +431,15 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
                return 1;
        }
 
+       /* headless mode */
+       if (nouveau_modeset == 2) {
+               engine->display.early_init = nouveau_stub_init;
+               engine->display.late_takedown = nouveau_stub_takedown;
+               engine->display.create = nouveau_stub_init;
+               engine->display.init = nouveau_stub_init;
+               engine->display.destroy = nouveau_stub_takedown;
+       }
+
        return 0;
 }