summaryrefslogtreecommitdiff
path: root/Kernel/Graphics/Console
diff options
context:
space:
mode:
authorSahan Fernando <sahan.h.fernando@gmail.com>2021-06-12 23:07:44 +1000
committerAndreas Kling <kling@serenityos.org>2021-06-25 19:26:30 +0200
commitb9ad6058aa05b723c51beac35184ab29f7cbc113 (patch)
tree1165d9753fae4df6569c6be61c4121b735bd7c03 /Kernel/Graphics/Console
parentb569b2df35d3f109520033ff10220cfb28f7db67 (diff)
downloadserenity-b9ad6058aa05b723c51beac35184ab29f7cbc113.zip
Kernel: Add VirtIOGPU graphics device
Diffstat (limited to 'Kernel/Graphics/Console')
-rw-r--r--Kernel/Graphics/Console/Console.h1
-rw-r--r--Kernel/Graphics/Console/ContiguousFramebufferConsole.h2
-rw-r--r--Kernel/Graphics/Console/GenericFramebufferConsole.cpp8
-rw-r--r--Kernel/Graphics/Console/GenericFramebufferConsole.h1
-rw-r--r--Kernel/Graphics/Console/TextModeConsole.h1
-rw-r--r--Kernel/Graphics/Console/VGAConsole.h1
6 files changed, 8 insertions, 6 deletions
diff --git a/Kernel/Graphics/Console/Console.h b/Kernel/Graphics/Console/Console.h
index 181db2e07f..949c5fc66f 100644
--- a/Kernel/Graphics/Console/Console.h
+++ b/Kernel/Graphics/Console/Console.h
@@ -58,6 +58,7 @@ public:
virtual void write(size_t x, size_t y, char ch, Color background, Color foreground, bool critical = false) = 0;
virtual void write(size_t x, size_t y, char ch, bool critical = false) = 0;
virtual void write(char ch, bool critical = false) = 0;
+ virtual void flush(size_t x, size_t y, size_t width, size_t height) = 0;
virtual ~Console() { }
diff --git a/Kernel/Graphics/Console/ContiguousFramebufferConsole.h b/Kernel/Graphics/Console/ContiguousFramebufferConsole.h
index bf4d458566..6d8159f814 100644
--- a/Kernel/Graphics/Console/ContiguousFramebufferConsole.h
+++ b/Kernel/Graphics/Console/ContiguousFramebufferConsole.h
@@ -15,7 +15,7 @@ public:
static NonnullRefPtr<ContiguousFramebufferConsole> initialize(PhysicalAddress, size_t width, size_t height, size_t pitch);
virtual void set_resolution(size_t width, size_t height, size_t pitch) override;
- virtual void flush() override { }
+ virtual void flush(size_t, size_t, size_t, size_t) override { }
private:
virtual u8* framebuffer_data() override
diff --git a/Kernel/Graphics/Console/GenericFramebufferConsole.cpp b/Kernel/Graphics/Console/GenericFramebufferConsole.cpp
index 6fe72f9940..0ef73407a0 100644
--- a/Kernel/Graphics/Console/GenericFramebufferConsole.cpp
+++ b/Kernel/Graphics/Console/GenericFramebufferConsole.cpp
@@ -232,7 +232,7 @@ void GenericFramebufferConsole::clear(size_t x, size_t y, size_t length)
memset(offset_in_framebuffer, 0, width() * sizeof(u32));
offset_in_framebuffer = (u32*)((u8*)offset_in_framebuffer + width() * 4);
}
- flush();
+ flush(0, 8 * y, 8 * length, 1);
return;
}
for (size_t index = 0; index < length; index++) {
@@ -247,8 +247,8 @@ void GenericFramebufferConsole::clear(size_t x, size_t y, size_t length)
memset(offset_in_framebuffer, 0, 8 * sizeof(u32));
offset_in_framebuffer = (u32*)((u8*)offset_in_framebuffer + width() * sizeof(u32));
}
+ flush(8 * x, 8 * y, 8, 8);
}
- flush();
}
void GenericFramebufferConsole::clear_glyph(size_t x, size_t y)
@@ -259,7 +259,7 @@ void GenericFramebufferConsole::clear_glyph(size_t x, size_t y)
memset(offset_in_framebuffer, 0, 8 * sizeof(u32));
offset_in_framebuffer = (u32*)((u8*)offset_in_framebuffer + width() * sizeof(u32));
}
- flush();
+ flush(8 * x, 8 * y, 8, 8);
}
void GenericFramebufferConsole::enable()
@@ -313,6 +313,7 @@ void GenericFramebufferConsole::write(size_t x, size_t y, char ch, Color backgro
}
offset_in_framebuffer = (u32*)((u8*)offset_in_framebuffer + width() * 4);
}
+ flush(8 * x, 8 * y, 8, 8);
m_x = x + 1;
if (m_x >= max_column()) {
m_x = 0;
@@ -320,7 +321,6 @@ void GenericFramebufferConsole::write(size_t x, size_t y, char ch, Color backgro
if (m_y >= max_row())
m_y = 0;
}
- flush();
}
void GenericFramebufferConsole::write(size_t x, size_t y, char ch, bool critical)
diff --git a/Kernel/Graphics/Console/GenericFramebufferConsole.h b/Kernel/Graphics/Console/GenericFramebufferConsole.h
index 2fda341a76..8207bc6a10 100644
--- a/Kernel/Graphics/Console/GenericFramebufferConsole.h
+++ b/Kernel/Graphics/Console/GenericFramebufferConsole.h
@@ -37,7 +37,6 @@ public:
virtual void disable() override;
virtual void set_resolution(size_t width, size_t height, size_t pitch) = 0;
- virtual void flush() = 0;
protected:
GenericFramebufferConsole(size_t width, size_t height, size_t pitch)
diff --git a/Kernel/Graphics/Console/TextModeConsole.h b/Kernel/Graphics/Console/TextModeConsole.h
index 54f512f26e..1950d098a4 100644
--- a/Kernel/Graphics/Console/TextModeConsole.h
+++ b/Kernel/Graphics/Console/TextModeConsole.h
@@ -28,6 +28,7 @@ public:
virtual void write(size_t x, size_t y, char ch, bool critical = false) override;
virtual void write(size_t x, size_t y, char ch, Color background, Color foreground, bool critical = false) override;
virtual void write(char ch, bool critical = false) override;
+ virtual void flush(size_t, size_t, size_t, size_t) override { }
virtual void enable() override { }
virtual void disable() override { VERIFY_NOT_REACHED(); }
diff --git a/Kernel/Graphics/Console/VGAConsole.h b/Kernel/Graphics/Console/VGAConsole.h
index e82f1d5e59..b10f5110c8 100644
--- a/Kernel/Graphics/Console/VGAConsole.h
+++ b/Kernel/Graphics/Console/VGAConsole.h
@@ -26,6 +26,7 @@ public:
virtual bool is_hardware_paged_capable() const override { return false; }
virtual bool has_hardware_cursor() const override { return false; }
+ virtual void flush(size_t, size_t, size_t, size_t) override { }
virtual ~VGAConsole() = default;