1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:47:35 +00:00

Kernel: Add VirtIOGPU graphics device

This commit is contained in:
Sahan Fernando 2021-06-12 23:07:44 +10:00 committed by Andreas Kling
parent b569b2df35
commit b9ad6058aa
21 changed files with 1050 additions and 13 deletions

View file

@ -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() { }

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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(); }

View file

@ -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;