From 31ca9984a528d0216dcc6546c972dcd486418fe6 Mon Sep 17 00:00:00 2001 From: jmcneill Date: Mon, 24 Aug 2009 11:35:27 +0000 Subject: [PATCH] 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. --- sys/arch/x86/x86/x86_autoconf.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/sys/arch/x86/x86/x86_autoconf.c b/sys/arch/x86/x86/x86_autoconf.c index bab6dba172ed..1b95e426729e 100644 --- a/sys/arch/x86/x86/x86_autoconf.c +++ b/sys/arch/x86/x86/x86_autoconf.c @@ -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 -__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 #include @@ -53,19 +53,28 @@ __KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.42 2009/08/24 11:04:29 jmcneill E #include #include +#include "acpica.h" #include "pci.h" #include "genfb.h" #include "wsdisplay.h" +#include "opt_vga.h" +#ifdef VGA_POST +#include +#endif #include #if NPCI > 0 #include #endif #include +#include #include 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 @@ x86_genfb_suspend(device_t dev PMF_FN_ARGS) 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 @@ device_register(device_t dev, void *aux) 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; }