summaryrefslogtreecommitdiff
path: root/sys/arch/arm
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2010-03-30 17:40:56 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2010-03-30 17:40:56 +0000
commit17f79ce6ab989e13c40b1b05780f81a5d5f2fe05 (patch)
treedd13f9c70165296d96946a2c3d66f8b4709ae64c /sys/arch/arm
parentf5972d809904e97326ca314c087612469e208db2 (diff)
Prevent the apmd/x races for good.
When we hit suspend time, go through all wsdisplays on the system. if they are in mode MAPPED, but not MODE_DUMBFB then if possible do a full vt switch to a !mapped vt, and prevent switching back until resume time. This has to be called from MD code because this involves userland running so that X can run the vt switch signal handler. This way, any case where we are using the "poke registers from userland" model, we will not be on the hardware when we go down, so the kernel can actually handle thing properly. Tested on several acpi laptops (by kettenis@ and ian@), x40 (me and beck@ at LEAST) and zaurus (me). Maybe others, but if so I forgot who at this time.. Idea from deraadt somewhere over the Faroe Islands (I thought of a similar thing myself a while ago). Much prompting from him. Ok and comments miod@
Diffstat (limited to 'sys/arch/arm')
-rw-r--r--sys/arch/arm/xscale/pxa2x0_apm.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/arch/arm/xscale/pxa2x0_apm.c b/sys/arch/arm/xscale/pxa2x0_apm.c
index 9d2e5bc2343..a009324dc8d 100644
--- a/sys/arch/arm/xscale/pxa2x0_apm.c
+++ b/sys/arch/arm/xscale/pxa2x0_apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pxa2x0_apm.c,v 1.31 2009/03/27 16:01:37 oga Exp $ */
+/* $OpenBSD: pxa2x0_apm.c,v 1.32 2010/03/30 17:40:55 oga Exp $ */
/*-
* Copyright (c) 2001 Alexander Guy. All rights reserved.
@@ -55,6 +55,9 @@
#include <arm/xscale/pxa2x0var.h>
#include <arm/xscale/pxa2x0_apm.h>
#include <arm/xscale/pxa2x0_gpio.h>
+#include <dev/wscons/wsdisplayvar.h>
+
+#include "wsdisplay.h"
#if defined(APMDEBUG)
#define DPRINTF(x) printf x
@@ -302,6 +305,9 @@ apm_power_info(struct pxa2x0_apm_softc *sc,
void
apm_suspend(struct pxa2x0_apm_softc *sc)
{
+#if NWSDISPLAY > 0
+ wsdisplay_suspend();
+#endif /* NWSDISPLAY > 0 */
resettodr();
@@ -332,6 +338,9 @@ apm_resume(struct pxa2x0_apm_softc *sc)
*/
/* XXX ifdef NPXAUDC > 0 */
bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PSSR, PSSR_OTGPH);
+#if NWSDISPLAY > 0
+ wsdisplay_resume();
+#endif /* NWSDISPLAY > 0 */
}
int