> Date: Sat, 31 May 2025 08:57:18 +0200
> From: Landry Breuil <[email protected]>
> 
> hi,
> 
> trying to understand the sequence of events that triggers
> 'wsdisplay_switch2: not switching' and the screen not powering down upon
> suspend on this arm64/x1e laptop.

As I've said before, there is no display controller driver yet, and on
many (but not all) of the x1e laptops display backlight control is
implemented through the backlight controller.

> added some debug printfs, vt switching works fine:
> 
> at boot, switching to vt4 for xenodm:
> wsdisplay_switch: called with no=4, waitok=1, sc_flags=0
> wsdisplay_switch: sc_flags=1, screenwanted=4
> wsdisplay_switch1: called with error=0, waitok=1, sc_flags=1
> wsdisplay_switch2: called with error=0, waitok=0, sc_flags=1
> wsdisplay_switch3: called with error=0, waitok=0, sc_flags=1
> 
> manually switching to vt0 via ctrl-alt-f1
> wsdisplay_switch: called with no=0, waitok=1, sc_flags=0
> wsdisplay_switch: sc_flags=1, screenwanted=0 <- here wsdisplay_switch sets 
> sc_flags to SWITCHPENDING
> wsdisplay_switch1: called with error=0, waitok=1, sc_flags=1
> wsdisplay_switch2: called with error=0, waitok=0, sc_flags=1
> wsdisplay_switch3: called with error=0, waitok=0, sc_flags=1
> 
> from my understanding, at the end of wsdisplay_switch3 (line 1720),
> SC_SWITCHPENDING is cleared. I've tried commenting out this line,
> and zzz triggers an infinite loop, so it guess it's cleared
> to break out of this.
> 
> when zzz is called (or the lid is closed), for some reason
> wsdisplay_switch2 is called directly, and bails out because
> SWITCHPENDING is unset:
> 
> wsdisplay_switch2: called with error=0, waitok=0, sc_flags=0
> wsdisplay_switch2: not switching
> 
> i suppose its called directly because it's been registered as a
> show_screen callback in wsdisplay_switch1 ? should that be the case ?

I see this on the x13s and the vivobook as well.  Even if I use zzz to
suspend the machine.  Seems to happen only when X is running.  That
wsdisplay switching code has always been a mess that's hard to
understand.  But it doesn't seem to prevent the machine from
suspending or resuming.  So this is a separate issue from the lid
stuff.

Reply via email to