-/* $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.
*/
#include "apm.h"
-#include "wsdisplay.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <machine/acpiapm.h>
#include <machine/apmvar.h>
-#include <dev/wscons/wsdisplayvar.h>
-
#if defined(APMDEBUG)
#define DPRINTF(x) printf x
#else
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)
{
-/* $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.
#include <macppc/dev/pm_direct.h>
-#include "wsdisplay.h"
-#include <dev/wscons/wsdisplayvar.h>
-
#if defined(APMDEBUG)
#define DPRINTF(x) printf x
#else
{
}
-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)
{
-/* $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>
#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>
#define APMDEV_CTL 8
#include "wd.h"
-#include "wsdisplay.h"
#include "softraid.h"
int
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 */
-}
-/* $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>
#endif
#include "softraid.h"
+#include "wsdisplay.h"
int
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();
start_periodic_resettodr();
- display_resume(v);
-
+#if NWSDISPLAY > 0
+ wsdisplay_resume();
+#endif
sys_sync(curproc, NULL, NULL);
/* Restore hw.setperf */
-/* $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 $ */
/*
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);