summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSahan Fernando <sahan.h.fernando@gmail.com>2021-06-25 22:57:09 +1000
committerAndreas Kling <kling@serenityos.org>2021-06-25 19:26:30 +0200
commitb569b2df35d3f109520033ff10220cfb28f7db67 (patch)
tree7d4c63f1006e68a5543cb2cf28823b5469d8dbe8
parentbab6fb76b7e17ea7e8d9438f638c0de9da7aa61c (diff)
downloadserenity-b569b2df35d3f109520033ff10220cfb28f7db67.zip
Kernel: Don't clear VirtualConsoles when initializing
Instead of calling clear() for each virtual console we initialize, we only call clear() when activating it from ConsoleManagement.
-rw-r--r--Kernel/TTY/ConsoleManagement.cpp2
-rw-r--r--Kernel/TTY/VirtualConsole.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/TTY/ConsoleManagement.cpp b/Kernel/TTY/ConsoleManagement.cpp
index f768fca6a4..01dbb46aa5 100644
--- a/Kernel/TTY/ConsoleManagement.cpp
+++ b/Kernel/TTY/ConsoleManagement.cpp
@@ -61,6 +61,8 @@ UNMAP_AFTER_INIT void ConsoleManagement::initialize()
m_active_console = m_consoles[tty_number];
ScopedSpinLock lock(m_lock);
m_active_console->set_active(true);
+ if (!m_active_console->is_graphical())
+ m_active_console->clear();
}
void ConsoleManagement::switch_to(unsigned index)
diff --git a/Kernel/TTY/VirtualConsole.cpp b/Kernel/TTY/VirtualConsole.cpp
index 7dfc4a66d2..08dde9b15c 100644
--- a/Kernel/TTY/VirtualConsole.cpp
+++ b/Kernel/TTY/VirtualConsole.cpp
@@ -126,7 +126,6 @@ UNMAP_AFTER_INIT void VirtualConsole::initialize()
for (size_t row = 0; row < rows(); row++) {
m_lines.append({ true, 0 });
}
- clear();
VERIFY(m_cells);
}