Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 PR# port-i386/41929: genfb and machdep.acpi...



details:   https://anonhg.NetBSD.org/src/rev/782bdf3343bb
branches:  trunk
changeset: 746953:782bdf3343bb
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Aug 24 11:35:27 2009 +0000

description:
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.

diffstat:

 sys/arch/x86/x86/x86_autoconf.c |  32 ++++++++++++++++++++++++++++----
 1 files changed, 28 insertions(+), 4 deletions(-)

diffs (81 lines):

diff -r 5568e386b4ac -r 782bdf3343bb sys/arch/x86/x86/x86_autoconf.c
--- a/sys/arch/x86/x86/x86_autoconf.c   Mon Aug 24 11:33:49 2009 +0000
+++ b/sys/arch/x86/x86/x86_autoconf.c   Mon Aug 24 11:35:27 2009 +0000
@@ -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;
                }



Home | Main Index | Thread Index | Old Index