From b546e41ca0e7932c4659494c0e686a0a946c636c Mon Sep 17 00:00:00 2001 From: tobhe Date: Tue, 10 Jan 2023 16:33:18 +0000 Subject: [PATCH] Switch to console before suspending in DUMBFB mode. Fixes frame buffer corruption and a few other bugs/races after wakeup on Apple Silicon laptops and Lenovo x13s. ok kettenis@ deraadt@ --- sys/dev/wscons/wsdisplay.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c index fbfe0e9966c..a0a3fd25717 100644 --- a/sys/dev/wscons/wsdisplay.c +++ b/sys/dev/wscons/wsdisplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsdisplay.c,v 1.151 2023/01/10 12:47:19 tb Exp $ */ +/* $OpenBSD: wsdisplay.c,v 1.152 2023/01/10 16:33:18 tobhe Exp $ */ /* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */ /* @@ -2265,13 +2265,11 @@ wsdisplay_suspend_device(struct device *dev) scr = sc->sc_scr[active]; /* - * We want to switch out of graphics mode for the suspend, but - * only if we're in WSDISPLAY_MODE_MAPPED. + * We want to switch out of graphics mode for the suspend */ retry: idx = WSDISPLAY_MAXSCREEN; - if (scr->scr_flags & SCR_GRAPHICS && - (scr->scr_flags & SCR_DUMBFB) == 0) { + if (scr->scr_flags & SCR_GRAPHICS) { for (idx = 0; idx < WSDISPLAY_MAXSCREEN; idx++) { if (sc->sc_scr[idx] == NULL || sc->sc_scr[idx] == scr) continue; -- 2.20.1