Files
kernel_oneplus_sm8250/kernel
tuhaowen a4b8992265 PM: sleep: console: Fix the black screen issue
[ Upstream commit 4266e8fa56d3d982bf451d382a410b9db432015c ]

When the computer enters sleep status without a monitor
connected, the system switches the console to the virtual
terminal tty63(SUSPEND_CONSOLE).

If a monitor is subsequently connected before waking up,
the system skips the required VT restoration process
during wake-up, leaving the console on tty63 instead of
switching back to tty1.

To fix this issue, a global flag vt_switch_done is introduced
to record whether the system has successfully switched to
the suspend console via vt_move_to_console() during suspend.

If the switch was completed, vt_switch_done is set to 1.
Later during resume, this flag is checked to ensure that
the original console is restored properly by calling
vt_move_to_console(orig_fgconsole, 0).

This prevents scenarios where the resume logic skips console
restoration due to incorrect detection of the console state,
especially when a monitor is reconnected before waking up.

Signed-off-by: tuhaowen <tuhaowen@uniontech.com>
Link: https://patch.msgid.link/20250611032345.29962-1-tuhaowen@uniontech.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Ulrich Hecht <uli@kernel.org>
2025-09-16 13:55:14 +02:00
..
2024-07-05 09:00:29 +02:00
2025-04-04 11:11:29 +02:00
2019-12-13 08:51:11 +01:00
2023-12-20 15:38:01 +01:00
2025-07-17 10:08:05 +02:00
2021-02-10 09:21:06 +01:00
2020-03-25 08:06:13 +01:00
2019-01-13 09:51:06 +01:00
2024-11-08 16:19:12 +01:00
2021-02-07 14:48:38 +01:00
2020-01-09 10:18:59 +01:00