diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2022-02-15 21:17:13 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2022-02-15 21:17:13 +0000 |
commit | 9f9f5e89b9211f30cb9832a45b246b5310ec5663 (patch) | |
tree | dccc6bd295c27c662086252bb33e1769845f25b3 | |
parent | 27bd8a0f0430762658cb69f48b69586a9f1db78b (diff) |
Since acpitoshiba brightness button processing no longer plays games
with AML parsing outside the acpi thread, the locking-release dance
around wsdisplay_{suspend,resume} can be removed
ok kettenis
-rw-r--r-- | sys/arch/arm64/dev/apm.c | 37 | ||||
-rw-r--r-- | sys/arch/macppc/dev/apm.c | 21 | ||||
-rw-r--r-- | sys/dev/acpi/acpi_x86.c | 32 | ||||
-rw-r--r-- | sys/kern/subr_suspend.c | 12 | ||||
-rw-r--r-- | sys/sys/device.h | 4 |
5 files changed, 12 insertions, 94 deletions
diff --git a/sys/arch/arm64/dev/apm.c b/sys/arch/arm64/dev/apm.c index 4b65791ff8f..a77aa7f8e54 100644 --- a/sys/arch/arm64/dev/apm.c +++ b/sys/arch/arm64/dev/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.14 2022/02/15 16:54:48 deraadt Exp $ */ +/* $OpenBSD: apm.c,v 1.15 2022/02/15 21:17:12 deraadt Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -32,7 +32,6 @@ */ #include "apm.h" -#include "wsdisplay.h" #include <sys/param.h> #include <sys/systm.h> @@ -50,8 +49,6 @@ #include <machine/acpiapm.h> #include <machine/apmvar.h> -#include <dev/wscons/wsdisplayvar.h> - #if defined(APMDEBUG) #define DPRINTF(x) printf x #else @@ -394,38 +391,6 @@ sleep_resume(void *v) } void -display_suspend(void *v) -{ -#if 0 -#if NWSDISPLAY > 0 - struct acpi_softc *sc = v; - - /* - * Temporarily release the lock to prevent the X server from - * blocking on setting the display brightness. - */ - rw_exit_write(&sc->sc_lck); /* XXX replace this interlock */ - wsdisplay_suspend(); - rw_enter_write(&sc->sc_lck); -#endif /* NWSDISPLAY > 0 */ -#endif -} - -void -display_resume(void *v) -{ -#if 0 -#if NWSDISPLAY > 0 - struct acpi_softc *sc = v; - - rw_exit_write(&sc->sc_lck); /* XXX replace this interlock */ - wsdisplay_resume(); - rw_enter_write(&sc->sc_lck); -#endif /* NWSDISPLAY > 0 */ -#endif -} - -void suspend_finish(void *v) { #if 0 diff --git a/sys/arch/macppc/dev/apm.c b/sys/arch/macppc/dev/apm.c index 302f46e9336..3cfa6c8fcd8 100644 --- a/sys/arch/macppc/dev/apm.c +++ b/sys/arch/macppc/dev/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.30 2022/02/15 16:54:48 deraadt Exp $ */ +/* $OpenBSD: apm.c,v 1.31 2022/02/15 21:17:12 deraadt Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -53,9 +53,6 @@ #include <macppc/dev/pm_direct.h> -#include "wsdisplay.h" -#include <dev/wscons/wsdisplayvar.h> - #if defined(APMDEBUG) #define DPRINTF(x) printf x #else @@ -386,22 +383,6 @@ gosleep(void *v) } void -display_suspend(void *v) -{ -#if NWSDISPLAY > 0 - wsdisplay_suspend(); -#endif /* NWSDISPLAY > 0 */ -} - -void -display_resume(void *v) -{ -#if NWSDISPLAY > 0 - wsdisplay_resume(); -#endif /* NWSDISPLAY > 0 */ -} - -void suspend_finish(void *v) { } diff --git a/sys/dev/acpi/acpi_x86.c b/sys/dev/acpi/acpi_x86.c index c7756823abb..b46ac7e9784 100644 --- a/sys/dev/acpi/acpi_x86.c +++ b/sys/dev/acpi/acpi_x86.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_x86.c,v 1.6 2022/02/15 16:54:48 deraadt Exp $ */ +/* $OpenBSD: acpi_x86.c,v 1.7 2022/02/15 21:17:12 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -50,7 +50,6 @@ #include <dev/acpi/amltypes.h> #include <dev/acpi/acpidev.h> #include <dev/acpi/dsdt.h> -#include <dev/wscons/wsdisplayvar.h> #include <dev/pci/pcidevs.h> #include <dev/pci/ppbreg.h> @@ -64,7 +63,6 @@ #define APMDEV_CTL 8 #include "wd.h" -#include "wsdisplay.h" #include "softraid.h" int @@ -170,31 +168,3 @@ suspend_finish(void *v) if (acpibtn_numopenlids() == 0 && lid_action != 0) acpi_addtask(sc, acpi_sleep_task, sc, sc->sc_state); } - -void -display_suspend(void *v) -{ -#if NWSDISPLAY > 0 - struct acpi_softc *sc = v; - - /* - * Temporarily release the lock to prevent the X server from - * blocking on setting the display brightness. - */ - rw_exit_write(&sc->sc_lck); - wsdisplay_suspend(); - rw_enter_write(&sc->sc_lck); -#endif /* NWSDISPLAY > 0 */ -} - -void -display_resume(void *v) -{ -#if NWSDISPLAY > 0 - struct acpi_softc *sc = v; - - rw_exit_write(&sc->sc_lck); - wsdisplay_resume(); - rw_enter_write(&sc->sc_lck); -#endif /* NWSDISPLAY > 0 */ -} diff --git a/sys/kern/subr_suspend.c b/sys/kern/subr_suspend.c index c8c95573784..af6d19a6557 100644 --- a/sys/kern/subr_suspend.c +++ b/sys/kern/subr_suspend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_suspend.c,v 1.6 2022/02/15 16:54:48 deraadt Exp $ */ +/* $OpenBSD: subr_suspend.c,v 1.7 2022/02/15 21:17:12 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -33,6 +33,7 @@ #endif #include "softraid.h" +#include "wsdisplay.h" int sleep_state(void *v, int sleepmode) @@ -49,7 +50,9 @@ sleep_state(void *v, int sleepmode) if (sleep_showstate(v, sleepmode)) return EOPNOTSUPP; - display_suspend(v); +#if NWSDISPLAY > 0 + wsdisplay_suspend(); +#endif stop_periodic_resettodr(); @@ -175,8 +178,9 @@ fail_alloc: start_periodic_resettodr(); - display_resume(v); - +#if NWSDISPLAY > 0 + wsdisplay_resume(); +#endif sys_sync(curproc, NULL, NULL); /* Restore hw.setperf */ diff --git a/sys/sys/device.h b/sys/sys/device.h index bdae174cd4d..d10fd080a54 100644 --- a/sys/sys/device.h +++ b/sys/sys/device.h @@ -1,4 +1,4 @@ -/* $OpenBSD: device.h,v 1.60 2022/02/15 16:54:48 deraadt Exp $ */ +/* $OpenBSD: device.h,v 1.61 2022/02/15 21:17:12 deraadt Exp $ */ /* $NetBSD: device.h,v 1.15 1996/04/09 20:55:24 cgd Exp $ */ /* @@ -209,8 +209,6 @@ int sleep_setstate(void *v); int sleep_resume(void *v); void sleep_abort(void *v); void gosleep(void *v); -void display_suspend(void *v); -void display_resume(void *v); void suspend_finish(void *v); struct device *device_mainbus(void); |