Oops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Rusty Russell (rusty at rustcorp.com.au) wrote:
> So I'd prefer a generic way of disabling the VGA stuff...

Heh, me too, like the patch at the bottom. I toyed with putting it into
vgacon directly since we'll need in on x86_64 too, like so:

static int vgacon_disabled;
void vgacon_disable(void)
{
	vgacon_disabled = 1;
}
EXPORT_SYMBOL_GPL(vgacon_disable);

vgacon_startup()
...
-	if (ORIG_VIDEO_ISVGA == VIDEO_TYPE_VLFB)
+	if (vgacon_disabled || ORIG_VIDEO_ISVGA == VIDEO_TYPE_VLFB)
...

but opted for the more arch specific way:

diff -r e1974f36aa13 arch/i386/kernel/setup.c
--- a/arch/i386/kernel/setup.c	Wed Jan 10 18:19:52 2007 -0800
+++ b/arch/i386/kernel/setup.c	Thu Jan 11 18:32:22 2007 -0800
@@ -69,6 +69,9 @@ unsigned long init_pg_tables_end __initd
 unsigned long init_pg_tables_end __initdata = ~0UL;
 
 int disable_pse __devinitdata = 0;
+
+/* use to runtime disable vga_con */
+int vgacon_enabled = 1;
 
 /*
  * Machine setup..
@@ -643,7 +646,7 @@ void __init setup_arch(char **cmdline_p)
 
 #ifdef CONFIG_VT
 #if defined(CONFIG_VGA_CONSOLE)
-	if (!efi_enabled || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY))
+	if (vgacon_enabled && (!efi_enabled || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY)))
 		conswitchp = &vga_con;
 #elif defined(CONFIG_DUMMY_CONSOLE)
 	conswitchp = &dummy_con;
diff -r e1974f36aa13 arch/i386/paravirt-xen/enlighten.c
--- a/arch/i386/paravirt-xen/enlighten.c	Wed Jan 10 18:19:52 2007 -0800
+++ b/arch/i386/paravirt-xen/enlighten.c	Thu Jan 11 18:37:40 2007 -0800
@@ -7,6 +7,7 @@
 #include <linux/start_kernel.h>
 #include <linux/sched.h>
 #include <linux/bootmem.h>
+#include <linux/console.h>
 
 #include <xen/interface/xen.h>
 #include <xen/features.h>
@@ -779,6 +780,9 @@ static asmlinkage void __init xen_start_
 	new_cpu_data.hard_math = 1;
 	identify_cpu(&new_cpu_data);
 
+	/* prepare for xen console */
+	vgacon_enabled = 0;
+
 	/* Poke various useful things into boot_params */
 	LOADER_TYPE = (9 << 4) | 0;
 	INITRD_START = xen_start_info->mod_start ? __pa(xen_start_info->mod_start) : 0;
diff -r e1974f36aa13 include/asm-i386/setup.h
--- a/include/asm-i386/setup.h	Wed Jan 10 18:19:52 2007 -0800
+++ b/include/asm-i386/setup.h	Thu Jan 11 18:36:42 2007 -0800
@@ -77,6 +77,8 @@ void __init add_memory_region(unsigned l
 void __init add_memory_region(unsigned long long start,
 			      unsigned long long size, int type);
 
+extern int vgacon_enabled;
+
 #endif /* __ASSEMBLY__ */
 
 #endif  /*  __KERNEL__  */


[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux