mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 05:25:13 +00:00
Kernel: Force y offset 0 when switching between console & graphics modes
This fixes a weird bug that when sometimes a user tried to switch to console mode, the screen was frozen on graphics mode. After a hour of debugging this, it became apparent that the problem was that we left the y offset of the bochs graphics device in an invalid state, so it was not zero because the WindowServer changed it, and the framebuffer console code is not aware of horizontal and vertical offsets of the framebuffer screen, leading to the problem that the framebuffer console updates the first framebuffer (y offset = 0), but hardware was indicated to show the second framebuffer (y offset = first framebuffer height). Therefore, when doing a switch between these modes, always set the y offset to be zero.
This commit is contained in:
parent
659b0d7fb4
commit
9bec9c2b78
Notes:
sideshowbarker
2024-07-17 11:14:18 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/9bec9c2b78 Pull-request: https://github.com/SerenityOS/serenity/pull/13928 Reviewed-by: https://github.com/linusg
1 changed files with 4 additions and 0 deletions
|
@ -56,6 +56,10 @@ bool DisplayConnector::console_mode() const
|
|||
void DisplayConnector::set_display_mode(Badge<GraphicsManagement>, DisplayMode mode)
|
||||
{
|
||||
SpinlockLocker locker(m_control_lock);
|
||||
{
|
||||
SpinlockLocker locker(m_modeset_lock);
|
||||
[[maybe_unused]] auto result = set_y_offset(0);
|
||||
}
|
||||
m_console_mode = mode == DisplayMode::Console ? true : false;
|
||||
if (m_console_mode)
|
||||
enable_console();
|
||||
|
|
Loading…
Add table
Reference in a new issue