Module Name:    src
Committed By:   jmcneill
Date:           Mon Aug 24 11:35:27 UTC 2009

Modified Files:
        src/sys/arch/x86/x86: x86_autoconf.c

Log Message:
PR# port-i386/41929: genfb and machdep.acpi_vbios_reset=2 interaction

When acpi_vbios_reset=2, invoke vga_post_call followed by vga_post_set_mode
in the genfb pmf resume handler.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/x86/x86/x86_autoconf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/x86_autoconf.c
diff -u src/sys/arch/x86/x86/x86_autoconf.c:1.42 src/sys/arch/x86/x86/x86_autoconf.c:1.43
--- src/sys/arch/x86/x86/x86_autoconf.c:1.42	Mon Aug 24 11:04:29 2009
+++ src/sys/arch/x86/x86/x86_autoconf.c	Mon Aug 24 11:35:27 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_autoconf.c,v 1.42 2009/08/24 11:04:29 jmcneill Exp $	*/
+/*	$NetBSD: x86_autoconf.c,v 1.43 2009/08/24 11:35:27 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.42 2009/08/24 11:04:29 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.43 2009/08/24 11:35:27 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -53,19 +53,28 @@
 #include <machine/bootinfo.h>
 #include <machine/pio.h>
 
+#include "acpica.h"
 #include "pci.h"
 #include "genfb.h"
 #include "wsdisplay.h"
+#include "opt_vga.h"
 
+#ifdef VGA_POST
+#include <x86/vga_post.h>
+#endif
 #include <dev/isa/isavar.h>
 #if NPCI > 0
 #include <dev/pci/pcivar.h>
 #endif
 #include <dev/wsfb/genfbvar.h>
+#include <dev/pci/genfb_pcivar.h>
 #include <dev/ic/vgareg.h>
 
 static struct genfb_colormap_callback gfb_cb;
 static struct genfb_pmf_callback pmf_cb;
+#ifdef VGA_POST
+static struct vga_post *vga_posth = NULL;
+#endif
 
 struct disklist *x86_alldisks;
 int x86_ndisks;
@@ -89,9 +98,20 @@
 static bool
 x86_genfb_resume(device_t dev PMF_FN_ARGS)
 {
-	struct genfb_softc *sc = device_private(dev);
+	struct pci_genfb_softc *psc = device_private(dev);
+#if NACPICA > 0 && defined(VGA_POST)
+	extern int acpi_md_vbios_reset;
+	extern int acpi_md_vesa_modenum;
+#endif
 
-	genfb_restore_palette(sc);
+#if NACPICA > 0 && defined(VGA_POST)
+	if (vga_posth != NULL && acpi_md_vbios_reset == 2) {
+		vga_post_call(vga_posth);
+		if (acpi_md_vesa_modenum != 0)
+			vga_post_set_vbe(vga_posth, acpi_md_vesa_modenum);
+	}
+#endif
+	genfb_restore_palette(&psc->sc_gen);
 
 	return true;
 }
@@ -618,6 +638,10 @@
 			pmf_cb.gpc_resume = x86_genfb_resume;
 			prop_dictionary_set_uint64(dict,
 			    "pmf_callback", (uint64_t)&pmf_cb);
+#ifdef VGA_POST
+			vga_posth = vga_post_init(pa->pa_bus, pa->pa_device,
+			    pa->pa_function);
+#endif
 			found_console = true;
 			return;
 		}

Reply via email to