From: deraadt Date: Tue, 15 Feb 2022 21:17:12 +0000 (+0000) Subject: Since acpitoshiba brightness button processing no longer plays games X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=cb9e2b65bea1f8c65658188d87dfaf0d386197f7;p=openbsd 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 --- 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 #include @@ -50,8 +49,6 @@ #include #include -#include - #if defined(APMDEBUG) #define DPRINTF(x) printf x #else @@ -393,38 +390,6 @@ sleep_resume(void *v) return 0; } -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) { 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 -#include "wsdisplay.h" -#include - #if defined(APMDEBUG) #define DPRINTF(x) printf x #else @@ -385,22 +382,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 * Copyright (c) 2005 Jordan Hargrave @@ -50,7 +50,6 @@ #include #include #include -#include #include #include @@ -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 * Copyright (c) 2005 Jordan Hargrave @@ -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);